#Multiplayer replication for walking inside of a physics simulated spaceship in orbit

1 messages · Page 1 of 1 (latest)

minor oracle
#

Ships are in constant acceleration due to orbiting.
Network Tick Rate is 120hz. Server Authoritative.
This is at average latency emulation with 30 to 60 ping + 1% packet loss. Both are clients.
Ships themselves stay smooth even at 150+ ping but the character motion doesn't use the same replication method so they can get laggier. I'm so happy this works I wanted to share.

viscid orchid
#

dont know your exact solution
but i use relative transforms for replication of characters and attach them to actors like planets or spaceships
this way they wont lag out of the ship even if you move at insane speeds and bad ping since the last char transform is still the relative transform inside the spaceship and they dont depend on matching spaceship transforms

guess my solutions isnt the best either but it works great for now.. seams like the only problem with this solution is if the clients somehow dont know about which actor the other player is attached to

minor oracle
# viscid orchid dont know your exact solution but i use relative transforms for replication of c...

Mine is similar, I also attach the player to the ship and use relative transforms. But I also have an extra navigation mesh that represents the ship's layout which guides the walkable surface, that way I don't have to deal with any collisions (Also makes it easy to make stairs, elevators and circular walkable surfaces for spin stations). When you start walking on a different navigation mesh you seamlessly switch attachment to that mesh, and you can't exit a nav mesh unless you start walking on another one (or get explicitly set by the server).

#

How do you handle ship physics replication?

viscid orchid
#

ohh.. so your player can only move along this custom made navmesh mesh so he cant walk inside the wall even though it has no collision?
well my game is a bit more complex cause i have vr support with physics characters
i basicly have 2 spaceships
the physics ship that handles the spaceship movement stuff (replication is basicly only transform updates for now and i wanted to try the smooth sync plugin at some point)
and an moving static ship that just tp to the physics ship location
the player is inside the static one and can basicly move there like he would move on an regular map

so yea.. my spaceship replication is very simple but enaugh for now since the characters dont depend on it

minor oracle
#

I stole how Rocket League networks physics, there's a GDC talk about it, networking starts at about the 32 minute mark.

minor oracle
#

I don't need very complex ship collisions so I made how the physics runs by scratch, Im not using the physics engine (for simulation)

#

I made it deterministic and run at exactly 120hz on both the server and the clients, syncs back with the server with rollback correction if anything gets desynced.

#

Since everything is also simulated on the clients I need almost no server correction, the orbital mechanics in the video needed syncing with the server only at the very beginning, at 0.33 and at 1.28. Pretty much only 3 corrections for 1½ minutes

#

Of course if the ships were being actively piloted there'd be more corrections to sync client inputs

minor oracle
viscid orchid
#

yea sounds like an interesting system but the rocket league one seams to be expensive for clients so this could be problematic for more complex games.
I dont know if that much precision is really needed for spaceship movement if you dont need to bump into other moving objects like in rocket league.
But im currently not that deep into the replication part anyway so guess i oversimplify it xd