Firerate calculation?

Freeform discussion about anything related to modding Transcendence.
Post Reply
Amariithynar
Militia Commander
Militia Commander
Posts: 255
Joined: Sat Apr 30, 2011 9:58 pm

Dunno where to put this, so popping it into Commonwealth- What's the firerate calculation used in game? Ares Archcannon is 80, with 0.8 shots/sec. The mark I howitzer has a fire rate of 40, but only 1.5 shots/sec. Fast-fire laser is 5, with 10 shots/sec, and bolide laser is 10, at 6 shots per sec. If I spent enough time I might be able to figure it out... but if someone already knows, that'd be awesome.

EDIT: SDW thinks he might have found something here. I can't read code worth a damn, but if someone can confirm/deny?

Code: Select all

 1 CString GetReferenceFireRate (int iFireRate)
 2   {
 3   if (iFireRate <= 0)
 4     return NULL_STR;
 5 
 6   int iRate = (int)((10.0 * g_TicksPerSecond / iFireRate) + 0.5);
 7   if (iRate == 0)
 8     return CONSTLIT(" @ <0.1 shots/sec");
 9   else if ((iRate % 10) == 0)
10     {
11     if ((iRate / 10) == 1)
12       return strPatternSubst(CONSTLIT(" @ %d shot/sec"), iRate / 10);
13     else
14       return strPatternSubst(CONSTLIT(" @ %d shots/sec"), iRate / 10);
15     }
16   else
17     return strPatternSubst(CONSTLIT(" @ %d.%d shots/sec"), iRate / 10, iRate % 10);
18   }
PM
Fleet Admiral
Fleet Admiral
Posts: 2570
Joined: Wed Sep 01, 2010 12:54 am

Shots per second = 60 / fireRate.

Odd numbered fireRate is treated as fireRate + 1. For example, 15 is treated as 16.
Download and Play in 1.9 beta 1...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Play a classic arcade game adventure, with or without more features (like powerups)!
Playership Drones: Buy or restore exotic ships to command!

Other playable mods from 1.8 and 1.7, waiting to be updated...
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
Amariithynar
Militia Commander
Militia Commander
Posts: 255
Joined: Sat Apr 30, 2011 9:58 pm

thanks!
Post Reply