Classic Game Engine
The Classic Game Engine powers text-based adventure games in Super Text Adventure. You define your entire game world as a JSON document, and the engine handles parsing player commands, managing state, and running all game mechanics.
What You Can Build
How It Works
1. You write a JSON file describing your world - rooms, items, NPCs, and creatures.
2. The engine loads your JSON as the world_data.
3. Players type natural-language commands like go north, take sword, or talk to wizard.
4. The CommandParser translates input into structured commands (verb + target + modifier).
5. The Engine routes commands to the appropriate Handler (movement, items, combat, etc.).
6. The handler processes the command, updates game state, and returns a text response.
Top-Level JSON Structure
Every game world is defined by a single JSON object with these top-level keys:
// world_data.json { "meta": { "name": "My Adventure", "description": "A short quest to retrieve the Crystal of Power.", "starting_room": "tavern", "version": "1.0" }, "rooms": { /* room definitions */ }, "items": { /* item definitions */ }, "npcs": { /* NPC definitions */ }, "creatures": { /* creature definitions */ } }
Validation Contract
The engine checks every world against a machine-readable contract before a game starts, and the same files are published here so other tools can validate worlds exactly the same way:
> world.schema.json - JSON Schema for the document shape, with engine defaults recorded on the fields
> world.refs.json - every place an id is referenced and which collection it must exist in
> index.json - a corpus of valid, invalid, and lint worlds; each invalid one lists the error codes a validator must produce, and each lint one lists the advisory warnings a linter should report
Error codes are stable: schema.invalid, starting_room.missing, ref.missing, topic.missing, dice.outcomes, dice.consume_on, and attack_condition.invalid. Unknown keys are allowed everywhere except attack_condition, and meta.editor is reserved for editor tooling and never validated.
Quick Links
> World Builder - build and validate a world in your browser, no account needed; works offline
> World Structure - Full top-level schema details
> Rooms - Defining rooms, descriptions, and entry events
> Exits - Simple and complex exits, locks, hidden passages
> Items - All item types: weapons, consumables, keys, and more
> NPCs & Dialogue - Characters, dialogue trees, and quests
> Creatures - Enemies and their combat stats
> Combat - Turn-based combat mechanics
> Dice Rolls - D&D-style skill checks
> Flags & State - Global flags and game state tracking
> Containers - Openable and lockable containers
> Commands - All player commands and synonyms
> Full Example - A complete game world JSON