I had postponed integrating distributed actors until the project’s needs were clear, experimenting with network costs and evaluating options. In the end, Orleans stands out for:
- Pure .NET, open source, and modular. We can use its components at will and reconfigure wherever necessary.
 - Built-in clustering with multiple persistence providers already aligned with the project: SQL Server, Azure Table Storage, Redis, in-memory, and file system.
 - Parallel environments and node versioning. It supports development clusters alongside production and versioned nodes, speeding up testing, deployments, and hot maintenance/updates.
 - Automated actor distribution. There’s no need to implement low-level networking or remote execution (RPC); we do, however, need to optimize how we use it to avoid bottlenecks.
 - Load balancing and selective placement. It manages its own load balancing and allows directed placement: we deploy simulable nodes on the least loaded servers and relocate running nodes based on their likelihood of interaction.
 
How does this translate to The Corporate Wars?
- Stellar systems are loaded into latent simulation nodes that maintain LOD 0—the equivalent of a “turn-based board game” aligned with real time. This requires minimal compute and scales massively, so several servers will keep thousands of worlds in this latent state.
 - Players create scenes that demand higher LOD. Another part of the cluster loads and unloads these LOD > 0 levels on demand from the graphics engine, which always runs the maximum level of simulation detail within the level currently loaded.
 
Orleans’ role vs. the simulation engine
In Orleans, actors represent simulable nodes within a hierarchical tree of playable scopes. Each node holds references to the actors relevant to the simulation, but Orleans itself only manages labels and structure; the simulation engine does the actual work.
- Orleans synchronizes, balances load, and groups simulable nodes across the cluster.
 - The simulation loop executes a time-ordered queue of discrete events.
 
Next milestone
Complete a structural tree that keeps all charted space running. The root node (the galaxy) will also include references to uncharted sectors, enabling access to the positions of worlds pending exploration.