[PR #285] [MERGED] Striders stand on lava instead of bobbing in it #2458

Closed
opened 2026-11-02 15:56:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/285
Author: @ludovic111
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @ludovic111

Base: main ← Head: fix/strider-lava


📝 Commits (1)

  • 8cd9733 Striders stand on lava instead of bobbing in it (#256)

📊 Changes

9 files changed (+310 additions, -33 deletions)

View changed files

📝 crates/horizon-client/src/collisions.rs (+39 -10)
📝 crates/horizon-client/src/mobs.rs (+9 -1)
📝 crates/horizon-client/src/mobs/ai.rs (+14 -0)
📝 crates/horizon-client/src/mobs/goals.rs (+12 -1)
📝 crates/horizon-client/src/mobs/living.rs (+51 -21)
📝 crates/horizon-client/src/mobs/nav.rs (+4 -0)
➕ crates/horizon-client/src/mobs/strider.rs (+170 -0)
📝 crates/horizon-client/src/motion.rs (+1 -0)
📝 tools/test_mob_ai_parity.py (+10 -0)

📄 Description

Fixes #256.

What

Striders had no AI of their own: they fell into Horizon's generic fallback, whose FloatGoal jumped them up and down in lava. This ports vanilla 26.3 Strider:

  • goals as Strider.registerGoals (no FloatGoal; PanicGoal 1.65, BreedGoal, TemptGoal 1.4, StriderGoToLavaGoal, FollowParentGoal, RandomStrollGoal(1.0, 60), LookAtPlayerGoal for players and for striders), and the path maluses
  • floatStrider after the living tick; standing on lava sources through the living collision context with getLiquidCollisionShape (Block.column(16, 0, 8)) and canStandOnFluid(lava) (the collision crates already had LiquidCollision; mobs never passed a context that could use it)
  • shouldTravelInFluid against the fluid at the strider's feet, StriderPathNavigation.isStableDestination (lava), getWalkTargetValue
  • going cold away from strider_warm_blocks/lava/a warm strider vehicle: the suffocating speed modifier (-0.34, ADD_MULTIPLIED_BASE) and the cold texture the renderer already had
  • happy/retreat sounds, no ambient sound while panicking or tempted, steps every 0.6, checkFallDamage skipped in lava

Shared, small: mobs keep Entity.mainSupportingBlockPos from their last move (read by getBlockStateOnLegacy, as vanilla does instead of recomputing), LookAtPlayer::species for LookAtPlayerGoal(this, Strider.class, 8).

Proof

Mob AI parity harness, five new strider scenarios (on a lava pool alone and with a player, walking from cold grass to lava, cold on grass, tempted with warped fungus):

scenarios mob-ticks before first divergence
origin/main 0/5 5/1105
this PR 5/5 1105/1105

Self-check

  • cargo fmt --all --check: clean
  • cargo clippy -p horizon-client --all-targets -- -D warnings: clean
  • cargo test -p horizon-client --lib: 596 passed
  • tools/test_mob_ai_parity.py (full): 105/105 scenarios, 35433/35433 mob-ticks. One earlier run via tools/parity.py showed drowned_pool off by one random draw at tick 1; it passes alone and in the full rerun, so it looks like an ordering flake, not this change.
  • tools/parity.py: entity_collision, liquid_collision, movement_emission, movement_support PASS
  • In game: screenshots follow in a comment (Mac mini, built from the top of the stack).

Needs Ludovic

Nothing.

🤖 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/285 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/strider-lava` --- ### 📝 Commits (1) - [`8cd9733`](https://github.com/horizon-rust/horizon/commit/8cd97334bf4ab64a6726d2c8b33892117016ae3b) Striders stand on lava instead of bobbing in it (#256) ### 📊 Changes **9 files changed** (+310 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/collisions.rs` (+39 -10) 📝 `crates/horizon-client/src/mobs.rs` (+9 -1) 📝 `crates/horizon-client/src/mobs/ai.rs` (+14 -0) 📝 `crates/horizon-client/src/mobs/goals.rs` (+12 -1) 📝 `crates/horizon-client/src/mobs/living.rs` (+51 -21) 📝 `crates/horizon-client/src/mobs/nav.rs` (+4 -0) ➕ `crates/horizon-client/src/mobs/strider.rs` (+170 -0) 📝 `crates/horizon-client/src/motion.rs` (+1 -0) 📝 `tools/test_mob_ai_parity.py` (+10 -0) </details> ### 📄 Description Fixes #256. ## What Striders had no AI of their own: they fell into Horizon's generic fallback, whose `FloatGoal` jumped them up and down in lava. This ports vanilla 26.3 `Strider`: - goals as `Strider.registerGoals` (no `FloatGoal`; `PanicGoal 1.65`, `BreedGoal`, `TemptGoal 1.4`, `StriderGoToLavaGoal`, `FollowParentGoal`, `RandomStrollGoal(1.0, 60)`, `LookAtPlayerGoal` for players and for striders), and the path maluses - `floatStrider` after the living tick; standing on lava *sources* through the living collision context with `getLiquidCollisionShape` (`Block.column(16, 0, 8)`) and `canStandOnFluid(lava)` (the collision crates already had `LiquidCollision`; mobs never passed a context that could use it) - `shouldTravelInFluid` against the fluid at the strider's feet, `StriderPathNavigation.isStableDestination` (lava), `getWalkTargetValue` - going cold away from `strider_warm_blocks`/lava/a warm strider vehicle: the suffocating speed modifier (`-0.34`, `ADD_MULTIPLIED_BASE`) and the cold texture the renderer already had - happy/retreat sounds, no ambient sound while panicking or tempted, steps every 0.6, `checkFallDamage` skipped in lava Shared, small: mobs keep `Entity.mainSupportingBlockPos` from their last move (read by `getBlockStateOnLegacy`, as vanilla does instead of recomputing), `LookAtPlayer::species` for `LookAtPlayerGoal(this, Strider.class, 8)`. ## Proof Mob AI parity harness, five new strider scenarios (on a lava pool alone and with a player, walking from cold grass to lava, cold on grass, tempted with warped fungus): | | scenarios | mob-ticks before first divergence | |---|---|---| | origin/main | 0/5 | 5/1105 | | this PR | **5/5** | **1105/1105** | ## Self-check - `cargo fmt --all --check`: clean - `cargo clippy -p horizon-client --all-targets -- -D warnings`: clean - `cargo test -p horizon-client --lib`: 596 passed - `tools/test_mob_ai_parity.py` (full): **105/105 scenarios, 35433/35433 mob-ticks**. One earlier run via `tools/parity.py` showed `drowned_pool` off by one random draw at tick 1; it passes alone and in the full rerun, so it looks like an ordering flake, not this change. - `tools/parity.py`: entity_collision, liquid_collision, movement_emission, movement_support PASS - In game: screenshots follow in a comment (Mac mini, built from the top of the stack). ## Needs Ludovic Nothing. 🤖 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-02 15:56:20 +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#2458
No description provided.