Skip to main content
added 100 characters in body
Source Link

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?

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?

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?

"Which library to use" is off-topic, but "how can I solve this problem (potentially with the help of libraries)" is not, so I've tried to keep this question open.
Source Link
DMGregory
  • 141k
  • 23
  • 258
  • 401

Solution for 2D cloud How to rotate body in server-side physics without imparting angular velocity?

I'm developing a 2D cloud-based MMO using WebSocket and have struggled a lot to find aget proper working physics library foron the server side. I'm using Next.js for the client and currently Node.js for the server.

iI 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 inat a high-frequency 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.

Is there a better solution for my needHow can I solve this problem?

Solution for 2D cloud physics

I'm developing a 2D cloud-based MMO using WebSocket and have struggled a lot to find a proper physics library for 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 in 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.

Is there a better solution for my need?

How to rotate body in server-side physics without imparting angular velocity?

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?

edited tags
Link
Source Link
Loading