ValveSoftware / source-sdk-2013

The 2013 edition of the Source SDK
https://developer.valvesoftware.com/wiki/SDK2013_GettingStarted
Other
3.84k stars 2.02k forks source link

Fixed server physics when server has custom tickrate #515

Open tyabus opened 3 years ago

neico commented 3 years ago

Shouldn't the client tickrate also be adjusted? Otherwise it would desync?

https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/client/physics.cpp#L180

-physenv->SetSimulationTimestep( IsXbox() ? DEFAULT_XBOX_CLIENT_VPHYSICS_TICK : DEFAULT_TICK_INTERVAL );
+physenv->SetSimulationTimestep( IsXbox() ? DEFAULT_XBOX_CLIENT_VPHYSICS_TICK : gpGlobals->interval_per_tick );
tyabus commented 3 years ago

Shouldn't the client tickrate also be adjusted? Otherwise it would desync?

https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/client/physics.cpp#L180

-physenv->SetSimulationTimestep( IsXbox() ? DEFAULT_XBOX_CLIENT_VPHYSICS_TICK : DEFAULT_TICK_INTERVAL );
+physenv->SetSimulationTimestep( IsXbox() ? DEFAULT_XBOX_CLIENT_VPHYSICS_TICK : gpGlobals->interval_per_tick );

I've ran hl2dm server at 44 tickrate with this like for a year, and i didn't noticed any strange behavior on client.