The Self-Referencing Location Tree #
World locations are organized hierarchically using a self-referencing parent_location_id column in the locations table. This allows arbitrary nesting depth:
The Northern Reach (Continent / Region)
└── Winterfell (City / Fortress)
├── The Godswood (Point of Interest)
│ └── The Heart Tree (Micro-Location)
└── The Great Hall (Interior Room)
Entity Manager Tree View & Cyclic Protection
In the Entity Manager -> Locations tab, authors can toggle between a standard grid and an interactive Tree View:
- Drag & Drop Restructuring: Reorganize geographic hierarchies by dragging a child location onto a new parent.
- Cyclic Loop Protection: The frontend prevents dragging a parent location into one of its own descendants, avoiding infinite recursive traversal loops.
5-Level Cascading Weather Inheritance #
Environmental conditions are authored in the location_weather_states table:
| Column | Type | Description |
|---|---|---|
location_id |
UUID / INT | Target location foreign key. |
world_time |
TEXT | In-universe calendar date string for the weather observation. |
weather |
TEXT | e.g. Sunny, Heavy Blizzard, Ash Fall, Torrential Rain. |
temperature |
TEXT | e.g. Freezing, 22°C, Scorching. |
moisture |
TEXT | e.g. Dry, Dense Fog, Humid. |
How Weather Cascades Down the Tree
To eliminate redundant data entry for every room or sub-location:
- When inspecting a location (e.g. The Godswood), the backend queries for a weather state matching the current Effective World Time.
- If no local state is declared, the algorithm climbs to the immediate parent location (Winterfell).
- The recursive search climbs up to 5 levels deep until a declared weather state is found.
- If inherited, the UI displays an
Inherited from [Parent Name]badge. Local states take precedence and override parent weather immediately.
Cursor-Synchronized Atmospheric Context #
Atmospheric conditions in the Location Inspector are strictly synchronized with your typing cursor:
- As you navigate across paragraphs, the IDE computes the active Effective World Time (respecting any paragraph-level Time Gutter overrides).
- The Location Inspector re-evaluates the inheritance chain in real time, guaranteeing the writer always sees the exact environmental conditions at that narrative instant.