# How to Calculate the Rate of Fire of Weapon

Goto Page
1
Masea
Super User
Offline
The descriptions of the weapons listed in http://www.cs2d.com/weapons.php reveal the rate of fire (rounds/min) of weapons. How is this calculated may I ask?
Create your UI easy and fast: UI Framework | Go deeper into the darkness and test your bravery: Outlast 2 Modification (27)
08.09.19 04:36:17 pm
DC
Offline
The formula is:
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
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
1
﻿