Age of New Worlds is an open-source, hex-based 4X strategy game built with Flutter, Flame, Dart, and Serverpod.

You can explore the full system in the interactive Architecture Atlas

As the project gained AI opponents, save/load, replay, simultaneous turns, and online multiplayer, the main architectural problem was no longer where to place another class. It was deciding which part of the system actually owns the rules.

Local play, simulations, and the server already shared parts of the same logic, but separate orchestration paths and state representations still made semantic drift possible. A move could eventually behave differently locally and online. A replay could resolve a turn differently from the server. The client could try to reconstruct an animation from state that never contained the complete authoritative path.

The current refactor is built around one constraint: