Trivia: weapon delay between pressing button and firing


(SCDS_reyalP) #1

I always thought that most weapons in RTCW/ET were instant fire. e.g. when you press your mouse button, your pistol or SMG would fire as soon as possible. I recall bani mentioning a 100 ms delay on scoped weapons, and assumed that was to simulate snipers having to lead…


// these defines are matched with the character torso animations
#define DELAY_LOW		100	// machineguns, tesla, spear, flame
#define DELAY_HIGH		100	// mauser, garand
#define DELAY_PISTOL	100	// colt, luger, sp5, cross
#define DELAY_SHOULDER	50	// rl
#define DELAY_THROW		250	// grenades, dynamite

Guess which ones SMGs and pistols use (in both ET and RTCW). :banana:

GG, adding 100ms to our effective ping ALL THE TIME :moo: (and yes, I have verified that these values are actually used. Actually, I noticed the delay while debugging something else, and after a bit of :banghead: worked my way back to the obvious code…)

See PM_Weapon for where this actually happens.


(Spark) #2

It was the first thing I noticed (yes, felt) in RTCW and which annoyed me. Initially I thought it was just crappy netcode. When I learned what it actually was, I thought it was silly. :slight_smile: But meanwhile I got used to it and when I removed the delay, it felt incredibly awkward to me. shrug


(bacon) #3

You just noticed this? I’m with spark in that I noticed it in RTCW when the source code came out; and also saw what happened when it was changed to 0.


(SCDS_reyalP) #4

LOL, I guess I’m just slow. I actually should have noticed, since I have looked at that code before, but just glossed over it. Though knowiing know, it explains some things I just attributed to bad hitboxes/antilag…

and also saw what happened when it was changed to 0.

Do you mean that in terms of different ‘feel’ or some other negative side effect ?


(Korollary) #5

In ammoTableMP, scoped garand & k43 have 0 delay, though.
Also, it’s sorta funny to require snipers to lead. In real life, it’s not a good idea for a sniper to shoot at moving targets from 4 miles away.
If the distance in ET maps mean anything, you are usually shooting from about 100-150 yards. With supersonic bullets, you’d have to lead about 6-10 inches.

During the hitbox tests with bani, didn’t we discover that moving the scope ruins your spread so badly anyway that you couldn’t get a hitshot ? This is all moot anyways. Sniper rifles are the red headed stepchildren in ET.

GG, adding 100ms to our effective ping ALL THE TIME :moo: (and yes, I have verified that these values are actually used. Actually, I noticed the delay while debugging something else, and after a bit of :banghead: worked my way back to the obvious code…)

Yes, this is more absurd. This happens when developers sorta try to add realism (simulating trigger delay??) to a game when they don’t know what they are doing.

The game gives no indication that your shot was delayed because you know you are not on a lan. The more important questions is: does the delayed shot have the direction from when you +attack’ed, or the direction you are facing 100ms after the +attack ? (I am not familiar with those parts of the code) Does it have the spreadscale from 100ms after as well ?

It makes more sense to have the direction from 100ms after. That by itself can blur your aim. Add spreadscale to it. Yumm. Thanks for shooting on the move…


(SCDS_reyalP) #6

100ms after. The delay is effectively the same if it took 100ms for the button click to get from your mouse to your computer.

You can see this by turning g_debugbullets on, strafing back and forth in front of something like a telephone pole, and trying to shoot exactly has your crosshair touches the edge of the pole.

I hadn’t noticed the zero on sniper rifles. Interesting…


(bani) #7

iirc the delay is so that the tracer matches up with the animation of the gun.


(Korollary) #8

Of course! :clap: Otherwise, casual players would have reacted in rage as to why they hit their target even though the SMG didn’t complete its animation yet !

From now on I will have cg_drawgun 1 so that I can better appreciate the mechanics of firing an MP40. :rofl: