The Afterburner Engine: an overview
A look at the Afterburner Engine, the C++ game engine and studio behind Secrets of Wyrdmar, and what it can do so far.
This whole thing started small. Honest. I wanted to build something like the Daggerfall engine, using the tricks games leaned on back in the day: a 3D world full of flat sprites that turn to face you, so the NPCs look 3D right up until you think about it too hard. I built it, and it was cool.
Then I made the mistake of asking a question: how hard could it be to add real 3D models? (Famous last words.) That worked, so naturally I asked another one, and then another. Every answer came with two new questions attached, and somewhere along the way my little side project quietly stopped being little.
The funny part is that none of this was supposed to be an engine. I just wanted to make a fantasy game. But making a game means doing the same tedious things over and over, and I’m a programmer, so instead of doing them I built tools to do them for me. Then, looking at the pile of tools, one more question: could this run other games too?
Somewhere in the middle of all that, I remembered there was supposed to be a game. I threw darts at a board of words and they landed on Secrets of Wyrdmar. As you can tell, I suck at naming things. By then the idea had outgrown “Daggerfall clone” and turned into a fantasy project inspired by Daggerfall, EverQuest and Ultima Online. If you recognise all three, congratulations: we’re both old.
So that’s how we got here. The Afterburner Engine is the C++ engine that powers Secrets of Wyrdmar, and Afterburn Studio is the editor where its world, items, spells, NPCs and quests get made. This post is the grand tour of what’s in it so far.
Engine and game, kept apart
Confession: it wasn’t always like this. For a while the engine and the game were one big tangle, and it was already turning into a nightmare by the time I caught it. Pulling them apart early is one of the best calls I’ve made on this project, if only because future me would have come looking for present me otherwise. These days the code builds as a stack of static libraries, and each one may only use the ones beneath it:
| Library | What’s in it |
|---|---|
afterburner_core |
assets (sprites, 3D models and animations, CPU side only) and the world: maps, streaming, overworld, sea, buildings, dungeons |
afterburner |
the rest of the engine: rendering and audio |
wyrdmar_content |
the game’s data: items, spells, NPCs, quests, dialog |
wyrdmar_sim |
the game’s rules and simulation, with nothing that draws or plays a sound |
wyrdmar_net |
the multiplayer transport |
wyrdmar_game |
the game’s looks: first-person view, UI, in-game editor |
A check script runs in CI and fails the build if the engine ever includes game code, or the content includes the game. Keeping the simulation free of rendering means a dedicated server can link it on its own.
The real goal is simple: when I eventually get distracted by the next shiny idea, the engine should come along for the ride without dragging Wyrdmar behind it. The engine half never includes anything from the game, so reusing it for something else later should be a lot less painful. Hopefully. Ask me again in a year.
Built with
- C++ with CMake and Ninja; Visual Studio on Windows, no Xcode needed for Mac builds.
- SDL3 for windows, input and loading OpenGL at runtime.
- OpenGL 3.3 for rendering.
- ENet for networking, SQLite for saves.
- Dear ImGui (docking branch) for Afterburn Studio.
- GitHub Actions builds Windows, macOS (universal) and Linux on every push.
The world
- One big overworld of continents, oceans, lakes and rivers, streamed in chunks on a background thread as you move.
- Towns, castles and buildings made from house templates, with walls, towers, gatehouses, round rooms and curved or diagonal walls.
- Dungeons built from modules, plus hand-made static dungeons.
- Forests, including the elves’ treetop town.
- Props and furniture with levels of detail.
Rendering
Each loaded chunk is turned into 3D triangles and drawn with OpenGL 3.3. (An early software raycaster has since been removed.)
- Materials with albedo, height, normal and alpha maps, shine, and a PBR material library.
- Culling against the view and the fog, with care not to drop anything that would change the picture (skylines, lit windows at night). In a town it cuts the triangles drawn by 45-75%.
- A sky with two layers of stars, the Milky Way, and a moon that goes through its phases and lights the land to match.
- Time of day, lights and fog.
- Particle effects for spells, fire and weather.
Weather, seasons and the sea
- Weather by region and climate: rain, storms and snow that settles on the ground, roofs and walls after a few cold days.
- Seasons: autumn colours, falling leaves, bare winter branches, pines that stay green.
- Waves and storms at sea.
- Ships built from sections laid end to end (stern, middle, bow), with decks, holds and rooms you can walk, plus airships.
Audio
The engine has its own small audio stack with no sound fonts or extra libraries for music:
- A MIDI player with a built-in synthesiser for background music.
- Music per screen, ambience, and sound effects (decoded from files or synthesised).
Afterburn Studio
This is the pile of tools from the intro, all in one window. Afterburn Studio is docked and tabbed like a desktop editor and styled after Unity’s dark skin, and every tool is a page that keeps what you were doing while you look at another.
The tools come in four groups:
- World: the world editor for the overworld (continents, seas, rivers, props, people and portals), buildings, dungeon modules, hand-made dungeons, traps and textures.
- Assets: character models, 3D sprites, equipment models, a keyframe animation editor, doors, static models, item icons, and the game’s UI skin, windows and font. Even the game’s UI windows are built here rather than in code.
- Data: items, spells, abilities, dialog (a node graph), quests, creatures, encounters, NPCs and particle effects.
- Game: races, classes, skills, stats, factions, levels, camps, death and the rest of the rules that make it Wyrdmar.
The game has editors of its own too: the house editor (F4) and the dungeon workshop (F3) run inside the game itself.
Multiplayer
Multiplayer is still a work in progress, but progress is being made. Slowly, the way all good netcode is made: one desync at a time. You can already spot it peeking out of the title screen, in the Join Game and Host Game buttons.
The plan is an authoritative server: it owns the truth, and each client predicts its own movement and quietly corrects itself when the server disagrees. A lot of the groundwork is already in:
- The simulation is its own library, with nothing that draws, plays a sound or opens a window, so a headless server can run it alone.
- Connections run over ENet, with a handshake that checks the protocol and game versions, a hash of the game’s content, the server password and the player’s key.
- LAN discovery, so games on your network show up without typing in an address.
- A network-conditions simulator (
--net-lag,--net-jitter,--net-loss), so I can find out how badly things break on a terrible connection without needing a terrible connection.
Tools for testing
- An admin console in debug builds for jumping around, spawning items, setting weather and seasons.
- A test mode that runs scripted keys and takes screenshots, used for checking changes and render timings.
--render-statsfor frame times, GPU time and triangle counts.
What’s next
More questions, probably. My desk is covered in post-it notes with ideas on them: finishing multiplayer, pets, dungeon instances, moving platforms, and a level of detail for the ground so distant hills stop eating the frame budget. And, someday, an actual release.
If you want to follow along, wyrdmar.com is where Secrets of Wyrdmar lives, with news from the workshop as things land.