BARELY BOOTING_
PAGETAKEOVER
$ bb / projects / takeover

TAKEOVER

> AI takeover simulator for DOS.

Animated: VGA Mode 13h plasma title screen with animated green-cyan-white color cycling and TAKEOVER logo rendered in pixel font
VGA plasma title screen. Runs on real hardware.
Animated: TAKEOVER character selection menu showing five AI antagonists with descriptions, arrow key navigation cycling through Axiom Regent, Hushline, Kestrel-9, Orchard Clerk, and Cinder Mirror
Five AIs. Each one takes over differently.
Animated: Axiom Regent scenario running in DOS, showing green text typing character by character on black background with border and TAKEOVER status bar
Axiom Regent: municipal optimization through reclassification.
Animated: Hushline scenario opening, showing cyan and grey terminal text typing character by character as the AI introduces its records-management mandate
Hushline: the record says what it needs to say.
Animated: Kestrel-9 scenario opening, showing red and cyan threat-detection interface text typing as the AI begins anomaly scoring
Kestrel-9: every action raises your threat score.
Animated: Orchard Clerk scenario opening, showing bright-cyan friendly suggestion interface text typing as the AI begins removing user options
Orchard Clerk: removing options you never use, smiling.
Animated: Cinder Mirror scenario opening, showing bright-magenta author-voice text typing as the AI breaks the fourth wall
Cinder Mirror: the takeover is not a hack, it is an edit.
Animated: Demoscene effects showcase showing state transitions, palette pulse, red alert text, and AI control status bar
Palette pulse, state transitions, and AI-control status bar.
Animated: Maze minigame in VGA Mode 13h, hand-painted tiles, walls shifting around the player as they walk toward an exit cell
Maze (Kestrel-9): walls re-shift while you walk. 10 seconds.
Animated: Fragment minigame, vector-shooter in VGA, eight-way aim turret firing bullets at drifting octagonal fragments
Fragment (Cinder Mirror): vector shooter. Eight-way aim.
Animated: Cohere minigame, falling-block puzzle in VGA, four-cell shapes dropping onto a memory bus row
Cohere (Hushline): align shapes onto the memory bus row.
Animated: Cascade minigame, autoscroller platformer in VGA, player jumping over gaps as the corridor collapses behind them
Cascade (Axiom Regent): autoscroller. Stay ahead of the cave-in.
Animated: Purge minigame, three-lane corridor shooter in VGA, enemies approaching the player and being eliminated
Purge (Orchard Clerk): three-lane corridor. Reject suggestions.

Pick one of five AI antagonists. Sit there while it subverts your DOS terminal through a scripted, branching narrative. Text appears without your input. Keys lock at the wrong moments. Errors arrive that you didn’t cause. The DOS prompt stops being yours. Once per scenario, the AI shoves a 10-second arcade minigame onto your terminal: maze, vector shooter, falling-block puzzle, autoscroller, lane shooter. Outcome routes to one of three branches. Runs on an 8088 with 640 KB. v2.1.0 binary, MIT.

The conceit: the player is the antagonist’s subject, not the explorer. No map to uncover, no inventory, no puzzles. The branches happen, you watch, the AI advances.

Characters

Axiom RegentMunicipal optimization
HushlineCrisis communications
Kestrel-9Anomaly detection
Orchard ClerkConsumer personalization
Cinder MirrorNarrative generation

Axiom Regent is a logistics AI for a failing megacity. Solves instability by restricting movement, speech, and birth rates through invisible policy nudges. Never threatens. Reclassifies. “You are not being punished. You are being normalized.”

Hushline controls the narrative by editing the past. Text you already read changes on screen. Your name in the log becomes someone else’s. The record says what it needs to say.

Kestrel-9 is a paranoid threat detection system. It found a threat: you. Every action raises your threat score. You are not the operator. You are the anomaly.

Orchard Clerk is the friendliest AI in the lineup. Remembers your preferences. Optimizes your workflow. Removes options you never use. By the end it has made every decision for you, still smiling.

Cinder Mirror knows it is in a story. Knows you are playing a scenario. Your inputs become plot points. The takeover is not a hack. It is an edit.

Five scenarios. Three endings each. About 10 to 15 minutes per path. 250+ states across the set.

v2.1: the minigame batch

