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.
a, an, the) are ignored: take the lantern just works.attack gob hits the goblin; ambiguity prompts "Which do you mean: X, Y?"go n/s/e/w/u/d.push, pull, flush, activate, or use items on.Full game state serialized to JSON in Unity's persistent data path:
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:
| Difficulty | Behavior |
|---|---|
| EASY | Picks random valid columns. |
| MEDIUM | Takes an immediate win, blocks yours, otherwise center-biased random. |
| HARD | Minimax + 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. |
Library/, Temp/, Logs/, and builds are excluded from version control and regenerate on first open.)Assets/Scenes/ and press Play.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).| Category | Commands |
|---|---|
| Movement & world | go <dir> (or n/s/e/w/u/d), look [at <thing>], take <item>, drop <item>, use <item> [on <target>], push / pull / flush / activate <thing> |
| Character | inventory, equip / unequip <item>, equipment, status, char, skills [list], learn <skill>, cast <skill> [on <target>] |
| Combat & NPCs | attack <enemy>, talk to <character> |
| Economy & quests | balance, buy <item>, sell <item>, quests |
| System | save, load, help |
Inside a shop: buy, sell, leave. With a trainer: buy <skill>, leave. In the minigame: a column number 1–7, or quit.
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 Type | Folder | Defines |
|---|---|---|
| Location | Resources/Locations/ | Description, exits, default items/enemies/characters/interactables, shop settings, music |
| Item | Resources/Items/ | Type, descriptions, equipment bonuses, consumable effects, status effect on use, prices, stacking |
| Enemy | Resources/Enemies/ | Stats, evasion, AI behavior, attacks-on-sight, loot, XP, exit revealed on death |
| Enemy Behavior | Resources/Enemy Behaviors/ | Prioritized AI actions gated by health-threshold conditions |
| Special Ability | Resources/Special Abilities/ | Heal, stun, mana drain, cleanse, buff/debuff — magnitude + status payload |
| Character | Resources/Characters/ | Name, descriptions, starting dialogue, hostile form, skills taught, Connect Four skill |
| Dialogue Node | Resources/Dialogue/ | Text, responses → next nodes, required flags/items, failure node, success actions |
| Quest | Resources/Quests/ | Objectives and currency/item/XP rewards |
| Skill | Resources/Skills/ | Passive bonus or active spell (mana, targeting, effects), requirements, costs |
| Status Effect | Resources/Status Effects/ | Effect type, magnitude, duration, tick interval, chance, messages |
| Interactable | Resources/Interactables/ | Noun, descriptions, initial state, interactions (verb + state/item → effects), custom actions |
| Action | Resources/Actions/ | A built-in verb keyword and its synonyms |
| Custom Action | Resources/Actions/Custom/ | A brand-new verb: keyword, synonyms, failure message, effect list |
| Scenario | Resources/Scenarios/ | Test setup: starting location, inventory, enemies — loaded via Scenario Loader |
| Flag Registry | Resources/ | Master world-flag list feeding inspector dropdowns |
| Engine Settings | Resources/ | Feature toggles + balance numbers (below) |
One EngineSettings asset, assigned to the GameController, controls:
Tools ▸ Text Engine) — one-click scene setup: builds and wires the full UI + engine rig so a fresh project is playable immediately.Tools ▸ Text Engine) — one-click audit of every content asset: broken exit destinations, locked doors without keys, dialogue actions missing their item/quest, out-of-range quest objectives, assets outside Resources/, and duplicate asset names. Severity-ranked, click-to-ping.Window ▸ World Map Graph Editor) — a visual node graph of every location. Drag a compass port into another room's Entrance to create an exit; the reciprocal exit is auto-created but independently deletable, so one-way passages are easy. Re-drags preserve lock/hidden configuration. Full Undo. Right-drag to pan, Ctrl+A to auto-arrange.Window ▸ Dialogue Graph Editor) — branching conversations on a canvas: inline text editing, one-click "+ Response", drag-to-link response and failure ports, entry badges per character, auto-arrange, full Undo. Right-drag to pan.Window ▸ Flag Inspector) — view and toggle all world flags live at runtime.Window ▸ Scenario Loader) — jump the running game to a defined scenario.The runtime is organized around a central GameController with dedicated collaborators rather than one monolith:
| Piece | Responsibility |
|---|---|
GameController.cs | Lifecycle, input parsing & verb dispatch, movement, inventory, shops, skills, save/load orchestration |
GameController.Combat.cs | Attack resolution, enemy AI, special abilities, status effects (partial) |
GameController.Dialogue.cs | Conversation flow and dialogue-node actions (partial) |
GameController.ConnectFour.cs | The minigame: board, input, three-difficulty AI (partial) |
TextRenderer | Queued typewriter output pipeline, colorization, scrolling |
SaveSystem | JSON serialization and disk I/O |
WorldState | Loaded 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.
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/