Super Text Adventure

Rooms

Rooms are the core building blocks of your game world. Each room has a name, description, and a set of exits connecting it to other rooms.

Schema

"room_id": {
  "name": "The Tavern",
  "description": "A dimly lit tavern with a roaring fireplace...",
  "exits": {
    "north": "town_square",
    "down": { /* complex exit */ }
  },
  "on_enter": {
    "type": "message",
    "text": "The smell of ale hits you as you enter."
  }
}

Fields

FieldTypeRequiredDescription
name string required Display name shown to the player as a heading when they enter or look.
description string required The text description shown when the player enters or looks at the room.
exits object required An object mapping direction names to destinations. Can be empty {}. See Exits.
on_enter object optional Event triggered the first time a player enters this room.

on_enter

The on_enter event fires only on the player's first visit to a room. It's tracked via the player's visited_rooms list. Use it for story events, atmospheric flavor, or one-time revelations.

"on_enter": {
  "type": "message",
  "text": "A chill runs down your spine as you step into the darkness."
}
FieldTypeDescription
type string Must be "message".
text string The message displayed to the player on first entry.

What Players See

When a player enters a room or uses the look command, the engine displays:

  1. The room name as a heading
  2. The room description
  3. The on_enter message (first visit only)
  4. A list of visible items in the room
  5. A list of NPCs present
  6. A list of creatures present
  7. Available exits (hidden unrevealed exits are excluded)

Example

"tavern": {
  "name": "The Rusty Flagon",
  "description": "A cozy tavern filled with the murmur of conversation. A crackling fireplace warms the room. The bartender polishes glasses behind a weathered oak bar.",
  "exits": {
    "north": "town_square",
    "east": "kitchen",
    "down": {
      "to": "cellar",
      "requires": "cellar_key",
      "locked_msg": "The cellar door is locked tight."
    }
  },
  "on_enter": {
    "type": "message",
    "text": "The warmth of the fire embraces you as you step inside. Several patrons glance up before returning to their drinks."
  }
}

Tips