Source

Thread

1/ @bonzajplc

Me and my @plasticdemo team, escaping a wave of green aliens.

Here’s a showcase of a massive deterministic GPU simulation working in multiplayer .

Big immersive worlds are possible to run fluently online (we are in 400 km range).

Everyone is simulating exactly the same world.

2/ @bendzzArt

@bonzajplc @plasticdemo

how do you handle desyncs? Players desync all the time and affect the sim right?

3/ @bonzajplc

@bendzzArt @plasticdemo

No :). Generally we need to be 100% sure that the player will not desync

4/ @AgileJebrim

@bonzajplc @bendzzArt @plasticdemo

Oh that’s not workable at scale then lol. You need to rework your network protocol to utilize an eventual consistency UDP approach where you just constantly stream snapshots of current local state.

5/ @AgileJebrim

@bonzajplc @bendzzArt @plasticdemo

Be completely unreliable where it’s perfectly fine that any packet drops.

6/ @bonzajplc

@AgileJebrim @bendzzArt @plasticdemo

really hard with deterministic approach. The simulation cannot progress if you won’t agree that everyone has sent their actions. It’s probably not scallable to 1000’s of unrealiable players. it’s good for party of friends.

7/ @AgileJebrim

@bonzajplc @bendzzArt @plasticdemo

So where is the scale of the GPU being applied if not to the players? An enormous numbers of NPCs?

Next question: Is there an authoritative server involved or is this entirely peer-to-peer?

8/ @bonzajplc

@AgileJebrim @bendzzArt @plasticdemo

There is still a server. NPCs, physics, fluids, world destruction. Dynamic multiplayer world

9/ @AgileJebrim

@bonzajplc @bendzzArt @plasticdemo

Is the server running the code on a GPU too?

That’s very expensive hosting for only 4 players. That’s why I encourage an architecture that can scale to a massive number of players. You can then subdivide the hosting costs among many more users.

10/ @AgileJebrim

@bonzajplc @bendzzArt @plasticdemo

I guess the main reason you’re using the deterministic approach is to avoid sending all that vast dynamic state data across the network. Certainly an advantage on the bandwidth cost front.

11/ @59thProfile

@AgileJebrim @bonzajplc @bendzzArt @plasticdemo

right, only need to send inputs!

12/ @AgileJebrim

@59thProfile @bonzajplc @bendzzArt @plasticdemo

Yep. Fine for RTSes or anything with small player counts and many entities. He could stuff multiple independent running matches into a single server node and that might make it economical.

13/ @59thProfile

@AgileJebrim @bonzajplc @bendzzArt @plasticdemo

multiple, as in thousands probably

14/ @AgileJebrim

@59thProfile @bonzajplc @bendzzArt @plasticdemo

Tens of thousands. :P

15/ @59thProfile

@AgileJebrim @bonzajplc @bendzzArt @plasticdemo

yeah and if you do it right (i think bonzaj is missing something here) desync should be impossible and can potentially be used as anti-cheat primitive

16/ @AgileJebrim

@59thProfile @bonzajplc @bendzzArt @plasticdemo

Since his server is just a relay, he’s got no way to send someone the current state of the game newly connected or reconnected unless he either replays every packet that’s ever occurred or more likely just have one player forward a snapshot of their current state of the game.

17/ @AgileJebrim

@59thProfile @bonzajplc @bendzzArt @plasticdemo

The game is also only as fast as the slowest player’s connection if he’s doing it like I think he is. That’s not good.

18/ @bonzajplc

@AgileJebrim @59thProfile @bendzzArt @plasticdemo

Yeah, that’s why I look into consoles :)

19/ @AgileJebrim

@bonzajplc @59thProfile @bendzzArt @plasticdemo

Doesn’t do much good if they’re on WiFi and constantly disconnecting.

20/ @NOTimothyLottes

@AgileJebrim @bonzajplc @59thProfile @bendzzArt @plasticdemo

When it’s massive destruction, I can seen the appeal of deterministic sim. Now if the sim can run faster than real-time you can handle disconnection. Clients that dont make the sim frame’s time cut have to take a predicted future state for the sim frame ….

21/ @NOTimothyLottes

@AgileJebrim @bonzajplc @59thProfile @bendzzArt @plasticdemo

Reconnect, the server give the corrected past, run faster than real-time until time syncs again, with all the workarounds that requires. Same with late connection, you’ve see the game in fast forward until the timelines meet. At least you only sync action and not effect.

22/ @59thProfile

@NOTimothyLottes @AgileJebrim @bonzajplc @bendzzArt @plasticdemo

Server doesn’t have to do anything you could just relay the client

23/ @NOTimothyLottes

@59thProfile @AgileJebrim @bonzajplc @bendzzArt @plasticdemo

In my example the server is relaying the authoritive actions for the frame (or series of past frames). Assuming no P2P in the architecture. Note Im assuming the server is also running the sim to correct for clients behaviors on forward extrapolation state that players see.

24/ @NOTimothyLottes

@59thProfile @AgileJebrim @bonzajplc @bendzzArt @plasticdemo

Im working on something with non deterministic massive destruction. But locally relative sync of state between peers. So effectively the opposite design. But seeing full deterministic in the video, is quite inspiring.

25/ @bonzajplc

Maintaining that is quite a challange. yesterday I Introduced a change that breaks determinism randomly on one of the tests. The problem is that it triggered today after 10 other merges from the team.

Also I know now that driver updates can also break determinism. By that I mean between players. We can detect that their startup hashes (based on a test that coverages most of the features) is different and warn them that they may desync, but it’s quite nasty design

26/ @NOTimothyLottes

@bonzajplc @59thProfile @AgileJebrim @bendzzArt @plasticdemo

Haha, driver updates as in compiler changes to float ordering and factoring … if I went deterministic, I’d go to integer maths. But I did most of my learnings pre floating point, so integer is easy in the brain.

27/ @NOTimothyLottes

@bonzajplc @59thProfile @AgileJebrim @bendzzArt @plasticdemo

You could do screwy things like alias to int and zero the LSB bit periodically to force some amount of float sanity in the compiler (because the AND cannot be moved relative to neighboring ops).

0 items under this folder.