diff --git a/README.md b/README.md index 21125d0..2f035e8 100644 --- a/README.md +++ b/README.md @@ -22,32 +22,44 @@ GitHub `GameCult/BadDaySimulator` is a push mirror. ## What runs today: the pain box -A headless, deterministic simulation of one virtual human with a hand in a -pain box. Question it answers: **how long until the will breaks, or the box is -disabled first?** Entry points: +A deterministic simulation of one virtual human with a hand in a pain box, +run headless or on a Ymir ragdoll. Question it answers: **how long until the +will breaks, or the box is disabled first?** The nervous model is Lodur's +(`Lodur.Actor`); this game holds the box, the seed, the restraint and the +recorder. It needs sibling checkouts of Lodur and Ymir (`LODUR_ROOT`, else +`..\Lodur`; Lodur finds `..\Ymir`, or `YMIR_ROOT`). Entry points: -- `src/BadDay.Core/PainBoxSimulation.cs`: the model and the tick loop. -- `src/BadDay.Core/PainBoxParameters.cs`: every tunable, with defaults. +- `src/BadDay.Core/PainBoxSimulation.cs`: the headless run over Lodur's Actor. +- `src/BadDay.Core/PainBoxSession.cs`: the run's seed, traits, box and recorder; both runs drive it. +- `src/BadDay.Core/PainBox.cs`: the box schedule (ramp, jitter, disable time). +- `src/BadDay.Core/PainBoxParameters.cs`: the box and clock tunables, plus Lodur's parameter records as members. - `src/BadDay.Core/Sweep.cs`: consecutive seeds, break-time min/median/max. +- `src/BadDay.Ymir/BodyPainBox.cs`: the same run on the Ymir ragdoll, with the hand-out time. - `src/BadDay.Cli`: `baddaysim`. -- `tests/BadDay.Tests`: determinism, break-time and monotonicity tests. +- `tests/BadDay.Tests`: determinism, break-time, monotonicity and body tests. +- `tools/PainSweep`: the intensity x suppression table. ``` dotnet run --project src/BadDay.Cli -- run --seed 1 dotnet run --project src/BadDay.Cli -- sweep --seed 1 --count 50 --pull 0.3 dotnet run --project src/BadDay.Cli -- run --seed 1 --disable-at 5 +dotnet run --project src/BadDay.Cli -- run --seed 1 --body +dotnet run --project tools/PainSweep dotnet run --project tests/BadDay.Tests # exits non-zero on failure ``` `run` prints a timeline (samples every second, plus flinch, break and withdrawal events) and a one-line summary. Options: `--intensity`, `--pull`, -`--disable-at`, `--max`, `--every`. +`--disable-at`, `--max`, `--every`. `--body` runs it on the ragdoll (1/120 s +steps; the native Ymir library builds with cmake and a C compiler on first +build) and adds a line with the time the hand left the box. Nothing renders the puppet yet. ### Modeled -Fixed 10 ms tick, seeded SplitMix64 (the only randomness; integer arithmetic, -so a seed means the same stream anywhere). Following the layers in Lodur's -target, flattened to one loop: +Fixed 10 ms tick headless (1/120 s on the body), seeded SplitMix64 (the only +randomness; integer arithmetic, so a seed means the same stream anywhere). The +layers are Lodur's, run by its Actor (see Lodur's target); each timeline row is the +Actor's state at the end of its tick: - **Perception / nerve:** the box emits an intensity (ramped in, with seeded jitter). A nociceptor applies a threshold and sensitises under sustained @@ -67,7 +79,8 @@ target, flattened to one loop: ### Not modeled -No body, physics, balance, joints or ragdoll; no shock, adrenaline or blood +The headless run has no body, physics or balance (the body run has a ragdoll +held on a stool: it cannot balance); no shock, adrenaline or blood loss; no impairment or crawling; no Unity binding; no puppets or objects other than the box; no learning. The reflex never removes the hand by itself: only a broken will does. All parameter values are **placeholders**, not physiology; diff --git a/docs/pain-sweep.md b/docs/pain-sweep.md index b409db0..0273f00 100644 --- a/docs/pain-sweep.md +++ b/docs/pain-sweep.md @@ -39,7 +39,7 @@ Is time-to-break the right measure? It collapses a whole run to one number and treats "never" as an outcome of equal weight to "late". Candidates: time to first flinch, flinch count, area under the pain curve before the hand leaves, peak strain, or the fraction of seeds that break by a deadline. Which one says -what a player should feel? +what a player should feel? The open question is `lodur:question:pain-sweep-measure`. ## Build and run diff --git a/docs/scenarios/fella-bad-day-at-the-office.md b/docs/scenarios/fella-bad-day-at-the-office.md index b46aa08..9599ce0 100644 --- a/docs/scenarios/fella-bad-day-at-the-office.md +++ b/docs/scenarios/fella-bad-day-at-the-office.md @@ -19,8 +19,8 @@ top rung, not the first thing built. Each rung is demonstrable alone and measure | Rung | What runs | Status | |---|---|---| -| 1 | A Ymir body stands, falls and rests deterministically, read through the SoA view | built, draft PRs: Ymir `nibu/soa-joints` (stacked on Ymir#1), Lodur `nibu/first-slice` | -| 2 | One withdrawal reflex; time-to-break may be the main metric | built as the pain box (BDS PR #1, unmerged) | +| 1 | A Ymir body stands, falls and rests deterministically, read through the SoA view | merged (Ymir #2, Lodur #2) | +| 2 | One withdrawal reflex; time-to-break may be the main metric | built as the pain box, on Lodur's Actor; connected to rung 1: the pain box runs on the Ymir ragdoll (`baddaysim run --body`) | | 3 | Sensory load drives the stress bar | not built | | 4 | The goal flip, alone | not built | | 5 | Fatigue and limb failure (jelly), alone | not built | @@ -237,16 +237,15 @@ Lodur (all under Lodur's layer rules; none of it is built): - Coworker perception of another actor's visible state (strain, flinch, goal) and the shared behaviour selection weighted by axes. -Ymir (the pinned-Box3D boundary, `GameCult/Ymir`; the SoA world is PR -[GameCult/Ymir#1](https://eureka.gamecult.org/forge/GameCult/Ymir/pulls/1)): +Ymir (the pinned-Box3D boundary, `GameCult/Ymir`). The SoA world is merged (Ymir #2) with capsule and box +bodies, spheres, joints with state lanes (angle, speed, rotation), per-body force and torque write lanes, an +in-place state view and same-input same-bits stepping; Lodur's ragdoll and the pain box on it run on that. +Still missing: - Contact facts per body pair with relative speed (the planar session has Begin/Hit/End; the 3D SoA world has - none yet) to compute impact impulse for `impulseDelivered` and breaking. -- Breakable objects: a break threshold on a joint or weld, or removal of a body on a destroy call. Today the SoA + none) to compute impact impulse for `impulseDelivered` and breaking. +- Breakable objects: a break threshold on a joint or weld, or removal of a body on a destroy call. The SoA world has a fixed capacity and no removal. -- Body layout beyond spheres: capsule limbs, boxes, joints with state lanes (angle, speed, motor target), and - per-body force and torque write lanes. Follow-up `nibu-body:follow_up:ymir-soa-lodur-needs` lists these. -- Same-input same-bits stepping and an in-place state view, so metrics read lanes without copying and a seed - reproduces a run. +- Joint springs, for stiff limbs without explicit PD torques. - Stable ids for actors and objects so scenario documents refer to them. ## 5. Three tuning checks