19 hours ago, hplus0603 said:
Gaming monitors now run at 120 and 144 Hz, so you'd want to make sure your simulation is at least at that rate.
We use a fixed timestep game loop so that the sim doesn't care what the refresh rate is. We could sim at 10Hz and the rendering would still look smooth
In that example situation though, yeah the vehicles would have 0 to 100ms extra input latency (avg 50ms), but we still poll inputs once per visual frame, so some inputs such as a "buy item" command could produce HUD changes and audio responses on the next visual frame (at 144Hz) even though the sim might not tick for another 100ms.
The main choice for the simulation tick rate is physics accuracy vs performance. Simulating at 500Hz to 1000Hz gives great vehicle physics accuracy, but means we don't have enough CPU time to predict the future. Simulating at 30Hz gives awful physics accuracy. Somewhere in 60Hz to 300Hz seems to be our sweet spot at the moment... And lower is better given the need to be able to do client side repredictions
We also use higher rates currently for just the tire friction model - it's running at 600Hz for stability, even though the rest of the physics is at 60Hz!
19 hours ago, hplus0603 said:
Another thing you can do if you don't want to re-simulate, is to keep track of pos/ori/velocity/spin at the past time frames, and when you get the correction, calculate the delta in P/O/V/S, and add those deltas to the current state, rather than re-simulate from the past. It won't be as precise, but it may be good enough
This might be my fall back for high ping players who don't have the CPU power to repreidct a half RTT worth of future constantly. I gave it a quick go, but the error deltas would occasionally move the car into a position that intersects an obstacle, causing physics mayhem on the client! I may have to try again but with gentle kinematic velocity nudges towards the predicted position instead of moving it there instantly via teleportation...