[PR #7370] [CLOSED] Port map: trimPath and getPosTowards are ported #7559

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7370
Author: @MSedgeMC
Created: 11/2/2026
Status: ❌ Closed

Base: main ← Head: chore/stale1-game-010


📝 Commits (1)

  • bc5d6ea Port map: the sun-trimmed path and the golem's way toward a spot are ported

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 tools/port_map/game-010.tsv (+2 -2)

📄 Description

Two rows of tools/port_map/game-010.tsv had missing in the verdict cell while the behaviour runs in the tree, and both notes described a gap that is closed.

row before now cites
20 GroundPathNavigation.trimPath missing — "avoid_sun is set by the skeleton's RestrictSun goal but nothing truncates the path at the first sunlit node" crates/horizon-client/src/mobs/nav.rs::Mob::trim_path — with avoid_sun set on a ground or wall-climber nav, a mob the sky does not see keeps only the nodes before the first one it does; the nav tick calls it after every recomputed path
71 LandRandomPos.getPosTowards missing — "iron golems wander anywhere; GolemRandomStrollInVillageGoal and MoveBackToVillageGoal are not registered" crates/horizon-client/src/mobs/goals.rs::Mob::land_random_pos_towards — the best of ten spots within a quarter turn of the way to the target, through getPosInDirection; the golem's village stroll and its way back to the village both call it

Validation, against a build of upstream/main (62d8b5828) with both 26.3 jars in /tmp/led-stale1:

$ PORT_LEDGER_OUT=/tmp/led-stale1 python3 tools/port_ledger.py map-check tools/port_map/game-010.tsv
131 rows, no problems.

Proven: vanilla GroundPathNavigation.trimPath (:111) returns when the mob itself sees the sky, otherwise truncates the path at the first node that does; Mob::trim_path is that under the extra NavKind::Ground | NavKind::WallClimber guard that stands for the class being the ground navigator, RestrictSun sets the flag in can_use and clears it in stop (mobs/goals.rs:2470), and the nav tick calls trim_path after a successful recompute (mobs/nav.rs:339). Vanilla LandRandomPos.getPosTowards (:26) takes the direction to the target and calls getPosInDirection(mob, 0.0, horizontalDist, verticalDist, dir, restrict), which is land_pos_in_direction down to the ten tries and the quarter-turn radians; golem.rs registers both MoveBackToVillageGoal (:38) and GolemRandomStrollInVillageGoal (:45), and its towards_villager_who_wants_golem, towards_poi and back_to_village_position all reach the fn.

Not proven: that the trimmed path and the golem's picks match vanilla tick for tick — no parity test covers either; the restrict flag vanilla computes once from GoalUtils.mobRestricted is recomputed per candidate position here, which is the same test at the distance it is asked about but was read, not run.


🔄 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/7370 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `chore/stale1-game-010` --- ### 📝 Commits (1) - [`bc5d6ea`](https://github.com/horizon-rust/horizon/commit/bc5d6eab34730aeeb3abc144d7157cd00c5c87e9) Port map: the sun-trimmed path and the golem's way toward a spot are ported ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_map/game-010.tsv` (+2 -2) </details> ### 📄 Description Two rows of `tools/port_map/game-010.tsv` had `missing` in the verdict cell while the behaviour runs in the tree, and both notes described a gap that is closed. | row | before | now cites | | --- | --- | --- | | 20 `GroundPathNavigation.trimPath` | `missing` — "avoid_sun is set by the skeleton's RestrictSun goal but nothing truncates the path at the first sunlit node" | `crates/horizon-client/src/mobs/nav.rs::Mob::trim_path` — with `avoid_sun` set on a ground or wall-climber nav, a mob the sky does not see keeps only the nodes before the first one it does; the nav tick calls it after every recomputed path | | 71 `LandRandomPos.getPosTowards` | `missing` — "iron golems wander anywhere; GolemRandomStrollInVillageGoal and MoveBackToVillageGoal are not registered" | `crates/horizon-client/src/mobs/goals.rs::Mob::land_random_pos_towards` — the best of ten spots within a quarter turn of the way to the target, through `getPosInDirection`; the golem's village stroll and its way back to the village both call it | Validation, against a build of `upstream/main` (62d8b5828) with both 26.3 jars in `/tmp/led-stale1`: ``` $ PORT_LEDGER_OUT=/tmp/led-stale1 python3 tools/port_ledger.py map-check tools/port_map/game-010.tsv 131 rows, no problems. ``` **Proven:** vanilla `GroundPathNavigation.trimPath` (`:111`) returns when the mob itself sees the sky, otherwise truncates the path at the first node that does; `Mob::trim_path` is that under the extra `NavKind::Ground | NavKind::WallClimber` guard that stands for the class being the ground navigator, `RestrictSun` sets the flag in `can_use` and clears it in `stop` (`mobs/goals.rs:2470`), and the nav tick calls `trim_path` after a successful recompute (`mobs/nav.rs:339`). Vanilla `LandRandomPos.getPosTowards` (`:26`) takes the direction to the target and calls `getPosInDirection(mob, 0.0, horizontalDist, verticalDist, dir, restrict)`, which is `land_pos_in_direction` down to the ten tries and the quarter-turn radians; `golem.rs` registers both `MoveBackToVillageGoal` (`:38`) and `GolemRandomStrollInVillageGoal` (`:45`), and its `towards_villager_who_wants_golem`, `towards_poi` and `back_to_village_position` all reach the fn. **Not proven:** that the trimmed path and the golem's picks match vanilla tick for tick — no parity test covers either; the `restrict` flag vanilla computes once from `GoalUtils.mobRestricted` is recomputed per candidate position here, which is the same test at the distance it is asked about but was read, not run. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 07:19:47 +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#7559
No description provided.