jaipack17 / Nature2D

A 2D physics engine for Roblox. Create versatile physics simulations and mechanics with GUIs!
https://jaipack17.github.io/Nature2D/
MIT License
147 stars 8 forks source link

2D multiplayer sync? #44

Open epibirikka opened 1 year ago

epibirikka commented 1 year ago

I have a game idea stuck in my head that depends on 2D multiplayer physics.

But how do you think one would implement this with less bandwidth close to how Roblox does live physics step-by-step? Surely it would be more than just remote-events.

Toastaspiring commented 1 year ago

As for now, Firing events is the only way, if the movements are basic, the bandwidth used won't be Huge. if you just fire one event with a metatable inside containing the info you won't have to spam multiple events every tick. hope this helps

epibirikka commented 1 year ago

As for now, Firing events is the only way, if the movements are basic, the bandwidth used won't be Huge. if you just fire one event with a metatable inside containing the info you won't have to spam multiple events every tick. hope this helps

Okay, so what about colliding with the real 2D world if your 2D character is desynced from the server's physics?

Roblox (in 3D) can handle reactions to collisions of unanchored parts from players moving or one of their projectiles. Recalling from BONK.io, you can collide with other players by force and they'll fly right away.

jaipack17 commented 1 year ago

I have never tried this in the past, so I can't say much. "Server-sided" UI itself is quite difficult to get working with precision, which can only be done through events as Dsioul said. There are a few games I have seen on Roblox like a flappy bird clone that was made with UI and supported multiplayer. I'm not sure whether they took a path other than events but you could try with events first and then try to slim down on bandwidth as much as you can perhaps?