The first multiplayer implementation in Age of New Worlds was not a mistake.
It was a proof of concepts.
I needed to learn where the hard parts really were: command dispatch, reconnects, snapshots, event offsets, fog of war, match lobbies, AI turns, and the strange little edge cases that only appear when a turn-based game is running across two devices instead of one.
That version used a custom Dart server, HTTP routes, WebSockets, JWT handling, PostgreSQL repositories, and a lot of glue code.
It worked well enough to answer the most important question:
Can this game have multiplayer at all?
The answer was yes.
But once the concept was proven, the shape of the problem changed.
Now I do not need “a server that works”. I need a server architecture that is boring in the right places, strict in the important places, and easy to evolve without leaving a trail of networking code across the Flutter app.
That is why I started moving multiplayer to Serverpod.
(more…)