Skip to main content

Crate chaos_rpg_core

Crate chaos_rpg_core 

Source
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:

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 rand distribution.
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.