Very Fast Gun Fire Problem

If I have a gun with very fast fire rate, like 0.003 second per shoot, and my game run at 0.008 second per tick, then the gun first shoot at first frame, the second shoot shoud fired between the first frame and the second frame, so the gun lost 2 shoot between two frames, the gun fired slower then I expect, How do I fix it without changing fire rate?

Are you using a timer for this?

and my game run at 0.008 second per tick,

On your PC, not on mine or the next guy’s.


Here’s what I mean:

Timer firing faster than (and in between) the Ticks. No shots lost.

Yes this is a problem and you have to write some logic around this. If you for example do your shooting in the tick event , you also receive the DeltaSeconds since your last tick. If the DeltaSeconds are too high you have to calculate all ■■■■■ in this timeframe and not only one.

This is the kind of problem which also every AAA title has during development.

Simply find out how many shots have to be fired in the timeframe and shoot the suiting amount.

The tick is always changing. The more fps your game has the more ticks you have and the shorter is the time between ticks.