Pattern Library Index

This directory contains extracted architectural patterns, implementation examples, and design templates from the LLM World Engine Discord discussions.

Pattern Categories

Architectural Patterns

High-level system structure and design decisions for LLM-powered game engines.

Integration Patterns

How components communicate and interact.

State Patterns

How game state is managed and persisted.

Generation Patterns

How content is procedurally created.

Control Patterns

How LLM behavior is constrained and directed.

Usage

Each pattern file contains:

  • Context: When to use this pattern
  • Forces: Trade-offs and competing concerns
  • Solution: Structure and implementation
  • Consequences: Benefits and liabilities
  • Source: Original discussions and contributors

Pattern Relationships

graph TD
    A[Program-First Architecture] --> B[LLM Processing Pipeline]
    B --> C[NDL Bridge Pattern]
    C --> D[State-to-LLM Injection]

    E[Three-Tier Persistence] --> F[Scene-Based Boundaries]
    F --> G[Universal Data Structure]

    H[JIT Generation] --> I[Hierarchical Cascade]
    I --> J[Context Inheritance]

    A --> E
    B --> H

Key Insights

  1. LLMs are terrible at decision-making - Keep logic programmatic
  2. State and story are interleaved in LLM games (unlike traditional games)
  3. Templates solve the content problem - Structured generation beats free-form
  4. Small models work fine when decisions are pre-made (8B-9B sufficient)
  5. Scenes are natural boundaries for state management
  6. Visual programming is achievable with proper UI patterns

Tags

pattern architecture game-engine llm design-patterns