Plain definitions of the terms this book teaches, from the 4-5 rule to wrapping. The chapter in parentheses is where each one is taught, and where there are two, the term is met in the first and taught in full in the second. A term in bold inside a definition is defined here too.
4-5 rule (Ch18) — The rule that grows the game's caves: a cell becomes wall if five or more of the nine cells in the 3 x 3 block around it, itself included, are walls, and floor if four or fewer are. A few passes of it over random walls make open caverns.
A* (Ch23) — A search for the shortest way from one cell to another. It's Dijkstra's algorithm with a sense of direction. It always looks next at the cell whose steps so far, plus its heuristic, a guess at the steps still to go, add up to the least. So it heads for the goal, and usually looks at fewer cells on the way. Travel uses it.
Abstract class (Ch8) — A class with at least one pure virtual function, which can't be made as an object of its own. The game's View is one: only the classes derived from it, the glyph view and the tile view, can be made.
Admissible (Ch23) — Said of a heuristic that's never more than the real cost still to come. With one, A* always finds a shortest path.
Alpha (Ch6, 24) — The fourth number of a color: how solid it is, from 0 for not at all to 255 for completely. With a blend mode that blends, a color with less than 255 lets what's beneath it show through.
Atlas (Ch8) — One picture that holds every tile, with a small text file, its index, that says where each one is.
Audio device (Ch25) — What SDL plays sound through: the speakers or the headphones the player is using. It's fed by audio streams.
Audio stream (Ch25) — A queue of samples, bound to an audio device, which plays them in turn. The sound bank keeps several, so several sounds can play at once.
Auto-explore (Ch23) — A command, on the o key, that walks the player toward the nearest cell they haven't seen. It goes downhill on a Dijkstra map whose goals are the edge of what they know, until there's nothing left to explore, or something new appears.
Band (Ch15) — A range of floors that a group of monster kinds belongs to, such as the deep band, on floors 7 to 9. The bands overlap, so the monsters change gradually from floor to floor.
Base case (Ch2) — Where a recursive function stops calling itself. In binary space partitioning, it's a piece that won't be cut any more.
Base class (Ch6) — The class that another is derived from, as Entity is for the player and the monsters. The derived class inherits everything the base class has.
Binary space partitioning (Ch2) — BSP for short: a way of carving a dungeon by cutting the map in two, then each piece in two, and so on, until the pieces are small. Then a room goes in each piece, and corridors join them.
Blend mode (Ch6) — How SDL combines what it draws with what's already there. Normally the new color replaces the old, and with SDL_BLENDMODE_BLEND, the two are mixed by the new color's alpha, which is how the death screen fades the dungeon behind it.
Border (Ch8) — A frame, one pixel wide, around each tile in the atlas, copied from the tile's own edge. It's the standard cure for seams.
Bot (Ch27) — A program that plays a game. The game's bot plays from the inside, through the same functions the keys call, with no window. It takes about a second a run, and reports on hundreds of runs at a time.
Bresenham's line (Ch21) — A way of drawing a straight line across a grid with whole numbers only, choosing at each step the cell the true line passes closest to. Every line of fire is one.
Cache (Ch1) — A store of things that are slow to make, but needed again and again, so they're made once and kept, as the glyph cache keeps its characters.
Camera (Ch8) — Which part of the map is on the screen. It follows the player as they move, and each view has its own, since their cells are different sizes.
Capture (Ch10) — What a lambda may use from the code around it, listed in its square brackets.
Cellular automaton (Ch18) — A grid of cells and a rule that every cell follows at once, looking only at the cells around it. The game grows its caves with one, and the 4-5 rule.
Channel (Ch25) — One of a sound's tracks of samples: one for a single speaker, two for stereo. Most of the game's sounds have one.
Character class (Ch22) — The kind of hero a run is played as: the Fighter, the Rogue or the Mage. Each has its own health, strength, defense, kit and gifts, all read from classes.txt.
Color modulation (Ch1) — Multiplying every pixel of a texture by a color as it's drawn. The glyph cache keeps each character in white, and draws it in any color this way: white times gold is gold.
Command (Ch23) — Something the game does for the player over many turns, such as resting, travel and auto-explore. Each step is an ordinary turn, and the command stops when it's done, when anything new appears, or when a key is pressed.
constexpr (Ch1) — Said of a constant whose value the compiler knows while it's building the program. It can never change, and it can go anywhere that C++ needs a fixed number, such as the size of an array.
Debug and Release (Ch27) — Visual Studio's two standard ways to build a program. A Debug build leaves the code as written, so the debugger can follow it, and checks a great deal as it runs. The Release build optimizes the code, and runs many times faster, which is why the bot runs in Release.
Debugging aid (Ch4) — A key for the person writing the game, rather than the person playing it, such as F1, which shows the whole floor.
Default argument (Ch7) — A value given to a parameter in a function's declaration, which a call can leave out.
Depth and column (Ch4) — How symmetric shadowcasting names a cell in one of its quarters: its depth is the number of rows out from the player, and its column is how far it is to one side or the other of the quarter's middle line.
Derived class (Ch6) — A class made from a base class, with everything the base has, and more of its own. The game's Player is derived from Entity.
Derived stat (Ch13) — A value worked out from others whenever it's needed, such as the player's damage from the weapon in hand, rather than stored, so it can't fall out of step with them.
Dijkstra map (Ch10) — A grid that holds every cell's distance from the nearest of some goal cells, by the way there, around walls, rather than as the crow flies. Walking downhill on it leads to the nearest goal. Monsters chase the player with one, and it's named after Edsger Dijkstra, whose algorithm fills it in.
Dirty flag (Ch1) — A flag set when something needs doing, and cleared once it's done. The game's loop draws the window only when it's dirty.
Distribution (Ch2) — The half of C++'s random numbers that turns an engine's numbers into the range a game wants, such as 1 to 6. Each standard library does it its own way, so a seed can give a different dungeon with a different compiler.
DLL (Ch1) — A library of code that Windows loads when a program starts, such as SDL3.dll. It goes beside the program, or in the folder the program is started in.
Effect (Ch24) — Something a turn shows once it has been worked out: a flash on a cell, a missile flying, a ghost, or the screen shaking. Effects play one after another, in the order the turn happened, and a key or a click ends them.
Engine (Ch2) — The half of C++'s random numbers that works out a long sequence of numbers from a seed, the same sequence every time. The game's is std::mt19937.
Entity (Ch6) — Anything in the world that acts, or can be acted on. In the game, Entity is what the player and the monsters share: a place on the map, health, defense, and statuses.
enum class (Ch2) — A type with a fixed set of named values, such as Terrain::Floor and Terrain::Wall, whose names can't clash with any others, and which can't be mixed up with a number by accident.
Event (Ch1, 25) — Something that happens, which a program responds to. To SDL, a key press, a mouse movement or the window closing is an event, which the game's loop waits for. For the sound bank, each thing in the game that makes a sound, such as a hit or a door opening, is an event.
Field of view (Ch4) — The cells the player can see from where they stand, worked out by symmetric shadowcasting, up to nine cells away.
Fisher-Yates shuffle (Ch12) — The shuffle a careful card player does: from the last place down to the second, swap each with a place chosen at random at or before it, itself included. Every order comes out exactly as likely as every other.
Flee map (Ch10) — A Dijkstra map for running away. Walking downhill on it leads to the places farthest from the player that can be reached, around the player, if that's the way to somewhere far.
Fog of war (Ch4) — The parts of the map the player can't see right now. Cells they've seen before are drawn as they remember them, dimmer and cooler, and cells they've never seen aren't drawn at all.
Forward declaration (Ch4) — A line such as class Map;, which tells the compiler that a class exists, without saying anything else about it.
Frequency (Ch15) — How common a kind of item or monster is, as a number that only means something against the others': a kind with a frequency of 10 turns up twice as often as one with 5.
Friend (Ch27) — A class that another class names with friend class, and which may then use that class's private members as freely as the class itself can. The bot is the Game's friend.
Gain (Ch25) — A number that scales every sample an audio device plays: at 1, a sound plays as loud as it was made, at 0.5 its samples are half as big, and at 0 there's silence. The game's volume sets it.
Ghost (Ch24) — A monster already killed, drawn on its cell until the effects before its death have played, so that it doesn't vanish before the blow that kills it lands.
Gift (Ch22) — Something one character class does better than the others: the Rogue is keen-eyed and stealthy, and the Mage has scroll power, scroll lore, and lightning by heart.
Glyph (Ch1) — One character's drawing, from a font. The glyph view draws every wall, monster and item as a glyph.
Glyph cache (Ch1) — The game's cache of characters: each glyph made into a texture once, in white, and drawn in any color with color modulation.
Greedy (Ch5) — Said of a step, or an algorithm, that takes whatever looks best right now, without planning ahead.
Heuristic (Ch23) — A guess. In A*, it's the guess at the cost from a cell to the goal, and it must be admissible. The game's counts a step for each cell of the longer distance, and a hundredth for each diagonal step among them.
High scores (Ch26) — The ten best runs, kept in scores.txt. A run's score is its gold, 50 for each floor, 500 for each Amulet, and 2,000 more for a win.
Identification (Ch12) — The genre's guessing game. A potion or a scroll is known only by its look, a color or a made-up title, until it's used or identified, and every run gives out the looks afresh.
Inherit (Ch6) — To have everything another class has, by being derived from it, as Player inherits from Entity.
Interface (Ch8) — A class that says what something must be able to do, without saying how, as View does for the views.
Juice (Ch24) — The small, quick effects that make an action feel like it happened: a flash on the cell that was struck, an arrow flying across the room, the screen jolting at a big hit.
Keycode (Ch3) — What a key types, which depends on the keyboard's layout. The game matches its letters by keycode, and its arrows by scancode.
Kit (Ch22) — What a character class starts a run with, listed in classes.txt: its first weapon is wielded, its first armor worn, and the rest goes in the pack.
Lambda (Ch6) — A small function, written right where it's used, with no name. Its square brackets list its captures.
Letterbox (Ch1) — Black strips added beside a picture, or above and below it, so that it keeps its shape in a window of another shape. The game draws one picture, 1,600 by 900, and SDL scales it to fit the window, letterboxed.
Line of fire (Ch21) — The cells an attack from afar passes through, from the attacker toward its target, stopped by the first wall or closed door. Lightning strikes everything on it, and an arrow, a dart or a fireball stops at the first creature.
Look cursor and look panel (Ch9) — The look panel, at the foot of the side panel, says what's on the cell under the mouse: the creature, how hurt it looks, and the ground, as far as the player knows. The look cursor, on the x key, does the same from the keyboard.
Member initializer list (Ch7) — The part of a constructor after the colon, which gives the members their first values as the object is made, in the order the members are declared.
Message log (Ch3) — The lines at the foot of the screen that say what's happened, newest last. A message that repeats is counted, rather than copied.
Monospaced (Ch1) — Said of a font whose characters are all exactly as wide as each other, as on a typewriter, which is just what a grid of cells needs.
Monster states (Ch11) — What a monster is doing: asleep, until something wakes it; wandering, to places it chooses at random; hunting, after the player, or where it last saw them; or fleeing, when it's badly wounded, or afraid.
Morgue file (Ch26) — The story of a run, written as a text file when the run ends, won or lost: who played and how it ended, the score and the seed, the pack by true names, the kills, the last messages, and the floor as it was seen.
Noise (Ch11) — A sound in the game, with a loudness in cells. It carries that far in walking distance, around walls, and what's left of it when it reaches a sleeping monster may wake it.
Open set (Ch23) — In A*, the cells that have been reached but not yet handed back, waiting in its queue. The code calls it open.
Pack (Ch15) — A group of monsters of one kind, placed together, as some kinds come.
Path (Ch23) — A way from one cell to another, a step at a time. A* finds the shortest one the player knows, for travel.
Permadeath (Ch6) — The rule that a death is final: the run is over, and no save brings it back. It's the rule most players name first, when asked what makes a roguelike.
Pitch (Ch25) — How many times a second a sound swings back and forth: the more, the higher the note.
Polymorphism (Ch8) — One call doing different things for different objects. When the game calls a virtual function through a pointer to a View, what runs depends on which view it really points at.
Priority queue (Ch10) — A container that hands back its elements in order, whatever order they went in. The standard library's std::priority_queue hands back its biggest first, unless it's told otherwise. Dijkstra's algorithm keeps the cells waiting to be worked on in one, smallest first.
Private (Ch7) — Said of the members of a class that only the class itself can use. The rest are its public members.
Protected (Ch8) — Said of a member that's private to the world, but which the classes derived from its class can use.
Pure virtual (Ch8) — Said of a virtual function declared with = 0: the class says the function exists, but doesn't write it, so it's an abstract class. A class derived from it can be made only if it writes the function.
Quarters (Ch4) — The four parts of the area around the player: north, east, south and west. Symmetric shadowcasting works through them one at a time, a row at a time.
RAII (Ch1) — Short for "resource acquisition is initialization": a class gets a resource in its constructor, and gives it back in its destructor, so it's given back however the object goes away. The glyph cache does it with its textures.
Record (Ch16) — One entry in a data file: its type in square brackets, on a line of its own, then its keys, each with a value after an equals sign. The save, the settings and the high scores are made of records too.
Recursive (Ch2) — Said of a function that calls itself, which is the natural way to handle anything made of smaller copies of itself, as a piece of a binary space partitioning is made of two smaller pieces.
Reference (Ch7) — Another name for an object that already exists, rather than a copy of it. The Game's glyphs_ is a reference to main's glyph cache.
Reverse iterator (Ch27) — An iterator that runs from a container's end to its beginning, from rbegin to rend. Sorting with them sorts from the back, so the biggest values come first.
Roguelike (Ch1) — A game in the tradition of Rogue, from 1980: turn-based, on a grid, with a dungeon made fresh for every run, and permadeath. A traditional roguelike draws its world in characters, though many, as this one does, offer tiles too.
Sample (Ch25) — One number in a sound, saying where the speaker should be at one moment. The game's sounds have 48,000 of them a second.
Save version (Ch17) — The number at the start of a save, which the game checks before reading the rest. It goes up whenever the save gains something, so a save from another version of the game is turned away, with a reason, rather than misread.
Scancode (Ch3) — Where a key is on the keyboard, whatever is printed on it. The game matches its arrows and keypad by scancode, and its letters by keycode.
SDL (Ch1) — A library for games. It opens the window, reads the keyboard and the mouse, draws, and plays sound, the same way on Windows, on a Mac and on Linux. SDL3_ttf, its companion, draws text from fonts.
Seams (Ch8) — Thin lines between tiles that should join seamlessly, a bug as old as tile games. The cure is each tile's border.
Secret door (Ch19) — A door that looks like wall until the player searches beside it, with the s key, and finds it. The Rogue finds them just by walking past, now and then.
Seed (Ch2) — The number a random number engine starts from, and works all its numbers out from. The same seed always makes the same dungeon, so a seed in Command Arguments replays it.
Sine wave (Ch25) — The purest note: a speaker swinging smoothly back and forth, a set number of times a second, its pitch. The game plays a short one in place of a sound that can't be loaded.
Slope (Ch4) — How many columns a line moves across for each row it moves out. Symmetric shadowcasting tracks the edges of the light by their slopes.
Sound bank (Ch25) — The class that loads the game's sounds, holds them, and plays them, choosing at random among each event's variants.
State and state machine (Ch7) — A state is a value that says what the game is doing right now, such as playing, or showing the death screen. A state machine is code that does different things in each state, and moves from one to another when something happens.
static (Ch27) — Said of a member function that belongs to the class, rather than to any one object. It's called with the class's name, as Game::printHitsToKill(data), and it can't use the members of an object, since there isn't one.
static_assert (Ch25) — A check that the compiler makes as it builds the program, which stops the build with a message if it fails.
Status (Ch14) — Something that lasts a number of turns, and acts each turn: poison, which takes a point of health; regeneration, which gives one back; confusion, which sends steps astray; and fear, which makes monsters run.
std::deque (Ch27) — A double-ended queue: a container that can add and remove at either end, so the oldest can go from the front as each new one goes on the back.
std::optional (Ch9) — A value that may or may not be there, such as the cell under the mouse, which isn't there when the mouse is off the map.
Structured binding (Ch23) — A declaration such as auto [guess, crow, index], which names each part of a value at once.
Stuck (Ch27) — A bot's run still going after 30,000 turns, which has almost certainly gone wrong. The bot prints its last decisions, to show what it was trying.
Surface and texture (Ch1) — Two kinds of picture to SDL. A surface is in the computer's ordinary memory, and a texture is on the graphics card, ready to draw.
Symmetric shadowcasting (Ch4) — How the game works out the field of view. It goes through the area around the player in four quarters, a row at a time, tracking the edges of the light by their slopes. It's symmetric: if one floor cell can see another, the second can see the first.
Tile (Ch8) — A small picture that draws one cell, as a glyph does in the glyph view. The game's tiles are 32 pixels square, packed in an atlas.
Trait (Ch11) — A yes or a no for each kind of monster, such as whether it opens doors, or never flees. A kind can have several, kept as the bits of one number.
Trap (Ch19) — Something hidden in the floor, waiting for a step: darts, a poison needle, an alarm, a teleport trap, or a trapdoor to the floor below. Once a trap is known, the game asks before the player steps onto it.
Travel (Ch23) — A command that walks the player to a cell they click, or to the stairs. It takes the shortest way they know, found by A*, and stops for anything new.
Turn (Ch6) — One round of the game: the player acts, then every monster does. Nothing moves between turns, so the player can take as long as they like over each one.
Type object (Ch5) — A pattern that keeps what every monster of a kind shares in one object, which each monster points to, rather than in a class for each kind. That's such things as its name, its glyph and its health.
Undefined behavior (Ch27) — What a program does when it breaks one of C++'s rules that the compiler can't check, such as reading through a pointer to an object that's gone. It might carry on, read nonsense, or crash.
Unnamed namespace (Ch1) — A namespace with no name, whose contents can be used anywhere in their own file, but can't be seen from any other.
Vault (Ch20) — A room drawn by hand, as text in a data file. It's built into a floor as the floor is made, walls, door and all, with its treasure, its traps and its guards. Each Amulet lies in one.
View (Ch8) — How the map looks: the glyph view draws each cell as a character, and the tile view as a picture. Both are derived from the interface View, and F2 switches between them.
Virtual (Ch8) — Said of a member function whose call is decided as the program runs, by what an object really is, rather than by the type of the pointer it's called through. It's what makes polymorphism work.
Working directory (Ch1) — The folder a program treats as "here," which paths such as assets/RobotoMono-Light.ttf are measured from. Visual Studio starts the game in its project folder.
Wrapping (Ch9) — Breaking text into lines at the spaces between words, so that each line fits the width it's drawn in.
A term that isn't here is explained in place, where the book first uses it.
