Metro Cityscape
Project Image

Realtime mobile city-building game

Development Time: 2022-Current

Metro Cityscape is a comprehensive suite of systems built for a server-authoritative city-building game, including .NET server clusters, a Unity client, and internal management software. It's currently my best attempt at building a production-ready, enterprise level application. Many systems are built from the ground up for better performance and integration. The game is in its final polishing stage and will soon be available on the iOS and Android platforms.

Rendering

The rendering of a player's world is made possible by a custom rendering system along with a custom Unity SRP batcher compatible shader. The renderer enables the efficient rendering of thousands of objects with animation support. Some speed-wise optimization techniques implemented include draw call batching and GPU instancing. Memory and disk space wise: loading textures as they come into the view frustum of the camera, unloading based on the LRU replacement policy, and downloading textures from a CDN as needed.

.NET Server

The server's main task is responding to players' in-game commands. The command handling system is designed to be as modular as possible without sacrificing speed. In addition to making the code extremely flexible and extensible, the modular design enables the sharing of code between the client and the server, which makes adding new features a breeze. Read more about the design and implementation challenges here.

image
Persistence

A custom database system persists parts of the player's world state, specifically, the player's buildings, which can range up to the tens of thousands, in a compact binary format that resembles a virtual file system, facilitating efficient streaming of the data in addition to fast CRUD operations. Read more about the design decision here.

Editor Tools

A collection of custom Unity editor tools enables convenient game content management directly inside the engine. The collection consists of a physics shape editor for textures, a content management editor, and additional editors for different game-specific assets.

Other Features

Monitoring

  • Structured Logging with Serilog and Seq
  • Prometheus for metrics

Operation/Deployment

  • Deployment pipeline
  • Load balancer