Gradientfall: procedural animation framework + Kern's movement pass - #5
Merged
Conversation
Kern's locomotion is rebuilt on a new creature-agnostic animation stack under game/src/anim/, so every future villager, monster and boss inherits it rather than getting its own hand-tuned sine waves. The load-bearing change: the gait cycle is phased by DISTANCE TRAVELLED, not by time. A planted foot's body-relative position then retreats at exactly the speed the body advances, so it holds still in world space by algebraic identity rather than by tuning. The placeholder advanced its cycle on a timer while the body moved at whatever speed it liked, which is why the feet skated. Framework (9 modules): distance-phased gait engine; gait profiles as biomechanics, blended continuously by speed so there is no walk/run threshold to pop at; closed-form two-bone IK; terrain foot planting with leashed world plant-locks and surface-aligned ankles; a rigid-foot heel/toe rocker that keeps the contact patch exactly still through the roll; limb measurement off the rig itself; layered quaternion pose stack; emote library and player; coordinator. Kern: analog walk/jog/run/sprint (stick deflection IS the speed), crouch with capsule resize and ceiling check, slope-aware pace, step-up, landing absorption, turning that costs momentum, idle fidgets, head look-at, and 16 emotes/dances on a radial wheel. Verified with a new instrumented bench (scenes/dev/locomotion_lab.tscn) driving the real controller through 20 scripted segments on a four-zone obstacle course: foot slip 147 -> 47 mm/m overall and 19-23 mm/m at a walk, ground error 60 -> 7.4 mm, backward-knee frames 8182 -> 0, IK shortfall 5 mm. Game boots clean; validator passes 111 entries. Fixed in passing, both pre-existing: the placeholder gait bent Kern's knees BACKWARDS at every speed (positive X on the shin is hyperextension on this rig), and the boot shaft stopped 65 mm below the trouser cuff, leaving a visible hole whenever the knee bent. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kern's locomotion is rebuilt on a new creature-agnostic animation stack under
game/src/anim/, so every future villager, monster and boss inherits it rather than getting its own hand-tuned sine waves.The load-bearing change
The gait cycle is phased by distance travelled, not by time:
A planted foot's body-relative position then retreats at exactly the speed the body advances, so it holds still in world space as an algebraic identity — at any speed, mid-acceleration, across gait changes. The placeholder did
phase += delta * ratewhile the body moved at whatever speed it liked, which is why the feet skated.Framework (9 modules)
gait_engine.gdgait_profile.gdtwo_bone_ik.gdfoot_planter.gdlocomotion_profile.gdpose_stack.gdemote_library.gd/emote_player.gdanim_math.gdcreature_animator.gdGaits blend continuously, so there is no walk/run threshold to pop at — duty factor slides through 0.5 and double-support becomes a flight phase the way a real gait transition does.
Kern
Analog walk/jog/run/sprint (stick deflection is the speed), crouch with capsule resize and ceiling check, slope-aware pace, step-up, landing absorption, turning that costs momentum, idle fidget scheduler, head look-at with travel anticipation, and 16 emotes/dances on a radial wheel (
B/ right-stick click).Dances are named out of the world's own vocabulary: Gradient Descent, The Backprop, Overfit, Dropout, Convergence, Weight Shuffle, Epoch Step, Softmax.
Verification
New instrumented bench
scenes/dev/locomotion_lab.tscndrives the real controller through 20 scripted segments on a four-zone obstacle course (flat, ramps, stairs, broken ground) via theInputsingleton.Idle, hard-stop and turn-in-place measure ~0.2 mm. Game boots clean headless;
validate_content.pypasses 111 entries. Gait and dance frames eyes-verified against ground stripes.Fixed in passing (both pre-existing)
Known limitations (documented in DEVLOG)
CreatureAnimatoris the next milestone.🤖 Generated with Claude Code