Jump to content
  • Advertisement
Sign in to follow this  
PsychoPotato

p2.js sync bodies vs non-sync bodies

This topic is 551 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

https://github.com/schteppe/p2.js/issues/290

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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!