Episodes

nanoMMO - A software engineering perspective
Where the series is going, and a C++ project that is built, tested and documented on each push.

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.

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

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.

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

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.