[PR #4492] [MERGED] Dolphins swim after the boat or nautilus a player steers (FollowPlayerRiddenEntityGoal) #5654

Closed
opened 2026-11-03 05:14:05 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4492
Author: @xFedeT
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/dolphin-follow-ridden


📝 Commits (1)

  • 511b974 Dolphins swim after the boat or nautilus a player steers (FollowPlayerRiddenEntityGoal)

📊 Changes

10 files changed (+247 additions, -2 deletions)

View changed files

📝 crates/horizon-client/examples/probe/mob_ai_probe.rs (+30 -0)
📝 crates/horizon-client/src/game/creatures.rs (+22 -0)
📝 crates/horizon-client/src/game/lan_mobs.rs (+1 -0)
📝 crates/horizon-client/src/mobs.rs (+11 -0)
📝 crates/horizon-client/src/mobs/aquatic.rs (+2 -0)
📝 crates/horizon-client/src/mobs/dolphin.rs (+136 -0)
📝 crates/horizon-client/src/mobs/living.rs (+6 -0)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaMobAiOracle.java (+31 -1)
📝 tools/port_map/game-009.tsv (+1 -1)
📝 tools/test_mob_ai_parity.py (+7 -0)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally.

Refs #3521

What and why

Dolphin.registerGoals has two FollowPlayerRiddenEntityGoals at priority 8, for AbstractBoat and AbstractNautilus: a dolphin within 5 blocks of a boat or nautilus that a player steers, while it moves, swims to the block behind the player (one lower), then 10 blocks ahead in the direction the player faces, and goes back when more than 12 blocks away; each tick it also adds the small moveRelative push and moves. Horizon's dolphin had none of this.

New FollowPlayerRidden goal (mobs/dolphin.rs), two instances in the dolphin's registration. PlayerView gets vehicle (the boat or nautilus the player rides: its box and the speed it moved), filled by the game for the host's boat or nautilus. Only the player the mob sees (the nearest) is considered, not every player in the level. Mob::move_relative now adds its zero vector like vanilla's getInputVector does, so a -0.0 motion becomes 0.0.

Proof against vanilla's Java

The real FollowPlayerRiddenEntityGoal runs in the mob_ai oracle: it now takes player X Y Z boat=vx,vz (an OAK_BOAT that does not tick, moved by the script, the player riding it with the speed Entity.computeSpeed gives), and the probe feeds Horizon's goal the same boat. python3 tools/test_mob_ai_parity.py --only dolphin_boat: dolphins in a pool with the boat paddled along x, along z and the other way, and one 40 blocks off: 4/4 scenarios, 884/884 mob-ticks identical (position, motion, running goals, look control, path, every random draw). The whole harness still matches: 213/213 scenarios, 61998/61998 mob-ticks (the move_relative change touches every mob).

The parity run found two mistakes of the first version, fixed here: the goal updated every tick (vanilla's does not override requiresUpdateEveryTick) and the goal list showed another name.

An in-game check was not added: dolphins swim at random, so a pool run cannot tell a following dolphin from a lucky one; the oracle can.

pr_ready --quick: fmt, clippy, 1064 tests and 481 python tests pass.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4492 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/dolphin-follow-ridden` --- ### 📝 Commits (1) - [`511b974`](https://github.com/horizon-rust/horizon/commit/511b974107eaa265e90f57d4fb2d5c155f557e55) Dolphins swim after the boat or nautilus a player steers (FollowPlayerRiddenEntityGoal) ### 📊 Changes **10 files changed** (+247 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/mob_ai_probe.rs` (+30 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+22 -0) 📝 `crates/horizon-client/src/game/lan_mobs.rs` (+1 -0) 📝 `crates/horizon-client/src/mobs.rs` (+11 -0) 📝 `crates/horizon-client/src/mobs/aquatic.rs` (+2 -0) 📝 `crates/horizon-client/src/mobs/dolphin.rs` (+136 -0) 📝 `crates/horizon-client/src/mobs/living.rs` (+6 -0) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaMobAiOracle.java` (+31 -1) 📝 `tools/port_map/game-009.tsv` (+1 -1) 📝 `tools/test_mob_ai_parity.py` (+7 -0) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally. Refs #3521 ## What and why `Dolphin.registerGoals` has two `FollowPlayerRiddenEntityGoal`s at priority 8, for `AbstractBoat` and `AbstractNautilus`: a dolphin within 5 blocks of a boat or nautilus that a player steers, while it moves, swims to the block behind the player (one lower), then 10 blocks ahead in the direction the player faces, and goes back when more than 12 blocks away; each tick it also adds the small `moveRelative` push and moves. Horizon's dolphin had none of this. New `FollowPlayerRidden` goal (`mobs/dolphin.rs`), two instances in the dolphin's registration. `PlayerView` gets `vehicle` (the boat or nautilus the player rides: its box and the speed it moved), filled by the game for the host's boat or nautilus. Only the player the mob sees (the nearest) is considered, not every player in the level. `Mob::move_relative` now adds its zero vector like vanilla's `getInputVector` does, so a `-0.0` motion becomes `0.0`. ## Proof against vanilla's Java The real `FollowPlayerRiddenEntityGoal` runs in the `mob_ai` oracle: it now takes `player X Y Z boat=vx,vz` (an `OAK_BOAT` that does not tick, moved by the script, the player riding it with the speed `Entity.computeSpeed` gives), and the probe feeds Horizon's goal the same boat. `python3 tools/test_mob_ai_parity.py --only dolphin_boat`: dolphins in a pool with the boat paddled along x, along z and the other way, and one 40 blocks off: **4/4 scenarios, 884/884 mob-ticks identical** (position, motion, running goals, look control, path, every random draw). The whole harness still matches: 213/213 scenarios, 61998/61998 mob-ticks (the `move_relative` change touches every mob). The parity run found two mistakes of the first version, fixed here: the goal updated every tick (vanilla's does not override `requiresUpdateEveryTick`) and the goal list showed another name. An in-game check was not added: dolphins swim at random, so a pool run cannot tell a following dolphin from a lucky one; the oracle can. `pr_ready --quick`: fmt, clippy, 1064 tests and 481 python tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:05 +07:00
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#5654
No description provided.