I wanted to write a multiplayer game using a physics engine. The client uses the physics engine for calculations and displays the results just in time, but of course, the server needs to simulate the whole thing, too.
Afaik, clients usually send velocity and position to the server. My idea was to send the key presses to the server instead.
Sending positions/velocity:
- Server needs to interpolate the movement.
- I have no idea how to feed a physics engine with this data.
- On interpolation, the results might not be exact.
Sending key presses
- I can feed the server's physics exactly like on the client (by key presses). This means less code!
- No interpolation needed.
So, what could be bad with my idea? Why isn't it (afaik) used in games?