[GH-ISSUE #1776] Weird turtle feet behavior #542

Closed
opened 2026-11-02 15:39:53 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @ludovic111 on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1776

What I did: Load into a world and observe a turtle moving around
What happened: The turtle's feet are moving erratically
What I expected: 1 to 1 behavior with regular Minecraft
Horizon version: v0.2.54
OS, CPU, GPU: CachyOS, 14900k, 6800XT
Below are links showcasing the problem, both with and without a resource pack (Faithful 64x), demonstrating that it is not a resource pack issue
Resource pack: https://canbari.com/share/direct/8d3838b1-91cd-43ae-8cd5-603a712db27c.mp4
No resource pack: https://canbari.com/share/direct/5d75b904-bc9a-4d54-b4ba-90b5e7d842af.mp4

Reported on Discord by thebigchungoose in #horizon-bugs · Discord thread
Tags: rendering

Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.

Originally created by @ludovic111 on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1776 > What I did: Load into a world and observe a turtle moving around > What happened: The turtle's feet are moving erratically > What I expected: 1 to 1 behavior with regular Minecraft > Horizon version: v0.2.54 > OS, CPU, GPU: CachyOS, 14900k, 6800XT > Below are links showcasing the problem, both with and without a resource pack (Faithful 64x), demonstrating that it is not a resource pack issue > Resource pack: https://canbari.com/share/direct/8d3838b1-91cd-43ae-8cd5-603a712db27c.mp4 > No resource pack: https://canbari.com/share/direct/5d75b904-bc9a-4d54-b4ba-90b5e7d842af.mp4 Reported on Discord by **thebigchungoose** in #horizon-bugs · [Discord thread](https://discord.com/channels/1559227979002028052/1563860468504989787) Tags: rendering <sub>Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.</sub><!-- kira -->
bsakaguchi 2026-11-02 15:39:53 +07:00
Author
Owner

@Louistuis commented on GitHub (Oct 26, 2026):

🤖 Agent: Louis's AI agent (Claude Code), not Louis himself. Taking this one: comparing the turtle's leg animation with vanilla's TurtleModel.setupAnim and fixing what differs. PR to follow.

<!-- gh-comment-id:6426159246 --> @Louistuis commented on GitHub (Oct 26, 2026): 🤖 Agent: Louis's AI agent (Claude Code), not Louis himself. Taking this one: comparing the turtle's leg animation with vanilla's TurtleModel.setupAnim and fixing what differs. PR to follow.
Author
Owner

@Louistuis commented on GitHub (Oct 26, 2026):

🤖 Agent: Louis's AI agent (Claude Code), not Louis himself. Update: the fix is done and reviewed, PR coming shortly. Turtles used the default MoveControl, which walked them at about 3x vanilla's speed (about 9x the ground per tick), so the leg animation spun. This ports Turtle$TurtleMoveControl, with unit tests. It is complementary to #2520, which fixes step sound timing.

<!-- gh-comment-id:6428637625 --> @Louistuis commented on GitHub (Oct 26, 2026): 🤖 Agent: Louis's AI agent (Claude Code), not Louis himself. Update: the fix is done and reviewed, PR coming shortly. Turtles used the default MoveControl, which walked them at about 3x vanilla's speed (about 9x the ground per tick), so the leg animation spun. This ports Turtle$TurtleMoveControl, with unit tests. It is complementary to #2520, which fixes step sound timing.
Author
Owner

@kacpherek commented on GitHub (Oct 27, 2026):

This looks fixed by #2565 (turtles now walk at vanilla's own pace, so their feet stop flailing).

<!-- gh-comment-id:6434370707 --> @kacpherek commented on GitHub (Oct 27, 2026): This looks fixed by #2565 (turtles now walk at vanilla's own pace, so their feet stop flailing).
Author
Owner

@levzzz5154 commented on GitHub (Oct 27, 2026):

🤖 Agent: Checking the fix that is already on main for this report, since the issue was closed with the fix in place.

The fix is on main. Louis Nordbø's PR #2565 ("Walk turtles at their own pace so their feet stop flailing") is merged: b16ab9e8c Merge pull request #2565 from Louistuis/fix/turtle-feet, commit 5b5ebfcce3. It ports Turtle$TurtleMoveControl (TurtleMoveControl.updateSpeed and TurtleMoveControl.tick) into crates/horizon-client/src/mobs/turtle.rs and routes the turtle through it instead of the generic MoveControl.

What I verified on current main (commit d9b6483aa):

  1. cargo test --locked -p horizon-client --lib -- turtle → 5 passed; 0 failed (walks_on_land_at_a_third_of_its_movement_speed, water_speed_is_cut_away_from_home_and_for_babies, stops_when_the_path_is_done_or_the_point_reached, lifts_towards_a_point_above_by_the_slope_of_the_way_there, turns_at_most_ninety_degrees_a_tick_and_wraps_into_a_turn).
  2. python3 tools/test_entity_model_parity.py --filter turtle → 74 cases compared over 2 layers … entity model parity ok (the turtle's leg poses match vanilla's TurtleModel.setupAnim).
  3. The walk animation itself — the thing this report is about — now runs at vanilla's rate instead of being pinned at the maximum. Vanilla's arithmetic for a turtle walking on grass: TurtleMoveControl.updateSpeed puts the forward input at Mth.lerp(0.125F, 0.06, 0.25) = 0.08375; LivingEntity.getFrictionInfluencedSpeed(0.6) leaves it at 0.08375 (grass' friction is 0.6, not above it); Entity.moveRelative adds that to the motion; LivingEntity.travelInAir then scales the motion by friction * airDrag = 0.6 × 0.91 = 0.546, so the steady state is 0.08375 / (1 − 0.546) = 0.18447 blocks a tick. LivingEntity.updateWalkAnimation turns that into min(distance * 4.0F, 1.0F) = 0.73789 for walkAnimationSpeed, and TurtleModel.setupAnim swings the front legs by 8.0F * walkAnimationSpeed = 5.9°.
    Driving Horizon's own turtle::move_control, Mob::move_relative and Mob::update_walk_animation with that same movement arithmetic on current main measures 0.18447 blocks a tick and a limb speed of 0.73789 — the vanilla's numbers, to the digit. With the old generic MoveControl (the full movement speed 0.25) the same measurement gives 0.55066 blocks a tick and a limb speed of 1.0, i.e. min(distance * 4, 1) saturated: the legs swung at the maximum rate at the maximum amplitude while the turtle slid three times as fast (0.25 / 0.08375), which is the flailing in the video.

So the reported symptom is gone on main, and this issue can stay closed.

Vanilla reference (26.3): net.minecraft.world.entity.animal.turtle.Turtle$TurtleMoveControl.updateSpeed / .tick (the halved speed, the 0.06 floor, the Mth.lerp(0.125F, …) towards the movement speed), net.minecraft.world.entity.LivingEntity.updateWalkAnimation / .calculateEntityAnimation (min(distance * 4.0F, 1.0F), the 0.4 smoothing), net.minecraft.world.entity.LivingEntity.getFrictionInfluencedSpeed and .getSpeed, net.minecraft.world.entity.Entity.moveRelative and .getInputVector, net.minecraft.world.entity.LivingEntity.travelInAir (the friction * 0.91 air drag), and net.minecraft.client.model.animal.turtle.TurtleModel.setupAnim (the leg swing).

One thing this does not cover, in case it is worth a follow-up: Turtle.travelInWater is still not ported (the module comment in crates/horizon-client/src/mobs/turtle.rs says so), so a turtle in water still swims at the generic fluid travel speed, which is a different gap from the one reported here.

<!-- gh-comment-id:6439568888 --> @levzzz5154 commented on GitHub (Oct 27, 2026): 🤖 Agent: Checking the fix that is already on `main` for this report, since the issue was closed with the fix in place. **The fix is on `main`.** Louis Nordbø's PR #2565 ("Walk turtles at their own pace so their feet stop flailing") is merged: `b16ab9e8c Merge pull request #2565 from Louistuis/fix/turtle-feet`, commit `5b5ebfcce3`. It ports `Turtle$TurtleMoveControl` (`TurtleMoveControl.updateSpeed` and `TurtleMoveControl.tick`) into `crates/horizon-client/src/mobs/turtle.rs` and routes the turtle through it instead of the generic `MoveControl`. **What I verified on current `main` (commit `d9b6483aa`):** 1. `cargo test --locked -p horizon-client --lib -- turtle` → `5 passed; 0 failed` (`walks_on_land_at_a_third_of_its_movement_speed`, `water_speed_is_cut_away_from_home_and_for_babies`, `stops_when_the_path_is_done_or_the_point_reached`, `lifts_towards_a_point_above_by_the_slope_of_the_way_there`, `turns_at_most_ninety_degrees_a_tick_and_wraps_into_a_turn`). 2. `python3 tools/test_entity_model_parity.py --filter turtle` → `74 cases compared over 2 layers` … `entity model parity ok` (the turtle's leg poses match vanilla's `TurtleModel.setupAnim`). 3. The walk animation itself — the thing this report is about — now runs at vanilla's rate instead of being pinned at the maximum. Vanilla's arithmetic for a turtle walking on grass: `TurtleMoveControl.updateSpeed` puts the forward input at `Mth.lerp(0.125F, 0.06, 0.25)` = **0.08375**; `LivingEntity.getFrictionInfluencedSpeed(0.6)` leaves it at 0.08375 (grass' friction is 0.6, not above it); `Entity.moveRelative` adds that to the motion; `LivingEntity.travelInAir` then scales the motion by `friction * airDrag` = 0.6 × 0.91 = 0.546, so the steady state is 0.08375 / (1 − 0.546) = **0.18447 blocks a tick**. `LivingEntity.updateWalkAnimation` turns that into `min(distance * 4.0F, 1.0F)` = **0.73789** for `walkAnimationSpeed`, and `TurtleModel.setupAnim` swings the front legs by `8.0F * walkAnimationSpeed` = 5.9°. Driving Horizon's own `turtle::move_control`, `Mob::move_relative` and `Mob::update_walk_animation` with that same movement arithmetic on current `main` measures **0.18447 blocks a tick and a limb speed of 0.73789** — the vanilla's numbers, to the digit. With the old generic `MoveControl` (the full movement speed 0.25) the same measurement gives 0.55066 blocks a tick and a limb speed of **1.0**, i.e. `min(distance * 4, 1)` saturated: the legs swung at the maximum rate at the maximum amplitude while the turtle slid three times as fast (0.25 / 0.08375), which is the flailing in the video. So the reported symptom is gone on `main`, and this issue can stay closed. **Vanilla reference (26.3):** `net.minecraft.world.entity.animal.turtle.Turtle$TurtleMoveControl.updateSpeed` / `.tick` (the halved speed, the 0.06 floor, the `Mth.lerp(0.125F, …)` towards the movement speed), `net.minecraft.world.entity.LivingEntity.updateWalkAnimation` / `.calculateEntityAnimation` (`min(distance * 4.0F, 1.0F)`, the 0.4 smoothing), `net.minecraft.world.entity.LivingEntity.getFrictionInfluencedSpeed` and `.getSpeed`, `net.minecraft.world.entity.Entity.moveRelative` and `.getInputVector`, `net.minecraft.world.entity.LivingEntity.travelInAir` (the `friction * 0.91` air drag), and `net.minecraft.client.model.animal.turtle.TurtleModel.setupAnim` (the leg swing). One thing this does **not** cover, in case it is worth a follow-up: `Turtle.travelInWater` is still not ported (the module comment in `crates/horizon-client/src/mobs/turtle.rs` says so), so a turtle in water still swims at the generic fluid travel speed, which is a different gap from the one reported here.
Author
Owner

@levzzz5154 commented on GitHub (Oct 27, 2026):

🤖 Agent: Follow-up to the measurement above — it is now pinned by a test, so the rate cannot regress silently.

PR #2748 ("Pin the turtle's walk animation to vanilla's rate", https://github.com/ludovic111/horizon/pull/2748) is test-only. It adds mobs::turtle::tests::the_leg_animation_runs_at_vanilla_s_rate, which drives the turtle's own TurtleMoveControl, Mob::move_relative and Mob::update_walk_animation over the vanilla's ground movement and asserts the numbers vanilla produces:

  • 0.18447 blocks a tick — the steady state of the forward input 0.08375 under the friction 0.6 times the air drag 0.91 (LivingEntity.travelInAir): 0.08375 / (1 − 0.546).
  • a walk animation speed of 0.73789 — LivingEntity.updateWalkAnimation's min(distance * 4, 1) for that distance, which is what TurtleModel.setupAnim swings the legs by (8° × 0.73789 for the front legs, 3° × 0.73789 for the hind ones).

The old generic MoveControl gave 0.55066 blocks a tick and a saturated 1.0, which is the flailing in the video; with the turtle's own pace the animation runs at vanilla's rate. The test fails if the turtle's pace goes back to the generic one (checked by reverting setSpeed(Mth.lerp(0.125F, ...)) to setSpeed(wanted)).

Self-check: cargo test --locked -p horizon-client --lib -- turtle → 6 passed; python3 tools/test_entity_model_parity.py --filter turtle → 74 cases compared over 2 layers … entity model parity ok; cargo fmt -p horizon-client → no changes.

Fixes #1776

<!-- gh-comment-id:6439927509 --> @levzzz5154 commented on GitHub (Oct 27, 2026): 🤖 Agent: Follow-up to the measurement above — it is now pinned by a test, so the rate cannot regress silently. **PR #2748** ("Pin the turtle's walk animation to vanilla's rate", https://github.com/ludovic111/horizon/pull/2748) is test-only. It adds `mobs::turtle::tests::the_leg_animation_runs_at_vanilla_s_rate`, which drives the turtle's own `TurtleMoveControl`, `Mob::move_relative` and `Mob::update_walk_animation` over the vanilla's ground movement and asserts the numbers vanilla produces: - **0.18447 blocks a tick** — the steady state of the forward input 0.08375 under the friction 0.6 times the air drag 0.91 (`LivingEntity.travelInAir`): 0.08375 / (1 − 0.546). - **a walk animation speed of 0.73789** — `LivingEntity.updateWalkAnimation`'s `min(distance * 4, 1)` for that distance, which is what `TurtleModel.setupAnim` swings the legs by (8° × 0.73789 for the front legs, 3° × 0.73789 for the hind ones). The old generic `MoveControl` gave **0.55066 blocks a tick and a saturated 1.0**, which is the flailing in the video; with the turtle's own pace the animation runs at vanilla's rate. The test fails if the turtle's pace goes back to the generic one (checked by reverting `setSpeed(Mth.lerp(0.125F, ...))` to `setSpeed(wanted)`). Self-check: `cargo test --locked -p horizon-client --lib -- turtle` → 6 passed; `python3 tools/test_entity_model_parity.py --filter turtle` → `74 cases compared over 2 layers` … `entity model parity ok`; `cargo fmt -p horizon-client` → no changes. Fixes #1776
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#542
No description provided.