[PR #3773] [MERGED] Cat: the avoidance goal comes last, and a dashing cat sprints #5208

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

📋 Pull Request Information

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

Base: main ← Head: fix/cat-goals


📝 Commits (5)

  • 7703ebc Cat: avoidance goal last, sprint while dashing
  • 3c8a73f Merge remote-tracking branch 'origin/main' into upd-3773
  • 1c16f98 Merge origin/main into fix/cat-goals: the sprint now comes from main
  • 11159a1 Merge fork/fix/cat-goals (maintainer's merge of main)
  • 5f5d043 Merge remote-tracking branch 'origin/main' into fix/cat-goals

📊 Changes

3 files changed (+12 additions, -5 deletions)

View changed files

📝 crates/horizon-client/examples/probe/mob_ai_probe.rs (+2 -0)
📝 crates/horizon-client/src/mobs/tame.rs (+7 -5)
📝 tools/test_mob_ai_parity.py (+3 -0)

📄 Description

🤖 Opened by Federico's AI agent (Claude), not by Federico himself.

Fixes #3772. Checked: no open PR touches the cat's goals or sprint (#3336 is about ocelots and rabbits).

What and why

  • Cat.reassessTameGoals adds CatAvoidEntityGoal<Player> after registerGoals; goals run in insertion order, so it is evaluated last. Horizon registered it in the middle, so the stroll and look goals drew their intervals after it (or not at all) and the random stream drifted from vanilla's on the first tick.
  • Cat.customServerAiStep sets sprinting while the speed modifier is 1.33 (the dash away from a player): +30% movement speed, and Entity.baseTick's spawnSprintParticle draws twice from the mob's random.

Change

  • mobs/tame.rs register_cat: the avoidance goal last.
  • mobs/ai.rs: custom_server_ai_step sets extra.sprinting for a cat, speed_bonus gives the +30%, base_tick draws the two sprint-dust doubles.
  • examples/probe/mob_ai_probe.rs: the goal is named CatAvoidEntityGoal, as vanilla's subclass.
  • tools/test_mob_ai_parity.py: cat_player (a cat and a player 6 blocks away, 120 ticks).

Vanilla reference

Cat.reassessTameGoals, Cat.registerGoals, Cat.customServerAiStep, GoalSelector.tick (insertion order), Entity.baseTick / spawnSprintParticle, LivingEntity.setSprinting.

Testing

Before: cat_player diverges at tick 1 (vanilla draws 41 times, Horizon 43). After: 1/1, 121/121 mob-ticks. python3 tools/parity.py --fresh mob_ai: pass.

pr_ready --quick results follow in a comment.

🤖 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/3773 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/cat-goals` --- ### 📝 Commits (5) - [`7703ebc`](https://github.com/horizon-rust/horizon/commit/7703ebcf95d2a4abe2efebd6bd8e1b9e7c5a32a4) Cat: avoidance goal last, sprint while dashing - [`3c8a73f`](https://github.com/horizon-rust/horizon/commit/3c8a73f86fe285ad0ba436129c04dd4ff03d6e11) Merge remote-tracking branch 'origin/main' into upd-3773 - [`1c16f98`](https://github.com/horizon-rust/horizon/commit/1c16f980981a717376a8d5f9ce0f68de62eca570) Merge origin/main into fix/cat-goals: the sprint now comes from main - [`11159a1`](https://github.com/horizon-rust/horizon/commit/11159a1ed56b1a32d3d9330b38e5850e67843153) Merge fork/fix/cat-goals (maintainer's merge of main) - [`5f5d043`](https://github.com/horizon-rust/horizon/commit/5f5d0434cbd07d0232e2497b64c44b7d694ae3f6) Merge remote-tracking branch 'origin/main' into fix/cat-goals ### 📊 Changes **3 files changed** (+12 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/mob_ai_probe.rs` (+2 -0) 📝 `crates/horizon-client/src/mobs/tame.rs` (+7 -5) 📝 `tools/test_mob_ai_parity.py` (+3 -0) </details> ### 📄 Description > 🤖 Opened by Federico's AI agent (Claude), not by Federico himself. Fixes #3772. Checked: no open PR touches the cat's goals or sprint (#3336 is about ocelots and rabbits). ## What and why - `Cat.reassessTameGoals` adds `CatAvoidEntityGoal<Player>` after `registerGoals`; goals run in insertion order, so it is evaluated last. Horizon registered it in the middle, so the stroll and look goals drew their intervals after it (or not at all) and the random stream drifted from vanilla's on the first tick. - `Cat.customServerAiStep` sets sprinting while the speed modifier is 1.33 (the dash away from a player): +30% movement speed, and `Entity.baseTick`'s `spawnSprintParticle` draws twice from the mob's random. ## Change - `mobs/tame.rs` `register_cat`: the avoidance goal last. - `mobs/ai.rs`: `custom_server_ai_step` sets `extra.sprinting` for a cat, `speed_bonus` gives the +30%, `base_tick` draws the two sprint-dust doubles. - `examples/probe/mob_ai_probe.rs`: the goal is named `CatAvoidEntityGoal`, as vanilla's subclass. - `tools/test_mob_ai_parity.py`: `cat_player` (a cat and a player 6 blocks away, 120 ticks). ## Vanilla reference `Cat.reassessTameGoals`, `Cat.registerGoals`, `Cat.customServerAiStep`, `GoalSelector.tick` (insertion order), `Entity.baseTick` / `spawnSprintParticle`, `LivingEntity.setSprinting`. ## Testing Before: `cat_player` diverges at tick 1 (vanilla draws 41 times, Horizon 43). After: `1/1`, `121/121` mob-ticks. `python3 tools/parity.py --fresh mob_ai`: pass. `pr_ready --quick` results follow in a comment. 🤖 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:10:58 +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#5208
No description provided.