A simple network physical synchronization demo (based on ammojs + colyseus)

Hi, I’ve been studying the physics engine recently, including some work on the physical effect of network synchronization. I made a very simple demonstration. Because I’m not a professional developer of multiplayer games, please point out the shortcomings boldly.
The red mesh calculates the physical effects locally of the current user, and the green mesh calculates the physical effects on the clients of other players, and then synchronizes them through colyseus.

As for the player character, the sphere represents the player character, and the cube represents the interactive objects in the scene.

The first player to enter the scene is responsible for the physical calculation of the cube, and other players are responsible for receiving data and rendering. When other players collide with the cube, the physical calculation of the cube is transferred to the collided players. You can distinguish these changes by color, just like the difference between green and red mentioned above.

This is a very simple system. It will sacrifice some physical effects and has no server verification. However, you can still use it to achieve some recommended network physical collision effects.

github link:GitHub - renjianfeng/colyseus-babylonjs-ammojs: Network physical synchronization model room based on babylonjs + ammojs

be based on: GitHub - endel/colyseus-babylonjs-boilerplate: BabylonJS + Colyseus: Multiplayer Boilerpate

10 Likes

Amazing work !!! almost looks like a nice tutorial cc @PirateJC

2 Likes

This is VERY COOL! Great work and thank you very much for sharing with the community! :heart:

1 Like

Super awesome!! :open_mouth:

1 Like

This is very cool indeed @renjianfeng. I agree with @sebavan, this seems like maybe it could be a nice little tutorial to add to the documentation? Any interest in putting something together to teach people about what you’ve learned here?

If you’re interested, I think it might be nice to put it in here? Networking | Babylon.js Documentation

3 Likes

OK, I will finish it as soon as possible!!! :grinning:

3 Likes

You are AWESOME!

I have submitted an update :smiley:

4 Likes

Still fan of it. Please continue :clap:

2 Likes

Great, thanks a lot.

1 Like