← Back to Projects

Personal Project · In Development

Wizard's Codex

ElectronTypeScriptReactNode.jsxterm.jsMonaco EditorVite

Overview

Wizard's Codex is an Electron desktop game built around a single design premise: compiled TypeScript is the magic system. Inspired by Bitburner, the game starts with manual console commands — summon a spirit, channel a resource — but as the player's domain grows, manual control becomes infeasible. Automation is the progression. Players move from typing individual commands to writing scripts that manage spirits, schedule rituals, react to world events, and govern dominions across a persistent fantasy world.

The interface is console-dominant — a 70/30 split between an xterm.js terminal and a read-only React status panel. Player scripts are authored in a Monaco editor overlay with full autocomplete via auto-generated TypeScript definitions, compiled in-process via ts.transpileModule, and executed in a worker_threads sandbox using SharedArrayBuffer and Atomics.wait for synchronous NS API calls back to the main process. The runtime exposes a fantasy-flavoured API (ns.summon(), ns.spirits(), ns.explore(), ns.dominion()) that drives a set of interconnected game systems — reservoir management, spirit progression, POI exploration, study trees, missive quests, and a dominion governance layer.

Key Contributions

01

TypeScript sandbox via worker_threads + SharedArrayBuffer + Atomics.wait for synchronous NS calls

02

In-process ts.transpileModule compilation with Monaco editor and auto-generated .d.ts for full autocomplete

03

xterm.js console as primary interface — keyboard-first, all game state queryable via commands

04

Interconnected systems: reservoir, spirits, POIs, activities, study tree, dominions, missives

05

Diegetic design throughout — scripts are 'inscriptions', the editor is the 'Scriptorium', running scripts are 'weavings'

06

Inspired by Bitburner — automation is the progression loop, not an optional power-up