Repository navigation
[11/11] test(player): the locomotion transitions as GIFs - #231
Merged
Merged
Conversation
…code trace.ts runs movement.ts, jump.ts and animation.ts as player.ts wires them (flat ground, 120 Hz) through idle-walk-idle, walk-run-walk-run, idle-run-idle, idle-jump-land and run-jump-land-run; transition_gifs.py draws each at 30 fps with ground ticks that move with the world. Every clip switch moves the outline no more than the cycle's own frame step (#156).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Stack: 11 of 11 (playtest): #212–#229 are merged, so this PR now targets main. Merge only on Alexander's word.
What and why
#156, "smooth transitions": a GIF of each locomotion transition, made by the game's own code, not by hand.
game/verification/transitions/trace.tsrunsmovement.ts,jump.tsandanimation.tsthe wayplayer.tswires them: flat ground at the 120 Hz step, with the hero atlases' ownanims.json. It prints which frame shows at each step and where the body is.scripts/transition_gifs.pydraws each trace at 30 fps and 2x, with the camera on the hero. The ground ticks are one foot apart and scroll with the world, so a sliding foot shows against them. Each frame is labelled with the clip frame and the pose the body asked for.The transitions
Holding the stick for 0.4 s starts the run, so after a run the body slows to a walk and then runs again. That's why the second GIF ends in a run.
Pops, measured
Every clip switch lands on a contact frame and goes through the bridge clips (idle-walk, walk-run, run-start). To check for pops, I compared how far the sprite's outline moves at each clip switch with how far it moves between frames inside a cycle:
No switch moves the outline more than the cycle's own frame-to-frame step.
Issue
Refs #156. With this PR the "smooth transitions" criterion is met. The walk and run speeds measured from the strides are already in main (2.2 and 4.6 m/s, f59fccf). Still open in #156: the 2-minute recorded keyboard + pad playtest.
Verification
python scripts/transition_gifs.pywrites all five GIFs (1.9 MB together).pytest scripts/test_transition_gifs.py: 3 passed (the 30 fps sampling and where a frame is drawn).tscandcheck_docs.pyare clean.