1 Year Ago
Alternating client authoritative networking * Implement an alternating client authoritative model - whichever clients side of the table the ball is on gets complete authority over the ball position and velocity. * Physics are simulated entirely on the current authoritative client now. Pack the ball position into the UserCmd and the server sets the ball entity's position so the other client can see it and takeover when authority switches. * Substep the physics at fixed(ish) 0.005ms steps within FrameSimulate's delta time, each step moves the ball and checks against the paddle sweep. This may be unconventional but it gives us a perfect result and never misses. * Fix paddle collision sometimes sending the ball backwards because of a negative velocity length, added an abs.