Helbreath Empire

What it is

Helbreath is a 2D isometric online role-playing game from 2000: two rival cities, open-world player versus player, guilds, dungeons, crafting and large-scale events. Its original code was left behind long ago. I took it and, since 2012, have rewritten its client and its server into an engine of my own, and I run it as a live game at helbreath.co.

Today it exists as two editions that share one codebase:

Both games are in English, Spanish and Chinese, ship with an auto-updater (players download, administrators upload new builds and data), and are served by the helbreath.co website and account portal.

Why it matters to me

Technically, this is my most important project. Nothing else I have built covers as much ground: real-time graphics, networking across continents, a game server with a database behind it, security, tools for content and administration, and a testing system, all written and kept alive by me, for real players, over more than a decade. It is where I learned most of what I know about C++, and it is still where I apply it most seriously.

The scale is part of it. The history on record starts in 2017 and holds about 2,500 commits on Empire and 1,200 on Millennium, plus the shared libraries, and the two games together are well over half a million lines of C++. Most of that code is not the code I started with: it has been rewritten, sometimes more than once, as I learned better ways and as C++ itself moved from the old standards to C++23.

The engine

The client I inherited drew with DirectDraw and kept its whole world in a handful of very long functions. I rebuilt it as a complete in-house game engine:

Networking

Helbreath is played from many countries at once, so latency is a first-class problem. The game talks over UDP through my own build of ENet, with reliable channels, memory pools and speed-ups that keep the wire format unchanged; TCP serves the side channels.

Server

The server runs the world: maps of up to 550 by 550 tiles, monsters and their spawns, combat formulas, guilds, parties, quests, crafting, an auction house, banks, events such as Capture the Flag and Deathmatch, achievements and the in-game economy.

Performance

Speed comes before looks in this codebase. Hot pixel loops are written in SSE2 assembly, each with a plain C++ twin that it is checked against; tables are built at compile time; draws are batched; animations, text and sprites are cached; and allocations are kept out of the frame. Map files are read with SIMD on the client and assembly on the server.

Every replacing path is a named switch: on the client, any optimisation can be turned off to run exactly the old code, and the server can run old and new side by side and log any difference. A benchmark compares builds with A/B runs on both renderers, and a colour test proves a change to a blend or a shader draws the same pixels as before.

Tools

Architecture: two games, one codebase

Keeping two games alive by hand would mean fixing every bug twice. Instead, both are built on two libraries I own:

The work of moving the games onto that shared code follows a written plan: Millennium is the reference for behaviour, because real players prove it every day, and Empire is the reference for design. Each topic is analysed on both sides, the better version is moved into a library, and both games call it. Empire therefore opens on code that is already proven live, and what Empire invents reaches Millennium behind a switch, so the live server tests it first.

Timeline

Technologies

Demo Blog

From the blog

8 November 2026

A C++ beautiful syntax evolution with packet serialization

A Helbreath packet that once took three lines per field now takes one line per packet. Here is how I watched C++ get there: from pointer casts and hand-moved cursors to variadic templates, tuples, structured bindings and objects that serialize themselves.