• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

How to get the fire rate of an automatic gun.

YoYoBatty

Grizzled Veteran
Dec 17, 2009
3,457
2,501
Canada
When programming my MP5 today I ran into a small problem that I haven't really came across in a while, the fire rate. I wanted to detirmine the fire rate so what I did was this; I took the Rounds per minute of the weapon of which is 800 rpm, then I divided it by 1 minute (60 Seconds), the number I got was 13.333333333333333333333333333333, so I took 1000 and divided it by the the number I had before; 13.333333333333333333333333333333 and got about 75, and finally I moved the decimal to the left 3 times and gave me a fire rate 0f 0.075000.
 
huh ?
Let's start at the beginning:
your gun's firerate is 800 rpm -> 13.33 rounds per second so far so good.
but why do you take 1000 into the boat ? do you want to know rounds per milisecond or what is the thought behind your arithmetic ? *confused*

It's how TWI did it watch: MP7M has a fire rate of 950 rounds/min, divide by 60 you get 15.833333333333333333333333333333, then take 1000 and divide it by that previous number and you get about 63, move the decimal to the left 3 times you get 0.063000 which is the fire rate of the MP7M Medic Gun. You want proof? Look at the MP7MFire.uc located in the KFMod folder, you will find it in the default properties.
 
Upvote 0
I think your method is slightly overcomplicated.

Formula is 1 / (RPM / 60)
  • 1/(800/60)
  • 1/(13.333333333333333333333333333333)
  • 0.075
But whatever gets the result, I suppose. This is the way it works in nearly every other game too, aside from ones that use irregular time measurements like frames (e.g. Soldat as I recall).
 
Last edited:
Upvote 0
Gotta admit that confused me for a second since

800 rpm / 60 s = 13.333 rps

Then 1000 / 13.333 / 1000 is the same as 1000 / (13.333 x 1000)
and 1000 / 1000 / 13.333 is also 1000 / (1000 x 13.333)

= 1 / 13.333 as HCX said.

Still pondering why its an inverse to calculate ROF. Would like to know for interests sake, but I suppose I would require the whole calculation for Rate of Fire to understand it. :)
 
Last edited:
  • Like
Reactions: HCX
Upvote 0
I honestly couldn't tell you; I've long taken it for granted and forgotten that part of its logic.
saddowns.gif


Thanks, Entangler. Somehow couldn't remember for the life of me.
 
Last edited:
Upvote 0
It's how TWI did it watch: MP7M has a fire rate of 950 rounds/min, divide by 60 you get 15.833333333333333333333333333333, then take 1000 and divide it by that previous number and you get about 63, move the decimal to the left 3 times you get 0.063000 which is the fire rate of the MP7M Medic Gun. You want proof? Look at the MP7MFire.uc located in the KFMod folder, you will find it in the default properties.

I see, now I understand it ^^
 
Upvote 0