Comment by BSTRhino

Comment by BSTRhino 21 hours ago

1 reply

It uses rollback netcode. The inputs are relayed to the other players and executed on all clients, and they end up in the same state because all Easel programs are guaranteed deterministic. To hide latency, the clients simulate forward even before they have received all inputs, and once inputs have been received it rolls back to the point of divergence to correct the prediction error. This works because the prediction is correct most of the time.

To be able to roll back, Easel incrementally snapshots the game state every tick. It only snapshots (and restores) what has changed, which makes it a lot more efficient than most rollback netcode implementations.

It also uses a peer-to-peer relay and adapts the latency asymmetrically, so the player who introduces latency feels their own latency.

I know there are other models and pros and cons, this is the right choice for Easel because I wanted to make the multiplayer fully automatic. One shared world, coded like a singleplayer game. There are certainly games which suit a client/server model better but I think the developer would then need to understand where their code is running and when to do remote procedure calls, and my goal was to make multiplayer so easy that even a teenager on their first day of coding could do it.

Rohansi 14 hours ago

That's great stuff! IIRC Factorio takes the same approach but relies on extensive testing to avoid running into desync issues with non-deterministic code. Would be very cool to be able to build games like that without needing to worry about desyncs!

It might be a good idea to highlight some of the limitations to this approach somewhere so users aren't caught off guard later in the development process. For example, it wouldn't be great to build a competitive FPS or MOBA with this because the game state is replicated to all players which is a cheaters dream. The latency characteristics would also not be ideal for games with a larger number of players. I also assume there are no escape hatches for doing any non-deterministic things like I/O so there would be limited to no persistence possible. It won't be an issue for most games but worth highlighting just in case IMO.