ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.57k stars 596 forks source link

Question: Firing rate does not depend on client or server framerate? #2555

Open djdallmann opened 4 years ago

djdallmann commented 4 years ago

Can you provide more info about this change, what does it depend on?

Improved firing behavior in Counter-Strike, Counter-Strike:Condition Zero and Half-Life Deathmatch, it is no longer dependant on client or server frame rate. This change needs both your client and server updates to see the improvements.

https://steamcommunity.com/games/10/announcements/detail/1802838328069953132

SamVanheer commented 4 years ago

This is the code in question that was added: https://github.com/ValveSoftware/halflife/blob/c7240b965743a53a29491dd49320c88eecf6257b/dlls/weapons.cpp#L1192-L1221

For an example, compare: https://github.com/twhl-community/HalfLifeSDKHistory/blob/45df836c0edd026c8fd79ccb9bb0f3180a58325a/dlls/mp5.cpp#L188

With: https://github.com/ValveSoftware/halflife/blob/c7240b965743a53a29491dd49320c88eecf6257b/dlls/mp5.cpp#L188

It accounts for the time between the next allowed shot and the next time the player's input can be processed. Previously due to frame rate limits the actual next shot time would vary and the creep time would accumulate, resulting in a slowing fire rate.

The issue that addressed this, along with the fix can be found here: https://github.com/ValveSoftware/halflife/issues/802

It's worth noting that the change was reverted for CS 1.6. I checked the code and CZ also had the change reverted.

djdallmann commented 4 years ago

Thanks

PRinceBhai commented 4 years ago

Does the recoil also works upon server or client side's fps?

SamVanheer commented 4 years ago

Server FPS.