NDL (Natural Description Language) - Index

ndl language-spec llm-world-engine

Overview

NDL (Natural Description Language) is a declarative language created by User-veritasr for bridging deterministic game logic with LLM-based narrative generation. It serves as a structured instruction format that eliminates LLM hallucinations by removing decision-making from the AI’s responsibilities.

Philosophy

“Program decides → NDL describes → LLM narrates”

NDL’s core insight: By separating game state decisions from narrative generation, you eliminate the primary source of AI hallucinations. The program makes all decisions; NDL describes what happened; the LLM only provides natural language output.

Quick Reference

Basic Syntax

do($entity, "action")                # Basic action with entity
do($entity, "action") ~ "manner"     # Action with manner modifier
do($entity, "action") intention="intent"  # Action with intent
action1 -> action2 -> action3        # Sequential actions
wait("condition")                    # Pause/delay
target($entity)                      # Specify target
result("outcome")                    # Declare result
search("object", intention="goal")   # Search action
convey("message", perspective="view") # Communication
system_response("message")           # System messages

Entity Reference Syntax

Entities are referenced with the $ prefix:

  • $"player" - Direct entity reference
  • $"guard" - Named NPC reference
  • $ - Implicit entity (context-dependent)

Common Patterns

# Combat narration
do($"player", "attack") ~ "sword" -> target($"goblin") -> result("hit") -> damage(8)
 
# Failed action with system response
do($"you", "swing makeshift club against table's surface", intention="test club's combat readiness")
-> result("failure")
-> system_response("something goes wrong when you try to perform this action")
-> describe()
 
# Search with intention
search("pile of wood", intention="find makeshift club") -> result()
 
# Social interaction (conversation)
talk("Mark", "John"^"Sue") -> convey("desire to explore dungeon", perspective="adventurous")
 
# Basic NDL processing example
do($"you", "write some NDL") -> wait("response validation")

Documentation Structure

📋 Specification

Formal language definition, grammar, and parsing rules

🔧 Constructs

Individual language elements with examples

🎯 Patterns

Common usage patterns and idioms

🔗 Integration

How NDL connects to the broader system

📜 Evolution

Historical development of the language

📚 Appendix

Reference materials

Key Concepts

Determinism First

NDL describes outcomes that have already been determined by game logic. It never asks the LLM to make decisions.

Layered Information

NDL provides multiple layers of context:

  1. What happened - The action itself (do(attack))
  2. How it happened - The manner (~ fiercely)
  3. Why it happened - The intention (intention="intimidate")

Composability

NDL constructs combine cleanly using operators like -> for sequencing, enabling complex narrative descriptions from simple building blocks.

Use Cases

  • ReallmCraft - Primary implementation in veritasr’s Minecraft engine
  • Turn-based games - Action narration with full context
  • Visual novels - Scene and dialogue description
  • Procedural storytelling - Dynamic narrative generation
  • Game state transitions - Bridging mechanics to narrative

Status

Version: Active Development (as of 2023-2024 discussions) Implementations: ReallmCraft (Minecraft with Fabric/Quilt) Community: LLM World Engine Discord channel


This documentation synthesized from the LLM World Engine Discord channel discussions, primarily contributions by User-veritasr.