Expand description
Game logic for CHAOS RPG: every dice roll in the game is a chain of real math engines, and this crate is where that happens.
use chaos_rpg_core::chaos_pipeline::chaos_roll_verbose;
// Same input and seed, same chain, every time.
let roll = chaos_roll_verbose(0.5, 666);
for step in &roll.chain {
println!("{:<24} {:>6.3} -> {:>6.3}", step.engine_name, step.input, step.output);
}
assert!((-1.0..=1.0).contains(&roll.final_value));
let d20 = roll.as_d20();
assert!((1..=20).contains(&d20));Run cargo run -p chaos-rpg-core --example roll -- 666 in the repository
to print a full attack roll and destiny roll.
Where to look:
chaos_pipeline:chaos_roll_verbose,destiny_rollandChaosRollResult, the rolls behind everything.math_engines: the 10 engines (Lorenz attractor, Fourier harmonic, prime density sieve, Riemann zeta partial sum, Fibonacci golden spiral, Mandelbrot escape, logistic map, Euler’s totient, Collatz chain, modular exponentiation hash).character,combat,enemy,world: the game itself.
Rendering is the job of the frontend crates:
chaos-rpg (terminal),
chaos-rpg-graphical and
chaos-rpg-proof.
Modules§
- achievement_
system - Achievement and trophy tracking for chaos-rpg.
- achievements
- atlas
- Infinite Atlas endgame system.
- audio_
events - audio_
synth - bestiary
- Monster bestiary with AI behaviors for CHAOS RPG.
- body
- Dwarf Fortress-style body part system.
- bosses
- Unique boss encounters with hand-crafted mechanics.
- chaos_
config - chaos_
pipeline - The Chaos Pipeline — chaining mathematical engines to produce destiny.
- character
- Characters, classes, stats, and leveling.
- character_
creator - Character creation system.
- character_
lore - Player-authored character lore — stored per-character in the save file.
- class_
system - Character class advancement: levels, abilities, and specializations.
- codex_
progress - Codex progress — tracks which lore entries the player has unlocked.
- combat
- Turn-based combat system powered by chaos math.
- combat_
simulator - Full combat simulation with initiative, status effects, and action economy.
- combat_
system - Turn-based combat engine — initiative, conditions, actions, rounds.
- crafting
- Crafting system — every operation is chaos-rolled.
- crafting_
system - Recipe-based crafting system for CHAOS RPG.
- crafting_
system_ v2 - Advanced crafting with recipe discovery and ingredient substitution.
- daily_
leaderboard - dialogue
- NPC dialogue tree system.
- dialogue_
system - Branching dialogue tree system with conditions and effects.
- dice
- Chaos dice as a
randdistribution. - dungeon
- Procedural dungeon map generator for CHAOS RPG.
- dungeon_
generator - Dungeon generation: BSP tree room placement + corridor carving
- dungeon_
generator_ v2 - Voronoi-based dungeon generation (v2).
- economy
- In-game economy with supply/demand dynamics.
- enemy
- Enemy generation via chaos algorithms.
- enemy_
ai - Enemy AI state machine with behavior archetypes.
- faction_
system - Faction politics, diplomacy, and player reputation.
- factions
- Faction and reputation system.
- inventory_
system - Full inventory management system.
- io_util
- Minimal terminal I/O utilities for use inside core game logic.
- items
- Item generation — every item is a chaos-rolled catastrophe.
- legacy_
system - Cross-run persistence: lifetime stats, achievements, unlocks, and the Graveyard.
- loot_
system - Procedural loot generation system for chaos-rpg.
- loot_
table - Loot table: weighted random drops with rarity tiers and set bonuses
- lore
- CHAOS RPG Lore System — the narrative layer connecting every mechanic to The Proof.
- magic
- Spell casting and mana system for CHAOS RPG.
- magic_
system - Magic system: spell crafting, mana management, and magical effects.
- map_
generator - math_
engines - The 10 Sacred Mathematical Algorithms of CHAOS RPG.
- merchant_
system - misery_
system - Misery Index, Spite resource, Defiance state, Cosmic Joke, and Underdog mechanics.
- nemesis
- Nemesis system — the enemy that killed you follows you to the next run.
- npc_
generator - Procedural NPC generation — fully deterministic given a seed.
- npcs
- NPC generation — merchants, quest-givers, mysterious strangers.
- party_
system - Party management system: formation, shared resources, group bonuses.
- passive_
tree - Path of Exile-style passive skill tree — ~800 nodes across 5 rings.
- paths
- Where CHAOS RPG keeps its files (saves, scores, settings).
- player_
bestiary - Player Bestiary — persistent record of all enemies and bosses encountered.
- power_
tier - Expanded power tier system — 40+ tiers spanning from THE VOID to ΩMEGA.
- quest
- Quest and objective tracking system for chaos-rpg.
- quest_
system - Quest chain system for CHAOS RPG.
- recipes
- Item crafting and recipe system.
- relationship_
system - NPC relationship tracking: trust, affection, and interaction history.
- run_
history - run_
stats - Per-run statistics tracker.
- save_
system - Game state serialization — simple key=value text format, no external crates.
- scoreboard
- Scoreboard persistence — saves/loads top scores and Hall of Misery as JSON.
- skill_
checks - Skill checks — verbose engine chain display for all non-combat decisions.
- skill_
tree - Path of Exile-style passive skill tree.
- skill_
tree_ v2 - XP-gated skill tree with prerequisites, leveling, and effect aggregation.
- spells
- Spell generation — 7 schools, 147 named spells, cooldowns, spell levels.
- status_
effects - Extended status-effect system for CHAOS RPG.
- time_
system - time_
util - Calendar dates for scoreboards, the daily leaderboard and the bestiary.
- trap_
system - weather_
system - Dynamic weather system affecting gameplay.
- world
- World generation — rooms, areas, environmental effects.
- world_
map - Overworld map with rooms and connections.