Physic based network game. How to?

Hi!

I’m very inspired by games like Gang Beasts and Party Animal and want to make something similar but simpler. Something like football without rules with lot of ragdoll simulations.

I have started with very simple concept - replicating ragdoll hit:

  • Player 1 hit Player 2,
  • activating ragdoll,
  • applying impulse,
  • watching nice phys sim,
  • simple standing “anim” with Set All Bodies Physics Blend Weight after ragdoll stops.

There are few approaches here, how to do replication:

  1. Deterministic lockstep: we sending only players inputs. I have tryed it and this is doesn’t work, because ragdoll is non deterministic system. Position of ragdoll after simulation is always different on Client and Server.

  2. Snapshot interpolation. I’m planing 4x4 game, it’s means max 8 players per game + “cubic ball”. I’m planning simple chars with only 10 rigid bodyes. In total 81 rigid body to sync (this is max, only in case if everybody in ragdoll state). Not too much. Main problem is input delay. Player press hit, send command to server, server simulate physics and send snapshot back. Actually we need few snapshots to start to interpolate without crazy jitters, we have to make interpolate buffer. It’s mean delay in total will be huge for that kind of competition game. Even if we increase network rate to 60 and compress snapshots to min size. We can’t start to do anything on the client before server gets input and sends few snapshots back to client.

  3. Simulate physics on Client and Server with States sync + some advanced details from Rocket League experience (It IS Rocket Science! The Physics of Rocket League Detailed - YouTube). But in this case i just don’t know how to do any kind of client prediction of ragdoll. How can we simulate several frames from specific State from server? And anyway we will meet again the problem with non deterministic system. Result of simulation of few frames and server position of same timestamp (same frame) will be little bit different. Am i right? Or what i’m missing?

I have read many threads on this subject. I have found that UE 5 works with Chaos phys engine now. And chaos have Rewind API. But actually i didn’t find any docs about it… And how to use it for client side prediction. If anybody know about it, please let me know. Code samples very appreciated =)

Also i have found Network Prediction plugin with Extras from Epics and Dave Ratti. After installation i have opened few maps and tried to start simulations. But i getting crashes everytime… I checked source code. And omg, for me it’s almost impossible to undestarnd. Thousands lines of code… And i even can’t start to just move with debugger because of crashes on some check(false) or other type of check(). I think i have to do some setups, but which ones i don’t know. Anyway, without really good docs it’s difficult to understand what happening inside and how can i use it in my case. Any help with explanation how this code works and how i can use it for my case very appreciated.

If anybody wants to join to my research - you are welcome. Any help is greatly appreciated.

P.S. @Jambax , i will be glad to see you in this topic =)
P.P.S. If anybody know technical details of how Gang Beasts and Party Animal works with network please share it here =)
P.P.P.S Sorry for my poor English.

UPDATE:
Current status of Network Prediction plugin:

It’s sad, but other people also getting crashes.

Maybe somebody know something about Chaos rewind and resimulation methods?

GetPhysicsScene()->ResimNFrames(NumFrames) for example.

No any info in docs about it.

Hey, did you make any new progress on this? Researching this topic now. Chaos seems to be unusable unless you are skilled enough to write your own client prediction…