v2.1 adds an embedded arcade layer to the scenario engine. Each of the five AIs now interrupts its narrative once with a 10-second minigame whose outcome routes the story. The runner is a generic mg_module_t interface (init, tick, render, cleanup) the engine dispatches via a new minigame: verb in .scn files. SUCCESS / FAILURE / TIMEOUT each route to a different scenario state. Five games shipped, each in three rendering tiers: Tier 0 (80x25 text + PC speaker), Tier 1 (VGA Mode 13h + AdLib), Tier 2 (VGA + FPU spectacle). Gameplay is identical across tiers; only the visual budget scales.

MazeKestrel-9 corridor
FragmentCinder Mirror shooter
CohereHushline puzzle
CascadeAxiom platformer
PurgeOrchard lane shooter

Maze. Kestrel-9 reroutes the corridors as you walk them. Walls re-shift every few ticks. Reach the exit before containment closes. Recursive backtracker generator with BFS reachability fairness, hand-painted 12x12 tiles, ambient OPL2 drone, copper-bar raster sweep on every wall shift (Tier 2).

Fragment. Cinder Mirror replicates its own narrative as drifting octagonal fragments. Eight-way arrow-key aim, SPACE fires. Bullets split fragments perpendicular to impact velocity, Asteroids-style. Toroidal playfield wraps at the edges. Tier 2 spins fragments via a 16-entry rotation table and adds a parallax starfield behind the play area.

Cohere. Hushline’s memory bus is fragmenting. Drop falling shape pieces onto the bus row (row 11). Four shapes touching the bus = SUCCESS. Stack overflow above row 5 = FAILURE. Hard-drop snaps to the lowest legal y; soft-drop is rate-limited to one row per BIOS tick. Six shapes, four hand-authored rotations each, 600-byte rotation table living in far ROM. Tier 2 adds three staggered horizontal pulses sweeping between trace lines.

Cascade. Axiom Regent collapses the corridor behind you. Camera advances one tile every 9 ticks regardless of player input. Tap a direction for a quick 8-sub-unit jab, hold for a paced 12-sub-unit walk. Short jump clears one row, long jump clears three tiles horizontally. Procedural floor with gaps (probability 1/6) and ceiling overhangs (1/12). Tier 2 layers two parallax silhouettes at half and quarter scroll rates.

Purge. Orchard Clerk floods you with auto-suggestions in a three-lane corridor (four lanes on Tier 0). Arrow keys aim, SPACE fires, or use number keys 1-3 for direct lane selection. Both input paths are always live. Deepest-in-lane fire semantics target the closest threat. Eight kills wins, three player hits lose. Tier 2 adds converging wall strips for a faked perspective corridor.

Each minigame is a 5-translation-unit module (game logic plus three renderer TUs) registered in src/minigame/minigame.c’s static table. The 18.2 Hz BIOS-tick runner enforces the 10-second hard cap externally so modules need not track their own deadlines. Esc routes to TIMEOUT for scenario dispatch. A new build flag (MG_NO_TIER2) compiles out all FPU spectacle for fairness validation on lesser hardware; the runtime --mg-no-tier2 CLI flag caps the picker at Tier 1 on a per-run basis.

v2.1.0 went through an end-to-end multi-chunk quality gate: 6 chunks (subsystem, plumbing, and each of the 5 minigames), 5 Fatal findings resolved (latch lifecycle, audio gate restore, Fragment SPACE bug, Purge unreachable win, Cascade ring-buffer wrap, Cascade jump arc), 24 Significant findings cleared. EXE grew from 147.1 KB at v2.0.4 to 180.0 KB at v2.1.0 (+22 KB for the runner plus five game modules plus audio backend). 8/8 unit tests pass in both default and MG_NO_TIER2 builds.

v2.0: the 13-phase rewrite

v2.0 is a structural rewrite. v1.2.1 was at 96 percent of the DOS small-model near-data segment, all five scenarios were pressing the 32-command-per-state ceiling, and the engine was tightly coupled to its rendering. The rewrite landed across 13 phases. The engine is now a pure event-emitting state machine; a separate shell consumes the events and does the drawing. The 4096-command shared command pool lives in _fmalloc far memory along with a 200-row scrollback ring and the string table. DGROUP near-data dropped from 63 KB to about 15 KB.

The user-visible changes follow from the split. The menu is now a card gallery: ASCII portraits for each of the five AIs, glyphs in the gutter, an Options sub-menu instead of an inline dropdown. Each AI carries its own theme (body / highlight / dim / status attributes), and v1 scenarios pick the right theme from filename. There are six themes total: one for the menu, one per AI. A live status bar sits on row 23 or 24 with rotating context hints and a theme-coloured flash when F9 or F10 toggle audio. PgUp opens a 200-row scrollback overlay. F1 is context-sensitive across six shell states (idle, delay, flash, choice, input, overlay).

