For epic fantasy and space opera authors managing worldbuilding bibles with hundreds of characters, factions, artifacts, and kingdoms, the Novelcrafter Codex is an indispensable narrative engine. However, as world bibles scale past 150 entries, novelists routinely hit a silent productivity killer: Context Window Bloat.
An innocent passing mention of a character like "Will glanced at the sky" triggers an entry for "Lord William of House Vane". Worse, if Lord William is linked bidirectionally to his faction, his faction is linked to five other noble houses, and each house links to dozens of retainers, a single dialogue beat can cascade 15,000 tokens of irrelevant background lore directly into the LLM prompt. The result is bloated API bills, degraded instruction following, and hallucinated prose where the AI loses track of the immediate scene beat.
At 365Finds, our testing shows that bidirectional relations across worldbuilding codices represent an architectural anti-pattern. To maintain razor-sharp AI generation across 100,000+ word manuscripts, worldbuilders must enforce strict case-sensitive alias matching, implement Directed Acyclic Graph (DAG) one-way relations, and leverage Novelcrafter's underutilized "Don't include when detected" injection rule.
The Root Cause: Novelcrafter's Context Aggregation Pipeline
To prevent lore bloat, you must understand the exact sequence Novelcrafter uses to inject Codex entries into the prompt builder:
- Beat & Recent Text Mentions: Novelcrafter scans the current beat and preceding prose for entry names, tags, and aliases.
- Manual Scene References: Any Codex items explicitly attached via
+ Codexon the Scene card are added. - POV Character: The active Point-of-View character assigned to the scene is pulled into memory.
- Global Entries: All entries configured with Always include are injected at the top of the context block.
- Relational Ingestion (Child Entries): Every entry collected in steps 1 through 4 checks its outgoing relations. Linked child entries are fetched and added to the prompt context. Note that the descriptive relation text itself is omitted; the AI receives the child entry's actual lore.
- Deduplication & Sorting: Empty entries without body text are pruned. Remaining entries are grouped:
Global Entries$\to$Entry Type (Characters, Locations, Lore)$\to$Alphabetical Order.
Context snowballing happens almost entirely in Step 5. If your relations are bidirectional or cyclic, a single character mention pulls their entire social graph, geography, and lineage into prompt memory.
Phase 1: Precision Alias Engineering
Aliases allow the AI to recognize nicknames, military ranks, formal titles, and epithets. But unconstrained aliases create massive false-positive noise.
[Problematic Alias Pattern]
Name: Seraphina Vance
Aliases: Phina, Vance, The Hawk, Will, Sister
[Optimized Alias Pattern]
Name: Lady Seraphina Vance
Aliases: Phina, Lady Vance, The Hawk of Oakhaven
Case-Sensitive: ENABLED
Exclusions: sister, vance automotive, will
1. Enforce Case-Sensitive Matching on Common Nouns and Short Names
If a character or entity shares a name with a common English verb or noun ("Will", "May", "Ash", "Storm", "Rose", "Grace"), leaving standard case matching enabled causes Novelcrafter to inject full character lore every time a character speaks modal verbs ("I will go").
- Navigate to the entry's Tracking tab.
- Toggle Case-sensitive matching to ON.
- This restricts triggers exclusively to capitalized tokens ("Will", "Storm"), ignoring lowercase usage.
2. Auto-Pluralization vs. Irregular Alias Declensions
Novelcrafter automatically tracks standard English plurals for nouns (e.g., matching "Goblin" will catch "Goblins" in prose). Do not waste alias slots on regular +s or +es forms.
- For irregular plurals or collective nouns, manually add them as aliases (e.g., for an entry titled "Wolfkin Shaman", add "Wolfkin Shamans", "Wolves of the Rim").
- For fantasy terms that modify roots, include each inflection explicitly (e.g., "Mage-Smith", "Mage-Smiths", "Mage-Smithing").
3. Deploy the Comma-Separated Exclusion List
In the Tracking tab, Novelcrafter provides an Exclusion list field. Use this to filter out common homonyms, idioms, and phrases that mimic your entity names without referring to them:
- For a character named "Ash", add exclusions:
ash tree, cigarette ash, ash gray. - For a faction named "The Crown", add exclusions:
crown of the head, dental crown.
Phase 2: Directed Acyclic Relational Architecture
The default human instinct in worldbuilding is to cross-link everything: Character A is friends with Character B; Character B belongs to Guild C; Guild C is based in City D. In Novelcrafter, this creates an unmanageable context explosion.
flowchart TD
subgraph AntiPattern["Anti-Pattern: Bidirectional Mesh (Context Snowball)"]
A1[Lord Vane] <--> B1[Iron Guild]
B1 <--> C1[Guild Citadel]
B1 <--> D1[Lieutenant Kael]
D1 <--> E1[Shadow Dagger Artifact]
end
subgraph RecommendedDAG["Recommended: Top-Down Directed Acyclic Graph"]
F1[Iron Guild] -->|Child Link| A2[Guild Citadel]
F1 -->|Child Link| B2[Guild Uniform & Lore]
K1[Lieutenant Kael] -.->|Reference Tag Only| F1
end
The Top-Down One-Way Rule
Novelcrafter treats relations as directional by default. When Entry A links to Entry B in its Relations tab, mentioning Entry A pulls Entry B. However, mentioning Entry B does not pull Entry A unless you manually configure a return link.
At 365Finds, we recommend structuring world lore as a strict Top-Down Directed Tree:
- Faction / House / Organization (Parent):
- Contains high-level lore, history, motives, and sigils.
- Links outward (downward) to primary locations (headquarters) and core organization secrets.
- Mentioning the Faction pulls its headquarters into context.
- Individual Operatives / Characters (Leaf Nodes):
- Should not link downward to the entire Faction.
- Instead, state the character's affiliation directly in the character's 1-paragraph summary (e.g., "Senior enforcer for the Iron Syndicate").
- If an interrogation or strategy scene requires full syndicate lore, link the Faction manually on the Scene card or mention the Faction name directly in the beat.
Inverting and Auditing Relation Links
When linking entries in the Relations tab:
- Click + Add Entry and select the target item.
- Note the direction arrow. If you accidentally created a relation on the character that points to a 2,000-word faction dossier, click the Invert Direction (Double-Headed Arrow) icon or remove the link.
- Keep child entries per character under three items. Avoid linking family trees bidirectionally across extended dynasties.
Phase 3: The "Don't Include When Detected" Strategy
This setting is Novelcrafter's most powerful yet misunderstood feature for managing token economics.
In the Tracking tab of any Codex entry, Novelcrafter provides four distinct injection modes:
| Tracking Mode | Triggered by Prose Mention? | Triggered as Child of Linked Entry? | Best Use Case |
|---|---|---|---|
| Always include | Always injected regardless of text | Always injected | Core world rules; system prompts; hard prose constraints. |
| Include when detected (Default) | Yes | Yes | Primary characters; active locations; distinct named artifacts. |
| Don't include when detected | No | Yes | Sub-locations; secondary weapons; secret factions; dormant character lore. |
| Never include | No | No | Author-only outlines; spoiler notes; future book treatments. |
Decoupling Mentions from Context Injection
When an entry is configured to Don't include when detected:
- If a character says, "Pass me the silver flask", and "Silver Flask" is set to Don't include when detected, Novelcrafter will not inject the Silver Flask dossier into the prompt.
- However, if the POV Character has "Silver Flask" configured as a child relation, the flask's lore is injected whenever the character participates in the scene.
- Alternatively, if you explicitly add
+ Codex: Silver Flaskto the scene header, it is injected cleanly.
This master pattern allows worldbuilders to maintain exhaustive technical entries for sub-locations (e.g., "The Royal Armory's South Tunnel"), minor tools, and branch lineages without cluttering the LLM's active memory during normal dialogue.
Phase 4: Programmatic Context Control via Prompt Functions
For power users who build custom prompt templates in Novelcrafter's Prompt Builder, you can bypass broad relational cascades entirely and enforce algorithmic injection using built-in prompt functions.
Instead of relying on automatic relation loading (Step 5 of the pipeline), you can disable child relation cascading globally in your prompt context block and query relations selectively using handlebars-style functions:
1. Querying Targeted Relations
Use {codex.relations} to retrieve only specific relation types:
{#each (codex.relations entry="current_pov" type="weapon")}
Item: {this.name} - Properties: {this.summary}
{/each}
2. Conditional Lore Injection with {codex.isRelatedTo}
Prevent secondary lore from entering the prompt unless two interacting entities are confirmed to share a narrative connection:
{#if (codex.isRelatedTo entryA=scene.pov entryB="Iron Syndicate")}
Narrative Context: {scene.pov.name} is bound by blood oath to the Iron Syndicate. Maintain an underlying tone of paranoia and guarded hostility.
{/if}
3. Extracting Clean Summaries Without Full Lore Bloat
If an entity has a long 1,500-word historical article, dumping the entire entry degrades LLM performance. In your custom prompt, isolate {codex.summary} or {codex.context} rather than printing {codex.description}:
{#each codex.activeEntries}
### {this.name} ({this.type})
Context: {this.context}
{/each}
Best Practice Checklist for High-Density Worldbuilding
- Conduct an Alias Audit: Filter your Codex for single-word aliases. Force Case-sensitive matching on any alias that matches standard dictionary words.
- Break Bidirectional Loops: Go to major factions, cities, and guilds. Ensure arrows point downward toward sub-components, not circularly between members.
- Downgrade Minor Entities: Change background artifacts, secondary locations, and faction sub-branches from Include when detected to Don't include when detected.
- Enforce 200-Word Lore Budgets: Keep entry context blocks under 200 words. Store deep authorial thoughts and unrevealed world history in fields or notes set to Never include.
- Monitor the Final Prompt: Before generating long chapters, inspect the Prompt Preview in Novelcrafter's Chat or Prose interface. Verify that the total injected Codex tokens remain under 2,500 tokens per beat.
By configuring aliases strictly and designing a directed one-way relational graph, fantasy and sci-fi authors can expand their worldbuilding bibles to thousands of entries while keeping AI generation swift, coherent, and cost-effective.