FLESHNOTE / DOCS / WORLDBUILDING GRAPH

Worldbuilding Graph & Epistemic Intelligence

v1.3.0

Technical breakdown of the Unified Entity Manager, hierarchical location weather inheritance, epistemic POV filtering, plot twist leak guard, and custom world calendars.

Unified Entity Manager & Renaming Wizard #

The Entity Manager (src/renderer/src/components/EntityManager.jsx) provides a tabbed dashboard managing all 5 entity types:

  • Characters: Name, aliases, biological species, birth date, archetype, goals.
  • Locations: Hierarchical parent-child nodes with climate presets.
  • Lore & Items: Artifacts, magic systems, spells, factions with custom categorization.
  • Twists & Secrets: Narrative revelations with danger phrase leak tracking.
  • Quick Notes: Lightweight scratch notes appended directly from editor selections.

Global Entity Renaming Wizard

When a character or location is renamed in FleshNote, the system does not simply update the SQLite label. The EntityRenamePopup executes an automated transaction across the entire project filesystem:

  1. Updates the database record name and aliases array.
  2. Scans all chapter Markdown files on disk (`{project}/md/*.md`).
  3. Rewrites the label portion of matching tokens: `{{char:ID|OldName}}` ➔ `{{char:ID|NewName}}`.
  4. Broadcasts a live state update to the TipTap editor instance, refreshing all displayed spans without requiring project reload.

Hierarchical Locations & Weather Inheritance #

Locations are organized as a directed tree structure via the parent_location_id column in SQLite:

SQL Recursive Weather Resolution
-- Resolves effective weather by climbing up the location ancestor tree
WITH RECURSIVE LocationHierarchy AS (
    SELECT id, name, parent_location_id, weather_override_id, 0 as depth
    FROM locations
    WHERE id = :current_location_id

    UNION ALL

    SELECT l.id, l.name, l.parent_location_id, l.weather_override_id, lh.depth + 1
    FROM locations l
    JOIN LocationHierarchy lh ON l.id = lh.parent_location_id
    WHERE lh.weather_override_id IS NULL
)
SELECT * FROM LocationHierarchy 
WHERE weather_override_id IS NOT NULL 
ORDER BY depth ASC 
LIMIT 1;

If a scene takes place in "Dungeon Cell #4", which is inside "Castle Black", which is in the "Northern Wastelands", the cell automatically inherits the blizzard weather state unless explicitly overridden at a lower level.

Epistemic Knowledge Graph (Who Knows What) #

The Epistemic UI (src/renderer/src/components/ide-panels/EntityInspectorPanel.jsx) solves narrative plot holes by distinguishing what the Author knows from what the POV Character knows.

View Mode Database Query Filtering Visible Information
Author View (Omniscient) `WHERE source_entity_id = :target_id` Displays all objective facts, secret goals, hidden motives, and future twists.
POV Filter Mode `WHERE source_entity_id = :target_id AND character_id = :active_pov_id AND learned_chapter_order <= :current_chapter_order` Displays only the subset of facts the current POV character has actually witnessed or learned up to this point in the timeline.

Twists, Foreshadowing & Leak Guard #

Narrative twists are registered in twists.py with a target chapter payoff and an array of danger_phrases.

As the author types in earlier chapters, the background scanner (backend/routes/twists.py) audits the chapter text. If a phrase matching a secret twist's danger vocabulary is detected before the designated revelation chapter, the editor displays a subtle warning badge in the metadata bar:

Leak Guard Warning Heuristic "Possible Premature Twist Leak in Chapter 3: Danger phrase 'The King is a Doppelgänger' was referenced before Chapter 18."

World History Timeline & Custom Calendars #

FleshNote includes a full astronomical calendar engine (backend/world_calendar.py):

  • Custom World Calendar: Define arbitrary months per year, days per month, custom week cycles, and astronomical season definitions.
  • Epoch Age Computation: Automatically translates character birth dates (e.g. Year 340, Month 4, Day 12) into exact years, months, and days relative to any scene's world timestamp.
  • World History Canvas: An interactive visual canvas (WorldbuildAndHistory.jsx) charting historical events, entity lifespans, and battles prior to Chapter 1.

Sketchboards & Node-Graph Canvas #

Visual diagramming canvas (src/renderer/src/components/Sketchboards.jsx) powered by an infinite 2D canvas with pan-and-zoom controls. Authors can drop entity cards onto the board and connect them with typed relationship vectors (e.g. "Nemesis", "Apprentice", "Allied Faction") to map magic trees and political power struggles.

On This Page