Lores

A dynamic knowledge system that drives character interactions and world-building. NPCs and players can reference or discover lore based on their knowledge categories.

How Lore Works

Character Access

Lore entries are accessed by characters based on their knowledgeCategories. Each lore item belongs to one or more categories that determine which characters can access them.

Access Rules:

  • If a character's knowledgeCategories includes a lore entry's category, they can recall and refer to that information

  • If keywords from a lore entry appear in a conversation, the system may inject the corresponding lore into the character's short-term memory

  • Lore with the common category is accessible to all characters, regardless of their knowledge categories

  • This allows different characters to have different understandings of the world based on what they know

System Access

The Story system itself ignores categories when accessing lore programmatically. During character generation or context parsing:

  • If keywords from a lore entry appear in the character's context during creation, the system automatically associates the relevant lore with the character—regardless of categories

  • This enables automatic lore integration during NPC generation commands

Lore Structure

Each lore entry includes the following fields:

Required Fields

  • name: A short, readable title for the lore entry

  • context: The full descriptive or narrative explanation

  • keywords: Terms associated with this lore for search and filtering

  • categories: Tags used to determine which characters may know this lore

Example Lore Entry

name: Fundamentals of Cross-Racial Magic Theory
context: |-
  ## Course Overview
  
  Fundamentals of Cross-Racial Magic Theory, taught by Maester Valen, serves as the cornerstone of the Brotherhood's integrative magical philosophy...
  
keywords:
  - Cross-Racial Magic
  - Magical Theory
  - Human Magic
  - Elven Magic
  - Brotherhood
  - Maester Valen
  
categories:
  - brotherhood
  - academic
  - magical-theory
  - comparative-magic

Category System

Common Categories

  • common: Accessible to all characters regardless of their knowledge categories

  • academic: Knowledge typically held by scholars, maesters, and educated characters

  • military: Information known to soldiers, guards, and military personnel

  • myth: Legendary or mythological knowledge

  • restricted: Secret or classified information

  • brotherhood: Knowledge specific to the Brotherhood organization

  • magical-theory: Understanding of magical systems and principles

Custom Categories

You can create custom categories for your world:

  • Faction-specific: house-lannister, eldoran-kingdom, windhelm-guards

  • Professional: blacksmith, merchant, healer

  • Regional: northern-knowledge, coastal-lore, desert-wisdom

  • Temporal: ancient-history, recent-events, current-affairs

Creating Lore Entries

Manual Creation

Create lore entries by adding YAML files to the lore/ directory:

name: The Fall of Megin
context: |-
  The Fall of Megin refers to the dramatic events that led to the collapse of the once-powerful rebel leader's movement...
  
keywords:
  - Megin
  - Rebellion
  - Eldershade
  - Lord Varcar
  - Fall
  
categories:
  - common
  - recent-events
  - eldershade

AI-Assisted Creation

Use the /story lore create command to generate lore entries:

/story lore create "The ancient Worldtree at the heart of Lysathara" "mythology, elven, sacred"

This command will:

  • Generate context based on your description

  • Extract relevant keywords

  • Assign appropriate categories

  • Create the lore entry file

Lore Integration

Character Generation

When creating NPCs, lore is automatically integrated:

/npcinit "Maester Valen" "Brotherhood" "A wise teacher of cross-racial magic theory"

The system will:

  • Search for keywords like "Brotherhood", "magic", "theory"

  • Associate relevant lore entries with the character

  • Set appropriate knowledge categories

  • Enable the character to reference that lore in conversations

Conversation System

During conversations, the system:

  • Monitors for lore keywords in player messages

  • Injects relevant lore into NPC short-term memory

  • Enables natural references to world knowledge

  • Maintains character-appropriate knowledge levels

Location Integration

Lore can be tied to locations:

/story location create "The Worldtree Sanctuary" "Ancient elven sacred site with deep magical significance"

The system will:

  • Connect location context to relevant lore

  • Enable NPCs at that location to reference the lore

  • Create contextual conversations about the site

Best Practices

Writing Effective Lore

  1. Be Specific: Include concrete details and names

  2. Use Keywords: Add relevant terms for searchability

  3. Set Categories: Choose appropriate knowledge categories

  4. Keep Context Rich: Provide detailed, immersive descriptions

  5. Cross-Reference: Link to other lore entries when relevant

Category Management

  1. Use Common Wisely: Reserve common for truly universal knowledge

  2. Create Hierarchies: Use nested categories like brotherhood.academic

  3. Be Consistent: Use the same categories across related lore

  4. Plan Access: Consider which characters should know what

Integration Tips

  1. Keyword Overlap: Use consistent keywords across related lore

  2. Character Knowledge: Assign knowledge categories that match character roles

  3. Progressive Revelation: Use restricted categories for secret information

  4. Contextual Relevance: Ensure lore matches the character's background

Advanced Features

Dynamic Lore Injection

The system can dynamically inject lore into conversations based on:

  • Keyword mentions in player messages

  • Character knowledge categories

  • Current location context

  • Ongoing story events

Lore Relationships

Lore entries can reference each other:

  • Characters with knowledge of one lore can reference related lore

  • The system maintains connections between related entries

  • Cross-references enhance world consistency

Last updated