• Advertisement
Sign in to follow this  

p2.js sync bodies vs non-sync bodies

Recommended Posts


Can someone help me with this issue?

Basically I've setup 2D physic simulation and divided bodies into two groups. Bodies that synchronize through internet and bodies that not. (sync bodies & non-sync bodies)

These non-sync bodies can still hit sync-bodies, but they take all solving-force on them. Ie. non-sync bodies can't affect sync bodies / sync bodies behave like static-bodies to non-syncbodies.

Imagine rain drops. In each user raindrops are in random places so not in the same positions as in other users. Raindrops hit a ground or some sync-body cube and affect cube-velocities. It would leads to desync of worlds in each user. So non-sync bodies (raindrops) can't make any change in sync bodies. When raindrop hits synced-cube, cube is like static for raindrops.

WEBM shows the case a little: https://webmshare.com/Av4bE

As you can see on video there is a problem. Indeed sync-bodies behave like static when collide with non-sync (gray one) and it is good, but quickly it gets desync. So there must be some other variables that should I take care of. But I can't find them. Details and my progress is in this issue (link at the begining of post)

Please help, because p2.js community is probably almost dead..

Edited by PsychoPotato

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Advertisement