I'm developing a 2D cloud-based MMO using WebSocket and have struggled a lot to get proper working physics on the server side. I'm using Next.js for the client and currently Node.js for the server.
I don't have much code for the server, so I can easily migrate to another solution or language.
My game requires rotating a car explicitly, without affecting the angular velocity, because it does automatic turning of the car.
The server sends the serialized world to the client at a high frequency. I've first tried the Matter.js engine and, unfortunately, when I do body.rotation = n;
, it adds angular velocity out of nowhere, whether high or low, breaking the car movement entirely.
Another engine I've tried is Rapier.js.
For Rust, I'm not sure whether it worked or not because I had to deal with the lack of a properly-working WebSocket server (it did not send the world for example). For JavaScript, it failed to load the dynamic WebAssembly module.
How can I solve this problem?