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
| Field | Type | Required | Description |
|---|---|---|---|
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." }
| Field | Type | Description |
|---|---|---|
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:
- The room
nameas a heading - The room
description - The
on_entermessage (first visit only) - A list of visible items in the room
- A list of NPCs present
- A list of creatures present
- 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
- Write descriptions in second person present tense: "You see...", "A torch flickers..."
- Include sensory details — what the player sees, hears, and smells
- Mention interactable objects in descriptions to hint at items and NPCs
- Keep room IDs short and descriptive:
dark_cave,throne_room - A room can have an empty exits object
{}to create a dead end