Jump to content
  • Advertisement
Sign in to follow this  

p2.js sync bodies vs non-sync bodies

This topic is 634 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


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

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!