[PR #3791] [MERGED] Ghast: target position, move control timing, look angle and shot sounds as vanilla #5216

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

📋 Pull Request Information

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

Base: main ← Head: fix/flyers-scan


📝 Commits (2)

  • 6180a78 Ghast: target position, move control timing, look angle and shot sounds as vanilla
  • 173e278 Merge main into fix/flyers-scan (resolve tools/test_mob_ai_parity.py)

📊 Changes

3 files changed (+37 additions, -24 deletions)

View changed files

📝 crates/horizon-client/examples/probe/mob_ai_probe.rs (+3 -0)
📝 crates/horizon-client/src/mobs/nether.rs (+32 -24)
📝 tools/test_mob_ai_parity.py (+2 -0)

📄 Description

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

Fixes #3790. Checked: no open PR touches the ghast's goals or move control (the happy ghast PRs are another mob).

What and why

Four differences from vanilla's ghast (details in the issue): the mirrored fly-to height, the move control firing a tick early, the yaw rounding, and the shot sounds drawing the pitch from the ghast's own random (vanilla sends level events 1015 and 1016; the pitch is the client's).

Change

mobs/nether.rs: RandomFloatAround::start takes the first random position; ghast_move_control tests before decrementing; GhastLook uses trig::atan2 and the float 180 / PI; the warning and shot are MobEvent::LevelEventSound (not when silent). examples/probe/mob_ai_probe.rs: the goals' vanilla names. tools/test_mob_ai_parity.py: ghast_player (120 ticks, a player 7 blocks away; the ghast shoots).

Vanilla reference

Ghast.RandomFloatAroundGoal.getSuitableFlyToPosition, Ghast.GhastMoveControl.tick, Ghast.GhastLookGoal.tick, Ghast.GhastShootFireballGoal.tick (Level.levelEvent 1015 and 1016).

Testing

Before: ghast_player diverges at tick 1. After: 2/2, 322/322 mob-ticks. python3 tools/parity.py --fresh mob_ai: pass.

Not covered: a ghast with a home (chooseRandomPositionWithRestriction) and the careful move control variant.

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/3791 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/flyers-scan` --- ### 📝 Commits (2) - [`6180a78`](https://github.com/horizon-rust/horizon/commit/6180a78195fdb3322ea5056d44202fc26bd1b538) Ghast: target position, move control timing, look angle and shot sounds as vanilla - [`173e278`](https://github.com/horizon-rust/horizon/commit/173e2782066a5de93591da4d3858b06b9d8a1a03) Merge main into fix/flyers-scan (resolve tools/test_mob_ai_parity.py) ### 📊 Changes **3 files changed** (+37 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/mob_ai_probe.rs` (+3 -0) 📝 `crates/horizon-client/src/mobs/nether.rs` (+32 -24) 📝 `tools/test_mob_ai_parity.py` (+2 -0) </details> ### 📄 Description > 🤖 Opened by Federico's AI agent (Claude), not by Federico himself. Fixes #3790. Checked: no open PR touches the ghast's goals or move control (the happy ghast PRs are another mob). ## What and why Four differences from vanilla's ghast (details in the issue): the mirrored fly-to height, the move control firing a tick early, the yaw rounding, and the shot sounds drawing the pitch from the ghast's own random (vanilla sends level events 1015 and 1016; the pitch is the client's). ## Change `mobs/nether.rs`: `RandomFloatAround::start` takes the first random position; `ghast_move_control` tests before decrementing; `GhastLook` uses `trig::atan2` and the float `180 / PI`; the warning and shot are `MobEvent::LevelEventSound` (not when silent). `examples/probe/mob_ai_probe.rs`: the goals' vanilla names. `tools/test_mob_ai_parity.py`: `ghast_player` (120 ticks, a player 7 blocks away; the ghast shoots). ## Vanilla reference `Ghast.RandomFloatAroundGoal.getSuitableFlyToPosition`, `Ghast.GhastMoveControl.tick`, `Ghast.GhastLookGoal.tick`, `Ghast.GhastShootFireballGoal.tick` (`Level.levelEvent` 1015 and 1016). ## Testing Before: `ghast_player` diverges at tick 1. After: `2/2`, `322/322` mob-ticks. `python3 tools/parity.py --fresh mob_ai`: pass. Not covered: a ghast with a home (`chooseRandomPositionWithRestriction`) and the careful move control variant. `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:11:02 +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#5216
No description provided.