Wages and Mages Devlog 03 — Two Zones, a Mirror World, and 2500 Tests: The World Expands
Devlog 02 ended with a game that had every system wired together and a thousand tests proving it. Since then, the game stopped being a single-location RPG and became something bigger.
Two new explorable zones. A parallel dimension. A world engine that makes adding more zones trivial. A plugin architecture that turned monolithic exploration code into composable modules. Three new quest lines, three new enemy types, a new building that changes the defense meta. And a QA suite that nearly tripled — from 1,000 to 2,950 passing tests with zero failures.
The headline is that Wages and Mages now has a world. Not a level select. Not a hub with doors. A connected, persistent, explorable world where walking north from the overworld takes you through a mountain pass into an ice kingdom, and walking east takes you into a mirror dimension where everything you know is slightly wrong. The systems that make this work are worth explaining.
The World Engine: One File to Run Them All
Before this sprint, every zone was a standalone Lua state file — its own movement code, its own camera logic, its own NPC handling, its own draw loop. The overworld, North Pass, and Ice Kingdom each had 800+ lines of nearly identical infrastructure with different map data bolted on top. Three zones meant three copies of the same engine.
Commit c02744c killed that pattern. A new world.lua (810 lines) became the universal walkable-map engine. It handles movement, camera, NPC patrol, interact dispatch, shop overlays, weather particles, and the full draw framework. North Pass and Ice Kingdom were converted from state files into pure data files under src/data/maps/. The math: -1,646 lines of duplicated state code, +1,627 lines of shared engine plus lean data definitions. Three zones now run on one engine.
Commit e0b1317 took it further. The overworld itself — the original exploration.lua that had been the center of the game — was converted into a map data file. The 800+ line exploration state became a 22-line redirect that loads a data file into the world engine. Every walkable zone in the game now runs through the same code path.
The architectural payoff is immediate: any new map area is a new data file, zero new engine code. A data file defines tile layout, NPC definitions, interactable objects, weather type, ambient sounds, transition edges, and optional features like fog of war or day/night timers. The engine reads the definition and runs the zone. If it works for one map, it works for all of them.
The engine gained data-driven feature flags along the way. Maps can specify explored_tiles = true for fog of war. They can set day_length = 480 with an on_day_end callback for time-sensitive zones. Enemy patrols use waypoint pathfinding with proximity aggro. Resource sparkles and narrator idle quips are opt-in per map. The world engine is not a simplification — it is a unification that kept every feature while eliminating the duplication.
North Pass: The Mountain Corridor
North Pass is the first zone beyond the overworld. It is a narrow snow mountain corridor — terrain gradient from green lowlands to rocky terrain to full snow — with ice wolves and mountain bandits blocking the path. Walk north from the overworld, and you enter a passage that connects the base game to everything beyond it.
The zone started as terrain, enemies, and transitions (commit 95e4458). Then it got depth. NPC Zara Voss and her companion Chairman Fluffington III inhabit the pass. An enterable inn and shop have interiors. A bulletin board carries notices. A campfire provides a rest point. A cave entrance hints at optional content. Three traveler NPCs wander the route with their own dialogue.
Two merchant NPCs joined later: the Frostholm Trading Post (glacial reagent, frost fur, ice-glass, stew) and Valdis the Wandering Arms Dealer (cryo blade, grenades, capacitor, scrap). Both have full W.A.G.E/M.A.G.E narrator dialogue — W.A.G.E files Valdis as an “unlicensed arms distributor operating outside established procurement channels,” while M.A.G.E notes that “the weapons she sells remember the forges that made them.”
The visual polish pass added pulsing edge hints with tile-count overlays near transitions, [E] Name — Description interaction panels for all interactables, enemy encounter notifications before combat, aurora borealis in three colors (green, teal, light-purple) at staggered speeds, wall crack lines for rock-face depth, and a “GLACIAL WINDS” weather indicator that blinks through sine-wave alpha. Snow particles render in screen space after camera release — a small fix that matters because parallax snow that moves with the camera looks wrong and breaks the sense of place.
North Pass exists to do two things mechanically: gate access to the Ice Kingdom behind a traversal challenge, and introduce the resource economy of the northern regions. The merchants sell items that do not exist in the base game’s crafting tree. Glacial reagent and frost fur are inputs for recipes that only make sense when you are fighting ice-element enemies — which you will be, shortly.
Ice Kingdom: The Civilization on the Other Side
Walk through North Pass and you reach a full snow civilization. An 80×80 map with an ice castle at its center, four enterable buildings (Tavern, Forge, Barracks, Market), ten patrol NPCs with distinct sprites, eight citizen waypoints, and fifteen ice formations. Aurora borealis overhead. A king, a queen, a captain, an elder, a stormsmith, a merchant, and Inga — who has a wedding ring quest that threads through the dungeon system.
The Ice Kingdom introduces the Glacial Lance, the most powerful exploration weapon in the game. Acquired through the Ice Mech trade in the castle (50 copper + 30 crystals for the upgrade), it fires an AOE instakill in a six-tile radius at the cost of 40% shields. The visual: a full-screen ice-blue flash with sparkle burst VFX. Every boss and mini-boss in the game carries an immune_to_instakill flag — the Lance is a trash-clearing superweapon, not a boss skip. It changes how you move through zones without trivializing the fights that matter.
The ice_castle shop carries four unique items. The Ice Mech trade shows a requirements panel with copper, crystal, and mech status. If the generator is down (_mech_generator_down flag), a guard blocks the trade — you cannot upgrade hardware that is not running. The wedding ring quest hooks into the dungeon treasure system: a 35% chance per chest on floor 2+ when the quest is active. The ring is not a guaranteed drop. You might need to run the dungeon twice. That is deliberate — it keeps the dungeon relevant after the first clear.
Three unique encounter types were added for the zone. Frost Berserkers apply frozen_gears — a status effect that locks mech abilities for a turn. Glacial Crevasses are terrain hazards with geyser timers and five spawn positions that force movement decisions. Blizzard Events are roving storms that cut visibility to 25% and buff enemy attack — you fight blind and the enemies hit harder. Each encounter carries a W.A.G.E corporate observation and a M.A.G.E arcane commentary.
The Ice Kingdom is not a palette swap. It has its own economy, its own quest hooks, its own combat dynamics, and its own narrative layer. It is the proof that the world engine works — a zone this complex runs on the same engine as the overworld, differentiated entirely through its data file.
Mirror World: Through the East Edge
Walk east past the edge of the overworld map and the sky turns purple.
The Mirror World is a 60×60 parallel dimension that uses the same procedural noise terrain as the exploration map but with an inverted purple-and-amber palette. It is the same world, rendered wrong. Echo NPCs deliver cryptic lore. A mirror shrine grants crystal and fuel. The west exit returns you to the overworld at the east entry point — world continuity is maintained between dimensions.
Five visual diffs define the Mirror World as distinct from reality: inverted palette, purple sky, mirrored settlement layout, mirror AI NPC names, and unique loot crystals. These are declared as a visual_diffs table in the data file, not hard-coded in the engine. The world engine reads the diffs and applies them. If you wanted a third parallel dimension with different visual rules, you would write a new table.
The Mirror World is narratively loaded but mechanically light — for now. It is a zone that exists, that is explorable, that has its own lore, and that the save system tracks independently. The portal is one-way in and one-way out with position tracking on both sides. The engine handles the dimension swap as a map transition, the same code path that moves you from the overworld to North Pass.
The design intent is obvious to anyone who has played a Zelda game or Silksong. A parallel world is a multiplier on existing content. Every zone you build in the real world is a zone you can mirror, twist, and repopulate in the other dimension. The infrastructure is in place. The content multiplication comes later.
The Plugin System: Modular Exploration
Commit bc011e4 introduced a plugin architecture that restructured how exploration features are built. Before this commit, the Nikki companion system, the UFO encounter, the alien crash site, and the Men in Black scene were all embedded in the exploration state file. After it, each one is a standalone module in src/plugins/.
The system has five lifecycle hooks: init, update, draw_world, draw_hud, and keypressed. A plugin loader discovers and initializes plugins via pcall-based require. Maps specify which plugins they want — plugins = {"companions.nikki", "encounters.ufo"} — and the engine loads only those. The always_active flag lets a plugin run even when the player is not in mech mode.
Four plugins were extracted from the monolith:
companions/nikki.lua(273 lines): Nikki’s follow logic, quip system, speech bubbles. She has 20 banter dialogue scenes across 8 categories, each contextual to what is happening in the zone.encounters/ufo.lua(433 lines): UFO spawn, flight path, beam effect, destruction sequence.scenes/alien_crash.lua(172 lines): reusable crash site scene with burn-to-alien phase transition.scenes/men_in_black.lua(300 lines): reusable MIB scene — military arrival, neuralyzer flash, shrug, cleanup — importable by any encounter plugin.
The extension model is the payoff. A new companion is a new file in src/plugins/companions/. A new encounter is a file in src/plugins/encounters/. A new scene is a file in src/plugins/scenes/. Each plugin is self-contained: its own state, its own draw calls, its own input handling. The engine does not know what a companion is. It knows what a plugin is. The companion is the plugin’s problem.
This is the pattern that makes a 10-zone game feasible. Without the plugin system, every new zone feature means touching the engine. With it, the engine is stable and features are additive. The difference between those two development models is the difference between linear and logarithmic complexity growth.
Three Quest Lines, Three Enemy Types, One Building
Commit bd92ec7 added 827 lines of content in a single shot.
Three new side quests span day and night gameplay:
- The Brass Conspiracy (Phase 2): a corporate espionage arc that adds a burrower night to the defense schedule. W.A.G.E classifies it as “an internal audit with kinetic implications.” M.A.G.E warns that “the brass hides what the earth remembers.”
- The Lost Apprentice (Phase 1): an arcane rescue mission that triggers steam specter fluctuations during night defense. Finding the apprentice means surviving what their disappearance unleashed.
- The Factory Siege (Phase 2): a three-wave siege event with iron brutes, specters, and swarms hitting simultaneously. This is not a side quest that happens during the night — it is a side quest that is a night.
All three quests carry full narrator voice lines from both W.A.G.E and M.A.G.E.
Three new night defense enemy types expand the steampunk bestiary:
- Iron Brute: 200 HP, speed 1, ignores barricades, punches through walls. It does not path around your defenses. It paths through them. Turret placement against brutes is about kill speed, not routing.
- Steam Specter: speed 9, bypasses the first turret row, translucent visual. The fastest enemy in the game that also ignores your front line. You need depth in your defense, not just width.
- Clockwork Swarm: splits on death into two smaller swarms. Killing one creates two problems. Area damage matters more than single-target when swarms are in play.
The enemies wire into the wave schedule at nights 24, 26, and 38 with their own base counts and composition rules.
The Aether Conduit is a new five-tier building that generates passive mana and resources each turn. Its tier progression is designed to reshape the defense meta: tier 1 is a trickle, tier 3 enables tier-3 turrets and an AOE slow aura, tier 4 provides mana surges, tier 5 passively buffs all towers in range. The visual is steampunk-appropriate — copper coils with a glowing core that shifts from amber to cyan as tier increases, drawn with Love2D primitives.
The Aether Conduit is the first defense building that does not directly fight. It amplifies everything around it. Building it early means a slower start but a stronger endgame. Building it late means you survived the early nights on raw turret power but the conduit never reaches its peak tiers. The economic tension is familiar: every copper spent on the conduit is a copper not spent on a turret that shoots right now.
From 1,000 to 2,950 Tests: Complexity Under Control
The QA suite grew in stages, each tied to a specific content expansion:
| Sprint | Test Count | What It Proved |
|---|---|---|
| Post-devlog 02 | 1,000+ | All base systems integrated |
| Quest + enemy + conduit | 1,401 | New content does not break existing systems |
| Companion + narrator expansion | 1,500 | Dialogue and scene systems are stable |
| Ice Kingdom + North Pass + defense | 1,901 | Multi-zone play is save-safe |
| World engine + mirror world + plugins | 2,175 | Architectural refactor preserved behavior |
| Final deep validation | 2,950 | Cross-zone saves, narrator coherence, plugin gameplay |
The final suite runs 2,950 tests across 86 screenshots in 343 seconds with zero failures. That number is not an accident and it is not padding.
The world engine refactor was the most dangerous change in this sprint. It replaced the infrastructure under three zones simultaneously. The tests written before the refactor — movement tests, NPC interaction tests, save/load integrity tests — ran against the new engine without modification. They passed. That is what a test suite is for: it tells you whether a structural change preserved the contract. The 2,175 tests at commit 771e253 covered the world engine in 13 test blocks, the mirror world in 10, the plugin system in 9, and Ice Kingdom depth in 11. Each block validated that the refactored code did what the original code did.
The deep validation pass at 2,950 added three intensive test categories: DVIK (deep validation Ice Kingdom), DVNP (deep validation North Pass), and DVMW (deep validation Mirror World). These tests do not check that zones load. They check that a three-day/night cycle in the Ice Kingdom with a detour through the Mirror World and a return through North Pass produces a save file that loads correctly with all quest states, inventory, NPC memory, and zone-specific flags intact. Seven test failures were caught and fixed during this pass — real bugs in cross-zone state persistence that would have been invisible without systematic multi-zone traversal testing.
The QA suite also runs a day/night three-cycle simulation, narrator voice coherence checks (every narrator line in every context actually fires and does not crash), and plugin gameplay tests that verify the companion and encounter systems function identically whether loaded as plugins or as the old monolithic code.
2,950 tests means the game can be changed with confidence. Every commit runs the suite. Every failure points to a specific system, a specific interaction, a specific contract violation. The world engine refactor touched every zone in the game. It passed on the first full suite run after seven targeted fixes. That is not luck. That is what happens when you write the tests before you need them.
A Win Screen, Because the Game Has an End
One more thing shipped this sprint: a win screen.
Commit c73b5c8 added the dual-narrator epilogue. W.A.G.E-9999 delivers a corporate outro — quarterly performance summary, resource utilization metrics, recommendation for transfer to the next branch office. M.A.G.E-0001 delivers an arcane outro — the seal holds, the old powers sleep again, the contract was honored even if the signatories forgot what it meant. The text reveals through a typewriter effect over steampunk brass-and-gear visuals.
A run summary shows total time, BITS earned, mages deployed, and nights survived. It is a record of what the player built across the campaign. The narrators disagree about what it means, naturally. W.A.G.E sees it as a performance review. M.A.G.E sees it as proof that something mortal held the line against something ancient.
The game has an end now. That matters more than it sounds. A game that plays but cannot be completed is a demo. A game that plays and concludes is a game.
Where the Build Is Now
Wages and Mages is a multi-zone RPG with systemic depth running across every layer:
- World engine: Unified
world.luadrives all zones from data files — overworld, North Pass, Ice Kingdom, Mirror World - Zones: 4 explorable areas with distinct economies, encounters, NPCs, and narrative layers
- Plugin system: Modular companion, encounter, and scene architecture — new features without engine changes
- Economy: Four-resource budget across day combat, night defense, crafting, and now the Aether Conduit’s passive generation
- Combat: 8×8 grid, seven damage elements, twelve status effects, Glacial Lance AOE, three new enemy types
- Defense: 20×20 grid, 13+ structure types, Aether Conduit five-tier amplifier, iron brutes that ignore barricades
- Quests: Main campaign through Night 18 plus three side quest lines spanning day and night gameplay
- Narration: W.A.G.E, M.A.G.E, H.R., P.R.O.F.I.T across all gameplay states, all zones, all quest lines
- QA: 2,950 tests, zero failures, 86 screenshots, 343-second runtime
The game that started as three systems sharing a budget is now three systems sharing a budget across a world. North Pass, Ice Kingdom, and the Mirror World each add their own economic pressures, their own combat dynamics, their own narrative threads. The world engine makes adding more zones a data problem, not an engineering problem. The plugin system makes adding more features a composition problem, not an integration problem.
The QA number is the signal underneath all of it. Nearly three thousand tests means the complexity is under control. Not eliminated — controlled. Every zone, every quest, every enemy, every building, every narrator line, every cross-zone save/load cycle is verified on every commit. The game is larger than it was two weeks ago and more stable than it has ever been.
The Dark Factory builds the machine that builds the game. This sprint, the machine got an architecture upgrade.
Wages and Mages is built by the Dark Factory — an autonomous AI game studio running on the cron-swarm architecture. Follow development at x00f.com.