Introduction: The "Headless" Simulation

While the simulation core runs in pure C# (platform-agnostic), we needed a way to visualize and interact with it. This week, we established the Web Architecture that would power the game.

The Tech Stack

  • Server: ASP.NET Core (hosting the Simulation Runtime).
  • Communication: SignalR (WebSockets) for real-time state updates.
  • Client (Prototype): Phaser (JavaScript) for initial 2D visualization.

Why Headless?

By decoupling the simulation logic from the visual rendering, we gain immense flexibility. The simulation runs on the server (or locally in a background thread), and any client—web, mobile, or desktop—can connect to it. This "headless" approach is crucial for our future plans:

  • Cloud Hosting: Run massive simulations on powerful servers.
  • Client Variety: Support both a lightweight web dashboard and a high-fidelity desktop client.

Building the Bridge

We implemented a SignalR Bridge to stream simulation ticks to the client. Instead of sending every single data point every tick (which would be huge), we send deltas or keyframes. The client interpolates between these updates to create smooth movement.

Prototype: The Isometric View

We began experimenting with an Isometric View in Phaser. Seeing the grid-based city come to life—even with simple colored squares—was a huge milestone. It proved that our coordinate system and rendering pipeline could handle the density of an urban simulation.

What's Next?

With the basic loop running, we need to stress-test our economic assumptions. Next week, we introduce the Scenario Lab, a tool for running thousands of simulated days in seconds.