// system online // unity 6000.5.1f1 //

TEXT_ADVENTURE_ENGINE

A data-driven engine for building parser-style text adventures in Unity. Rooms, items, enemies, dialogue, quests, and shops are authored as ScriptableObject assets — no code required to build a game — while the runtime handles parsing, combat, conversation, progression, and saving.

> take the lantern
> use key on door
> attack goblin

01Features

Parser

  • Natural input — articles (a, an, the) are ignored: take the lantern just works.
  • Partial matching — exact → prefix → substring, so attack gob hits the goblin; ambiguity prompts "Which do you mean: X, Y?"
  • Direction shortcutsgo n/s/e/w/u/d.
  • Data-driven verbs — every verb is an asset with synonyms; brand-new verbs are self-contained CustomAction assets with their own effects. No code.
  • Command history — up/down arrows recall previous commands.

World & Exploration

  • Locations connected by exits in six directions (N/E/S/W/Up/Down).
  • Exits can be locked (key items), hidden (revealed by events), item-blocked, or trigger instant death, gear-stripping, or item reveals in other rooms.
  • Interactables — state machines you can push, pull, flush, activate, or use items on.
  • Items with types, stack limits, prices, and separate room/inventory descriptions.

Combat

  • Turn-based with hit / dodge / evasion, damage variance, and armor mitigation.
  • Equipment matters — weapons/armor grant flat attack and attribute bonuses, recalculated on equip.
  • Enemy AI from behavior assets: prioritized actions gated by conditions ("health < 30% → heal").
  • Special abilities — heal, stun (blocks melee and casting), mana drain, cleanse, buffs/debuffs.
  • Status effects tick in real time and survive saves. Ambushes, loot, XP.

Progression

  • Optional leveling with scaling XP curves and skill points.
  • Optional primary attributes (STR/AGI/STA/INT) deriving health, mana, attack, hit/dodge — or simple flat stats when off.
  • Skills — active spells (mana cost, targeting) and passive bonuses, learned with points or bought from trainers.

NPCs, Dialogue & Quests

  • Branching dialogue trees with numbered responses; response-less nodes end cleanly.
  • Nodes gate on flags or items, branch to failure nodes, and fire actions: give/take items, reveal exits, start the minigame, turn NPCs hostile, open shops/trainers, drive quests.
  • Quests with per-objective progress and currency/item/XP rewards. Shops with live runtime inventories.

Presentation & UX

  • Queued typewriter rendering, press-space-to-skip, auto-scroll.
  • Color-coded output and automatic keyword highlighting of things in the room.
  • Flavor systems like drunkenness — the on-screen text literally wobbles, then sobers off in real time.

Save / Load

Full game state serialized to JSON in Unity's persistent data path:

Connect Four Minigame

A built-in alternate game mode reachable from dialogue, played against whichever character started it. Difficulty is set per NPC on the Character asset, so some characters offer casual games and others are nearly unbeatable:

DifficultyBehavior
EASYPicks random valid columns.
MEDIUMTakes an immediate win, blocks yours, otherwise center-biased random.
HARDMinimax + alpha-beta pruning, 8 plies deep, window-scoring heuristic, center-out ordering. Plays almost perfectly — sweeps Easy and Medium in testing — and still blocks threats in lost positions.

02Getting Started

  1. Install Unity 6000.5.1f1 (or a compatible Unity 6 release).
  2. Clone the repo and open the project folder in Unity. (Library/, Temp/, Logs/, and builds are excluded from version control and regenerate on first open.)
  3. Open the main scene under Assets/Scenes/ and press Play.
  4. To build your own game: run Tools ▸ Text Engine ▸ Create Game Scene — a complete, wired game scene in one click. Then create content assets in a Resources/ folder, wire rooms in the World Map Graph Editor, write conversations in the Dialogue Graph Editor, and point the starting locations at your own rooms. A full manual ships in the package (Documentation/Manual.md).

03Command Reference

CategoryCommands
Movement & worldgo <dir> (or n/s/e/w/u/d), look [at <thing>], take <item>, drop <item>, use <item> [on <target>], push / pull / flush / activate <thing>
Characterinventory, equip / unequip <item>, equipment, status, char, skills [list], learn <skill>, cast <skill> [on <target>]
Combat & NPCsattack <enemy>, talk to <character>
Economy & questsbalance, buy <item>, sell <item>, quests
Systemsave, load, help

