nanoMMO

nanoMMO

A software engineering perspective

In this series, we're going to build an MMORPG from scratch, both the client and the server. The focus is on the engineering around the game: Docker, CI, benchmarking, Prometheus and Grafana, MySQL, Redis, and profiling.

nanoMMO is the working title. It takes after nanochat, a repository by Andrej Karpathy, with code that's kept minimal and easy to hack on. That's what I'm going for here as well: a codebase that covers an MMO from one end to the other, which you can read, run yourself, and play with.

The episodes are on YouTube. The game's code is on GitHub, tagged at each step of each episode, so you can follow along. Its API docs are here.

Episodes

  1. nanoMMO - A software engineering perspective

    Where the series is going, and a C++ project that is built, tested and documented on each push.

    48 min · 14 October 2026

  2. C++ game client with raylib, ImGui and shaders

    The client's first window, drawn with raylib, with Dear ImGui on top, tests that run in Docker without a screen or a GPU, and a cube that the keyboard moves.

    67 min · 14 October 2026

  3. Multiplayer with protobuf and Asio

    A C++ server keeps several clients in sync, over TCP, with a protobuf contract between them.

    69 min · 14 October 2026

  4. Prometheus and Grafana for a C++ game server

    Our server reports metrics, Prometheus collects them, Grafana draws them, Docker Compose starts it all, and three hundred bots give it something to show.

    50 min · 15 October 2026

  5. C++ game accounts with MySQL and Argon2id

    Players get accounts, kept in MySQL through its C API, with their passwords hashed with Argon2id.

    47 min · 15 October 2026

  6. C++ login server with Redis tokens

    A login server checks passwords away from the game server's tick, and hands each login over through Redis as a one-time token.

    69 min · 15 October 2026

  7. Mixamo animations in raylib with glTF and C++

    Mixamo characters converted to glTF, merged into files raylib can load, synced through the server and skinned on the GPU.

    52 min · 15 October 2026

  8. Profiling a C++ game server with perf and Tracy

    We step the bots up until the server falls behind, find out where its time goes with perf, flame graphs and Tracy, fix the broadcast, and measure it again.

    42 min · 15 October 2026

  9. TCP vs UDP for a game server, under packet loss

    We make the network drop packets, measure how old the world on a player's screen gets over TCP and then over UDP, and let the numbers decide.

    52 min · 15 October 2026

  10. C++ MMO monsters: AI, health and levels

    A public-domain skeleton, monsters with an AI on the server, and health, levels and experience for everyone.

    49 min · 15 October 2026

  11. C++ MMO combat: swords, hits and respawns

    A public-domain sword in each hand, swings the server decides, and monsters that fight back, with a death animation for both.

    33 min · 18 October 2026

  12. Laravel game website in Docker: login, rankings

    A Laravel website next to the game, in Docker, with rankings, and accounts that log into the game, on the game's own MySQL tables, with no CSS of our own.

    47 min · 18 October 2026

  13. Redis write-behind for a C++ game server

    Saving each change to MySQL slows our server down with a few dozen players, so we put Redis in between, with a pipeline, an append-only file and a saver that writes to MySQL in batches.

    41 min · 18 October 2026

  14. TLS for a C++ game server with OpenSSL and Asio

    Our client sends the password, and gets its token back, as plain bytes, so we put TLS 1.3 on all our TCP connections, with OpenSSL, Asio and a certificate authority of our own.

    45 min · 18 October 2026

  15. Procedural terrain in C++ with noise and raylib

    Our board of tiles becomes an island 512 metres across, from noise and a seed that the server and the client share, with a camera that follows you.

    52 min · 18 October 2026

  16. Trees and frustum culling in C++ with raylib

    Trees grow on the island where the seed says, the server makes their trunks solid, and chunks with culling make the client a lot faster.

    32 min · 18 October 2026

  17. Game character screen in C++ with raylib, ImGui

    A character screen with our player's details next to an idle 3D preview, which a camera of its own draws into a render texture for Dear ImGui to show.

    17 min · 18 October 2026

  18. MySQL schema migrations with Flyway in Docker

    Flyway keeps our MySQL tables in versions, so a change to them keeps the players' accounts, starting with saving their health.

    19 min · 18 October 2026

  19. Deploy a C++ game server to a VPS with Docker

    Our game goes onto a VPS, deployed over SSH with Docker Compose, with the database kept private and certificates for the server's address.

    20 min · 18 October 2026

  20. MMO interest management: send each player less

    Each player gets the players near them, in cells of the island, and names and levels once a second, measured change by change, on my machine and on the VPS.

    33 min · 18 October 2026

  21. MMO server discovery with Consul and Docker

    Each game server is a world that registers with Consul, the client lists the worlds through the login server, and each world keeps its own players.

    49 min · 18 October 2026

  22. MMO zones and portals in C++ with raylib

    Each world gets a second land, the Ashlands, with a gate from the Meadows, and each land a look of its own, as data.

    45 min · 18 October 2026

  23. MMO chat in C++: TCP, ImGui and rate limits

    Players talk to everyone in their world, over TCP, with each line cleaned on the server and a token bucket against floods.

    28 min · 18 October 2026

  24. MMO NPCs in C++: data-driven, low bandwidth

    Our first NPCs, as tables of kinds and spawns, sent once a second and drawn as coloured balls until they have models.

    30 min · 18 October 2026

  25. MMO NPC with an LLM in C++: threads, batching

    A storyteller NPC writes players a story from a few words, with a small language model served next to the game, asked from threads off the tick.

    44 min · 18 October 2026

  26. MMO items in C++ with protobuf text format

    Our sword moves out of code into one items file, in protobuf's text format, which both the server and the client read, each taking the part it needs.

    31 min · 18 October 2026

  27. Data-driven MMO content in C++ with protobuf

    Monsters and NPCs join the items as data both sides read, go out by kind, and a content hash keeps clients and worlds in step.

    50 min · 18 October 2026

  28. C++ sanitizers, fuzzing and coverage in Docker

    Sanitizers under the bots, fuzzing, clang-tidy and a coverage report find what the tests don't, and we fix it.

    38 min · 18 October 2026

  29. Integration testing a C++ game server

    A test starts the world server on port zero and plays it over TLS, UBSan catches the test's own bug, and the coverage report sees the game loop run.

    21 min · 18 October 2026