I’ve been working on a simple real-time multiplayer prototype for some time now. I’ve reached the point where I’ve integrated the NAPE physics library on the client side… however, since you’re never to trust the user I need to emulate the physics on the server side to always verify what’s being processed.
The server is written in NodeJS… How would you approach this?
There’s a NPM module for Nape, would the implementation be the same on the server-side, like on the client side?
Personally, to me, “never trust the user” does not extend to matters of physics. Let the client-side code resolve the moment-by-moment game play as seen by that user, and report outcomes to the central game server. Presume that the player has not hijacked your client-side code.