Forum
CS2D General How to Calculate the Rate of Fire of WeaponHow to Calculate the Rate of Fire of Weapon
1 reply 1
rate of fire = floor(60000/($item['freq']*40))
60,000 ms = 60 secs = 1 minute
$item['freq']is the "frame delay" value which is also displayed at the page.
Due to various changes and tweaks in the history of CS2D this is NOT the actual number of frames between 2 shots anymore!
The actual minimum delay between two shots (in milliseconds) is
$item['freq']*39.
Fun fact: I'm actually not sure why in code it's a 39 and in the calculation it's a *40. Due to the peak frame rate of 60 the actual "fire rate precision" is limited to 1000/60 = 16.66 ms anyway so it doesn't make a noticeable difference. Probably it's just 39 in-game to compensate the actual delays caused by the frame rate cap a bit.
So the "rate of fire" is the number of shots you would in theory be able to fire in-game in one minute (real time). Assuming that you do not have to reload. The actual rate will always be a bit lower due to the 60 FPS frame rate cap (and of course it's MUCH lower if you take reloading into account).
btw: Not sure when I updated the website stats the last time. Current in-game values might differ. See
sys/weapons.cfg or sys/weapons_recoil.cfg (in case recoil is activated). They contain the currently used "firedelay" values (which are the "frame delay" values on the website).
edited 1×, last 08.09.19 04:48:29 pm
1