
RPSystem
A .NET 9 Avalonia desktop app for AI-driven world simulation: a 3D voxel world where LLM-driven characters coexist, act, and generate emergent narrative on a 6-second tick.
RPSystem is a .NET 9 desktop application for AI-driven world simulation, character management, and narrative storytelling. It creates a 3D voxel world where characters with LLM-driven behavior coexist, interact, and generate emergent narrative. The simulation ticks every 6 seconds, and each tick each character requests an action from a configured LLM given a snapshot of the world, nearby tiles, characters, memories, and narrative context.
It ships as two applications sharing a pure .NET 9 core library: RPSystem.Desktop (Avalonia UI 11) — the active desktop app with a SkiaSharp map canvas, world context editor, test maps, and settings — and a legacy MAUI shell retained for reference. The project was refactored from a single 3200+ line god-object viewmodel into 13 focused viewmodels.
The simulation service constructs an LlmSnapshot (world state + nearby tiles + characters + memory + context modules), sends it to the LLM, and applies the returned LlmActionResponse (thoughts, speech, actions, relationship deltas, scene/continuity updates) through a ConsistencyArbiter that clamps and validates proposed state changes. Markdown lore import includes prompt-injection detection, and a content-safety classifier filters LLM output.
Key features
- LLM-driven character simulation on a 6-second tick over a 3D voxel world.
- Avalonia 11 desktop app with a custom SkiaSharp map canvas and slice/selection rendering.
- A* pathfinding with multi-mode movement + flow-field caching for large groups.
- World context editor: character profiles, abilities, factions, species templates, scene/continuity.
- Memory compaction/summarization and a ConsistencyArbiter that clamps LLM-proposed state changes.
- Markdown lore import with prompt-injection detection; content-safety classifier on LLM output.
- JSON save/load round-trip; 13 focused viewmodels (refactored from a 3200-line god object).
- xUnit tests covering simulation ticking, pathfinding, save/load, markdown import, map projection.