I spent a good chunk of last year writing about compass, the map-generation library with all the fluvial generators and cellular caverns. The whole time I was building it as a standalone library, the real motive was to eventually drop it into a game. This month I finally did, and DET-33 now generates every one of its floors through compass.

Pulling the library in

Wiring it up was almost anticlimactic, which is the point of having spent the time on the composition layer. DET-33 pulls compass in as a git dependency and the level code just imports the scanning digger and the template data:

import { scanningDigger, scanningDiggerBasic, environmentsData,
         loadIndexedData } from 'compass';

A Level takes a level number and a seed, picks an environment, and hands a template to the digger. The seeding matters for a roguelike: the environment for floor N is chosen from a hash of the run seed and the floor number, so a given run is reproducible but every run is different.

Floors on a cycle

Levels run on a ten-floor cycle. Each position in the cycle pulls from a pool of compass templates, so floor 1, 11, and 21 share a wilderness flavor (alluvial fans, cliffs, eskers), floor 3 leans into caverns and marshes and fjords, and the deeper positions open up into passages and catacombs. Every tenth floor is a boss floor and swaps the wilderness pools for tighter arena layouts: clustered rooms, organized rooms, city streets. There are also faction-specific pools, so the map itself can start to feel like it belongs to someone.

That’s the part that genuinely surprised me. I’d built compass to make pretty maps, but using it to express pacing (open and natural early, structured and arena-like at a boss) turned a content library into a level-design tool almost by accident.

Bosses to cap the cycle

To give the boss floors a payoff I added the first real bosses this month. The Iron Colossus is a mechanical bruiser that ground-pounds, charges, deflects projectiles, and litters the arena with a damaging debris zone. The Plague Patriarch is its opposite: fast and toxic, throwing poison clouds, spawning infected, and leaving acid pools that tick away at you. Both lean on the same effect and trap systems the skills and bullets use, so an acid pool a boss drops is the same kind of object a player’s acid-pool bullet creates.

It’s a nice feeling watching three systems I built separately (the map library, the data-driven skills, the composable bullets) snap together into something that actually plays like a roguelike. Next year is about turning that into a game people can finish.