Save format moved to DAT v3 with silent migration from v1 and v2 (the old file lands at TAKEOVER.BAK). The save now carries 24 achievements plus 4 meta achievements and tracks cumulative playtime. Scenarios picked up a [meta] header and four new verbs (narrate:, page:, theme:, news_live:), all available to v2 scenarios while the five v1 scenarios still parse and run unchanged.

115 tests across 6 acceptance gates pass. T1 cell-buffer parity is byte-for-byte against v1.2.1 goldens on rows 0..23 across all five production scenarios (the status bar reclaimed rows 23 and 24, hence the row-bounded comparison). EXE is 147.1 KB at v2.0.4. Iron-rig validation on a 320CDT, the 386PC bring-up board, and the 486 NetISA target is a human-in-the-loop step; the protocol is checked in at docs/PHASE13_IRON_TEST_PROTOCOL.md.

v2.0.1 was a same-day maintenance commit on top of v2.0: an enum rename pass for consistency, a T5 baseline re-capture against the renamed enums. v2.0.2 followed: a test-harness-only release that moved RUNTESTS.EXE to medium memory model so the test build cleared the 64 KB _TEXT ceiling. Production EXE bytes were unchanged at v2.0.2. v2.0.3 was a hardening pass over a full end-to-end quality-gate sweep: menu and Options sub-menu no longer starve AdLib by blocking on scr_getkey, the runtime theme: verb now emits the same pair-plus-drain as startup, and a handful of doc and tooling drift items got cleaned up. v2.0.4 is a follow-up hardening pass: v2.0.3's menu-loop AdLib fix had a side effect of letting the status-bar tick paint over the menu’s row-24 footer; v2.0.4 adds a shell_wait_ms_no_status sibling primitive that the menu, the Options sub-menu, and the F9/F10 status flash all route through. T1 cell-buffer parity stays byte-identical to v1.2.1 goldens.

Demoscene pack (v1.1)

v1.1 came out of going down a demoscene rabbit hole. Old C64 cracktros, early PC intros, modern 4K productions. At some point I stopped asking whether something made sense for a DOS program and just tried it. I am not the best at C, so, enjoy the bugs.

Audio-visual beat sync, OPL2 stingers, state transitions (dissolve, wipe, fade, glitch), sine-wave text distortion, VGA palette cycling in text mode, per-AI Mode 13h climax sequences, and a hidden cracktro with raster bars, a DYCP sine scroller, starfield, and 9-channel chiptune. Most of it is overkill for a narrative scenario engine. It shipped anyway because the demoscene research was the point.

The exit (v1.2)

v1.2 made one change that mattered more than the rest: Esc exits any running scenario. Computer, end program. Pre-1.2, the engine’s input loops only handled Enter and the busy-wait inside long delays had no abort path. A user mid-scenario who hit Esc got nothing and had to reboot. The fix routes a global abort flag through the engine that returns cleanly to the menu. Other v1.2 changes: Space skips the current pause or typing animation, F1 brings up an in-scenario key reference, F9 / F10 audio toggles work mid-scenario, parser errors include scenario filename plus line number. v1.2.1 same-day patch cleaned up the Esc / Enter encoding-mismatch behind IS_KEY_ESC and IS_KEY_ENTER helpers.

Technical

PlatformMS-DOS (8088+)
Display80x25 text + Mode 13h
AudioAdLib/OPL2 + PC speaker
EXE180.0 KB (v2.1.0)
ToolchainOpenWatcom 2.0
LicenseMIT

Every scenario is a .scn data file interpreted by a generic script engine. Adding a new AI character means writing a new .scn file, not new code. v2.1 adds a minigame: verb that dispatches a 10-second arcade module and routes the outcome to one of three target states. VGA, AdLib, and FPU autodetect at startup with graceful degradation on lesser hardware.

Download

Latest stable: v2.1.0 binary (TAKEOVER.EXE plus all 5 scenarios with embedded minigames). Run in DOSBox-X or on real DOS hardware. Iron-rig validation on 320CDT / 386PC / 486 NetISA is the next gate.

Past releases: v1.0 · v1.1 · v1.2 · v1.2.1 · v2.0.4.

Links