Left 4 Dead 2

Left 4 Dead 2

View Stats:
Today's lesson in game mechanics - Dual Pistol fire rate
Did You Know: the dual pistol cycle time (the inverse of fire rate) is actually 0.075 seconds?

Pretty much everyone thinks it's 0.0875 seconds. They're all wrong - they took the single pistol fire rate, 0.175 seconds, and cut it in half, thinking that's how dual pistols work. Nope! Dual pistols are hard coded in the engine to be 0.075 seconds cycle time.

Now, does this really matter? Not normally. The real cycle time is 2.25 server ticks, and since the game state is only updated on integer multiples of a server tick, that means in practice the dual pistol fire rate is 3 server ticks = 100 ms = 10 bullets per second maximum. The fake cycle time is 2.625 server ticks, which still rounds up to 3 ticks = 100 ms

...but...let's say you're playing on a 100 tick server. That means each tick is now 10 ms. The real pistol fire rate is 7.5 ticks = 8 ticks = 80 ms = 12.5 bullets per second. The mistaken pistol fire rate is 8.75 ticks = 9 ticks = 90 ms = 11.1 bullets per second. So on a 100 tick server, the dual pistols will appear to faster fire than they should, even after accounting for the enhanced tick rate.

You may have noticed that the 100 tick server still shoots more bullets per second than it should even if you adjusted the cycle time to match the theoretical 0.0875. Since none of these fire rates are multiples of the original 30tick period (33.33ms), _any_ change to tick rate will mess things up.

In practice, there are "zones" for the two dual pistol rates, based on the number of ticks it takes for the pistols to fire.

For the true pistol rate, from 30-40 ticks, it gets faster, always taking three ticks, and going from 100 ms or 10 bullets per second at 30 ticks, down to 75 ms at 40 ticks, where the dual pistols are at their maximum speed of 13.33 bullets per second.

41-53 ticks, which take 4 ticks to cycle, ranging from 98 ms to 75.5 ms, or 10.25 bullets to 13.25 bullets per second.

54-66 ticks, 92.6 ms to 75.8 ms, 10.8 bullets to 13.2 bullets per second.

67-80 ticks, 89.6 ms to 75 ms, 11.2 bullets to 13.33 bullets per second.

81-93 ticks, 86.4 ms to 75.3 ms, 11.6 bullets to 13.28 bullets per second.

94-100 ticks, 85.1 ms to 80 ms, 11.75 bullets to 12.5 bullets per second.

---

Noteworthy is that, while the expected/actual fire rate for dual pistols is different because it's hard coded into the engine, all guns will fire at different rates when the tickrate is increased because of the "tick zones" described above.

EDIT:

Intriguingly, an 80 tick server with 12.5 ms ticks would allow almost every gun to fire at its "true" fire rate. The only weapons that I'm aware of with a cycle time not a multiple of 0.0125 are weapon_rifle_desert and weapon_rifle_m60. It still also nicely lines up with 100ms multiples, which is a time period often used for a lot of "think" calls by the AI.
Last edited by scintillating luminescence; Mar 13, 2015 @ 12:42pm
< >
Showing 1-4 of 4 comments
shiftygonzales Mar 13, 2015 @ 2:50pm 
Yep, those are numbers alright. Good job.
Falufa Apr 5, 2016 @ 10:46pm 
Sorry to revive a topic after more than 1 year, but where did you find the dual pistols cycle rate to be 0.075? It doesn't show up on the weapon script files and i've been wondering about these "hidden" values, like the burst delay on the combat rifle and the zoomed fire rate on the SG552.
Last edited by Falufa; Apr 5, 2016 @ 11:20pm
Spooky Boi Apr 6, 2016 @ 5:39am 
inb4 necro
Zombie Tsunami Apr 6, 2016 @ 9:55am 
i just wish the pistols in l4d2 fired as fast as the pistols in l4d1
< >
Showing 1-4 of 4 comments
Per page: 1530 50

Date Posted: Mar 13, 2015 @ 12:20pm
Posts: 4