Lodur: a physics character middleware. Characters feel stimuli, react by reflex, and are driven by pain, shock and resolve. Engine-agnostic C# core.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Meta Vens 52c89b4e81 Airway tests: the drain ramp is pinned, the side and upright bounds are re-derived by measurement
The_drain_is_linear_in_drop_up_to_DrainDrop reads the drained share at drop 0, 0.0125, 0.025, 0.05, 0.1 (0, 1/4, 1/2, 1, 1); the binary-drain and
doubled-slope mutants now die. SideDropBound 0.0036 -> 0.0110 m (shipped worst 0.01323, least claimed mutant 0.00914) and UprightBound -0.0206 -> -0.0408 m
(shipped 0.04615, least claimed 0.03615) from the measured readings of Soul's 19 mutants, geometric midpoints, separation 1.45 and 1.28.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-26 05:22:54 +01:00
docs Planner select: the commit tick checks the plan, an exhausted replan keeps the plan in force, one buffer for the pending plan, a Self goal's plan shared after the budget is gone, carried paths pinned, crowd rate as a margin 2026-11-26 04:43:53 +01:00
src Physiology: Afflict over a span of layers is all or none; the single-layer call is its one-layer case 2026-11-26 05:08:52 +01:00
tests Airway tests: the drain ramp is pinned, the side and upright bounds are re-derived by measurement 2026-11-26 05:22:54 +01:00
tools/pain-box-golden Pin the shake's upper bound, the golden table's line endings, and a clean BDS tree for regeneration 2026-11-19 22:06:34 +01:00
.gitattributes Pin the shake's upper bound, the golden table's line endings, and a clean BDS tree for regeneration 2026-11-19 22:06:34 +01:00
.gitignore First slice: PD-muscle humanoid ragdoll on Ymir's SoA world 2026-11-07 04:07:37 +00:00
Directory.Build.props Point the Ymir dependency at main now that the SoA joints merged 2026-11-10 17:16:55 +00:00
Lodur.slnx Lodur.Core.Tests: behaviour tests for the nervous layers, core-engine-free 2026-11-19 20:42:37 +01:00
README.md Airway drain follows the drop of each opening's rim below the deepest airway sump; the facing cosine and DrainFacingStart are deleted 2026-11-26 03:58:30 +01:00

Lodur

A physics character middleware for characters that feel and react: they pull back from something hot, jump when poked, and, if they want their objective badly enough, crawl toward it after losing a leg.

Status: layers 1-3 and a layer-4 stand-in run on a PD-muscle ragdoll on Ymir. The design is docs/lodur-target.md; read it first. Lodur.Core holds perception, the withdrawal reflex, the drive state and a hold-against-reflex stand-in, run per character by Actor; Lodur.Body.Ymir is the PD-muscle active ragdoll on Ymir's Box3D SoA world (docs/first-slice.md, measured and unmeasured). Behaviour selection beyond the stand-in, impairment and the learned tracker are not coded.

Entry points: src/Lodur.Core/Actor.cs (one character's nervous state, one tick per physics step), src/Lodur.Core/PdMuscle.cs (engine-free PD law, strength per muscle), src/Lodur.Core/BodyPlan.cs (a body as data: parts, joints that are the tree, sense points, airway openings), src/Lodur.Body.Ymir/Ragdoll.cs (builds a BodyPlan into a Ymir world; Drive, ReadSensePoints, and ReadAirway, which reads the liquid sensors it places at the airway openings (live and pooled volume) and each opening's drop below the airway sumps against the caller's down), tests/Lodur.Core.Tests (the layers and parity with the pain box; builds without Ymir), tests/Lodur.Tests (stand, fall, rest, same-seed-same-hash, and the connected pain box: ConnectedPainBoxTests). The map this was cut from is docs/connect-rungs-map.md. Needs a sibling Ymir checkout at main (the SoA joints merge, 2026-11-10, or later); dotnet test tests/Lodur.Tests builds its native library with cmake.

The problem

Active-ragdoll middleware (NaturalMotion's Euphoria, RootMotion's PuppetMaster) and learned physics controllers (DReCon, ProtoMotions) solve the body: physics, pose tracking and, in the learned case, balance. None of them models the nervous system. They have no senses that are not forces, no reflexes layered under deliberate behaviour, and no character whose pain competes with its will over time. Lodur is that layer.

Shape (planned)

  • Core (C#, no engine references): perception, reflexes, a drive state of pain, shock, adrenaline and resolve that evolves every tick (the will breaks at zero resolve and mends as it recovers, and can break again), and behaviour selection that turns the drive into targets plus muscle strength, weighted by the will available to each voluntary pose.
  • Body (per engine): follows those targets on the engine's own articulated physics. v1 is a PD-tracking active ragdoll on Ymir; v2 adds a small learned tracker for upright balance behind the same interface.

First consumer

Bad Day Simulator, a 3D physics sandbox.

Where it lives

Canonical: https://eureka.gamecult.org/forge/GameCult/Lodur. GitHub GameCult/Lodur is a push mirror.

Prior-art research: gamecult-ops/docs/research/euphoria-at-home-prior-art.md.