Inside a shop: buy, sell, leave. With a trainer: buy <skill>, leave. In the minigame: a column number 17, or quit.

04Content Authoring

All game content lives inside a Resources/ folder using the subfolder names below, and is loaded into catalogs at startup — this single content home is what makes save/load restore-by-name work. The demo game's content is under Assets/TextAdventureEngine/Demo/Resources/; your own game's content can live in any Resources/ folder with the same subfolder layout. Create assets via Assets ▸ Create ▸ Text Adventure:

Asset TypeFolderDefines
LocationResources/Locations/Description, exits, default items/enemies/characters/interactables, shop settings, music
ItemResources/Items/Type, descriptions, equipment bonuses, consumable effects, status effect on use, prices, stacking
EnemyResources/Enemies/Stats, evasion, AI behavior, attacks-on-sight, loot, XP, exit revealed on death
Enemy BehaviorResources/Enemy Behaviors/Prioritized AI actions gated by health-threshold conditions
Special AbilityResources/Special Abilities/Heal, stun, mana drain, cleanse, buff/debuff — magnitude + status payload
CharacterResources/Characters/Name, descriptions, starting dialogue, hostile form, skills taught, Connect Four skill
Dialogue NodeResources/Dialogue/Text, responses → next nodes, required flags/items, failure node, success actions
QuestResources/Quests/Objectives and currency/item/XP rewards
SkillResources/Skills/Passive bonus or active spell (mana, targeting, effects), requirements, costs
Status EffectResources/Status Effects/Effect type, magnitude, duration, tick interval, chance, messages
InteractableResources/Interactables/Noun, descriptions, initial state, interactions (verb + state/item → effects), custom actions
ActionResources/Actions/A built-in verb keyword and its synonyms
Custom ActionResources/Actions/Custom/A brand-new verb: keyword, synonyms, failure message, effect list
ScenarioResources/Scenarios/Test setup: starting location, inventory, enemies — loaded via Scenario Loader
Flag RegistryResources/Master world-flag list feeding inspector dropdowns
Engine SettingsResources/Feature toggles + balance numbers (below)
SAVE-COMPATIBILITY: saves reference content by asset name. Renaming or deleting an asset orphans that piece of state in old saves — it is skipped with a warning, never a crash.

Engine Settings

One EngineSettings asset, assigned to the GameController, controls:

05Editor Tools

06Architecture

The runtime is organized around a central GameController with dedicated collaborators rather than one monolith:

PieceResponsibility
GameController.csLifecycle, input parsing & verb dispatch, movement, inventory, shops, skills, save/load orchestration
GameController.Combat.csAttack resolution, enemy AI, special abilities, status effects (partial)
GameController.Dialogue.csConversation flow and dialogue-node actions (partial)
GameController.ConnectFour.csThe minigame: board, input, three-difficulty AI (partial)
TextRendererQueued typewriter output pipeline, colorization, scrolling
SaveSystemJSON serialization and disk I/O
WorldStateLoaded content catalogs, per-location runtime state, lookups

Combat, dialogue, and the minigame are partials (rather than standalone classes) because they mutate a large amount of shared player state; splitting the files separates concerns without threading that state through an injected context.

Two wrapper classes keep runtime state off the shared assets: EnemyInstance (blueprint + current health) and ItemInstance (blueprint reference; the hook for future per-copy state like durability). Rooms, shops, inventory, and equipment slots all hold instances — ScriptableObject assets are never mutated at runtime.

The parser resolves the typed verb through the Action catalog (keyword + synonyms), dispatches through a verb-handler table, and falls back to CustomAction assets — the entire verb surface is data-driven.

All runtime code lives in the TextEngine namespace and editor tooling in TextEngine.EditorTools, compiled into separate asmdefs. An EditMode test suite covers the Connect Four AI, the noun matcher, catalog integrity (including duplicate-name detection — saves are name-keyed), and save round-tripping. Save files carry a format version, the GameController validates its scene wiring on startup with actionable [Text Engine] errors, and the engine works under either input backend (legacy Input Manager or the Input System package), detected at compile time.

07Project Layout

Assets/
├── TextAdventureEngine/
│   ├── Runtime/          Engine code (TextEngine namespace, TextEngine.Runtime asmdef)
│   ├── Editor/           Custom inspectors + World Map / Flag / Scenario windows
│   └── Demo/
│       ├── Resources/    The demo game's content (see authoring table)
│       ├── Scenes/       Demo scene + main menu
│       └── Prefabs/
└── TextMesh Pro/