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.
How can I solve this problem?