Skip to content

Context: Stochastic Loot Engine

This system is a stochastic loot engine for an idle or simulation game. The core loop generates unique items and skills with randomized modifier ranges, governed by rarity tiers, and evaluates character loadouts for emergent power interactions. The central design axiom is that overpowered item and skill combinations are not design failures but the primary attractor state of the game loop. The generative system must make such combinations discoverable, reproducible, and shareable while ensuring they remain statistically rare. Canonical game-design worldbuilding for the game this engine serves lives in docs/lore/README.md, the source of truth for game-design intent.

ComponentDomainRationale
Skill PrimitiveClearFormal syntax with unambiguous production rules and static verification properties.
Charge Resource SystemClearDeterministic formula with bounded behavior and explicit state transitions.
Modifier AggregationClearTwo-layer commutative-semiring structure with mandatory cross-layer ordering.
Item Template GenerationComplicatedMulti-parameter schema with covariance constraints; analyzable but requires expertise.
Rarity DistributionComplicatedBeta-parameterized tier system with monotone nesting laws; tractable but non-obvious.
Condition TemporalityComplicatedThree-class taxonomy (spatial, decaying, accumulating) with evaluator registry pattern.
Trigger Graph EngineComplexEmergent graph structure from effect-to-trigger matching; cycle detection is algorithmic but outlier classification is emergent.
Stochastic VerificationComplexMonte Carlo simulation with importance sampling; outcome distributions are not analytically derivable.
Outlier DetectionComplexPhase-transition behavior in supercriticality; requires empirical probing to calibrate thresholds.
Algebraic LawsClearStatic properties amenable to property-based testing; violations indicate defects.
  • Core domain primitives: Skill, ItemTemplate, ChargePool, ConditionTemporality, Ascender
  • Generation layer: template generation from schema, instance rolling with Beta distributions, rarity tier assignment
  • Verification layer: static structural checks, compositional trigger graph analysis, stochastic simulation with Monte Carlo sampling
  • Algebraic law verification via property-based testing
  • Loadout classification schema (None, Candidate, VerifiedOutlier, UberOutlier) and outlier detection
  • Game client, rendering, or UI presentation layer
  • Network multiplayer or server infrastructure
  • Save file persistence beyond seed-based reproducibility
  • Real-time combat simulation, positional physics, or movement systems
  • Non-loot progression systems (experience, levels, achievements)
  • Cross-session cooldown persistence design (decision recorded, not implemented)
  • Outlier presentation layer (what the player sees when a build is classified as outlier)