ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.68k stars 623 forks source link

[HL / CS1.6] Client-side isn't predicting recoil "pev->punchangle" (REG) #82

Open MPNumB opened 11 years ago

MPNumB commented 11 years ago

So, this issue effects all GoldSource games, and results in people thinking there's bad reg on the server.

pev->punchangle variable is responsible for weapon recoil and some more things. Thing is, cl_lw 1 client side cvar predicts weapon animations, and fire rate, bullet destination, but is ignoring the weapon recoil.

Due to this, whenever people are playing at ping above 30ms (average human eye registration time), it starts to be become strange at times, cause the weapon recoil what player is seeing isn't the actual recoil what is happening on the server. The higher the ping is, the more noticeable the effect becomes.

With this fixed, gameplay experience would improve significantly.


On a similar subject, pev-punchangle is automatically added into pev->v_angle, therefor when dead person is watching someone in first person view, the recoil appears twice bigger, cause player updated angles and the actual recoil is sent to the dead client. Fix for that is, to simply set punchangle to {0.0, 0.0, 0.0} in UpdateClientData function for dead players, when they are in first person view mode (pev->iuser1 == 4).

Antoweif commented 11 years ago

Here we go. This is what I tried to explain in #188, but failed. Even cl_lw 0 is somehow ignoring weapon recoil.

Maxi605 commented 4 years ago

@mikela-valve hope this can get solved.