fix: NPC strand recovery, nav reroute storm, and the Al Kharid toll gate #184

Merged
sickday merged 1 commit from fix/nav-storm-npc-strand-tollgate into main 2026-07-20 16:35:58 +00:00
Owner

Closes #174, #175.

NPC return-home (#175)

An NPC lured off its spawn and abandoned could sit as furniture forever.
maybe_return_home/1 is a greedy line-step: a wall leaves it standing with
no waypoints, so active_tick?/1 is false and the NPC sleeps after five idle
ticks. Sleep then starves the only recovery there is, since a sleeping NPC
gets no :pulse_tick_movement and never advances wander_counter toward the
snap-home. Its wake poll only fires for a real player in range and grants
five ticks a visit, so the 500-tick timeout needed ~100 separate visits.

Both idle polls now wake a displaced NPC, and a displaced one uses a much
shorter snap-home limit (50 ticks) than the wandering drift timeout. The
wake deliberately lives in the polls rather than in active_tick?/1:
walk_range defaults to 0, so every stationary NPC off its spawn tile reads
as displaced and gating sleep on that would hold much of the NPC population
awake. Relocating NPCs are exempt from both return-home paths — maybe_relocate/1
moves tile without moving spawn_tile, so a hopped fishing spot would
otherwise be dragged back to the slot it just left.

Bot navigation (#174)

The reroute tier rebuilt its waypoints with the collision-blind
generate_waypoints/2. A bot only reaches that tier because something blocked
it, so the straight line aimed the replacement waypoints back through the
very obstacle that caused the stuck; every reroute reproduced the block and
the budget drained into recover_to_hub, which teleported the bot onto the
identical route. Now routes through build_route/2, and the per-reroute log
drops to debug.

Al Kharid toll gate

Both halves of the crossing were stubs returning false, so the gate charged
nothing and was an unbroken wall to every router — the wall the fleets were
grinding against. TollGate is now real, from the 468 landscape: leaves 2882
@{3268,3227,0} and 2883 @{3268,3228,0}, solid, on the west edge of x=3268.

Collision is deliberately untouched. Clearing the wall would open the border
for everyone, bots included, and let A* route through a gate the walker
cannot open; a payer instead crosses under a short noclip window. "Open"
now reaches the Border Guard (925), who asks for the toll in dialogue, and
both routes share TollGate.pay_and_cross/2.

GatePassage drives the same sequence for bots through its three phases,
paying via the human click path so bots get no discount. A bot that cannot
pay fails out to the runner's backoff instead of retrying the border.

Closes #174, #175. NPC return-home (#175) ---------------------- An NPC lured off its spawn and abandoned could sit as furniture forever. maybe_return_home/1 is a greedy line-step: a wall leaves it standing with no waypoints, so active_tick?/1 is false and the NPC sleeps after five idle ticks. Sleep then starves the only recovery there is, since a sleeping NPC gets no :pulse_tick_movement and never advances wander_counter toward the snap-home. Its wake poll only fires for a real player in range and grants five ticks a visit, so the 500-tick timeout needed ~100 separate visits. Both idle polls now wake a displaced NPC, and a displaced one uses a much shorter snap-home limit (50 ticks) than the wandering drift timeout. The wake deliberately lives in the polls rather than in active_tick?/1: walk_range defaults to 0, so every stationary NPC off its spawn tile reads as displaced and gating sleep on that would hold much of the NPC population awake. Relocating NPCs are exempt from both return-home paths — maybe_relocate/1 moves tile without moving spawn_tile, so a hopped fishing spot would otherwise be dragged back to the slot it just left. Bot navigation (#174) --------------------- The reroute tier rebuilt its waypoints with the collision-blind generate_waypoints/2. A bot only reaches that tier because something blocked it, so the straight line aimed the replacement waypoints back through the very obstacle that caused the stuck; every reroute reproduced the block and the budget drained into recover_to_hub, which teleported the bot onto the identical route. Now routes through build_route/2, and the per-reroute log drops to debug. Al Kharid toll gate ------------------- Both halves of the crossing were stubs returning false, so the gate charged nothing and was an unbroken wall to every router — the wall the fleets were grinding against. TollGate is now real, from the 468 landscape: leaves 2882 @{3268,3227,0} and 2883 @{3268,3228,0}, solid, on the west edge of x=3268. Collision is deliberately untouched. Clearing the wall would open the border for everyone, bots included, and let A* route through a gate the walker cannot open; a payer instead crosses under a short noclip window. "Open" now reaches the Border Guard (925), who asks for the toll in dialogue, and both routes share TollGate.pay_and_cross/2. GatePassage drives the same sequence for bots through its three phases, paying via the human click path so bots get no discount. A bot that cannot pay fails out to the runner's backoff instead of retrying the border.
fix: NPC strand recovery, nav reroute storm, and the Al Kharid toll gate
All checks were successful
ci / test (pull_request) Successful in 2m34s
066c3ff7cd
Closes #174, #175.

NPC return-home (#175)
----------------------
An NPC lured off its spawn and abandoned could sit as furniture forever.
maybe_return_home/1 is a greedy line-step: a wall leaves it standing with
no waypoints, so active_tick?/1 is false and the NPC sleeps after five idle
ticks. Sleep then starves the only recovery there is, since a sleeping NPC
gets no :pulse_tick_movement and never advances wander_counter toward the
snap-home. Its wake poll only fires for a real player in range and grants
five ticks a visit, so the 500-tick timeout needed ~100 separate visits.

Both idle polls now wake a displaced NPC, and a displaced one uses a much
shorter snap-home limit (50 ticks) than the wandering drift timeout. The
wake deliberately lives in the polls rather than in active_tick?/1:
walk_range defaults to 0, so every stationary NPC off its spawn tile reads
as displaced and gating sleep on that would hold much of the NPC population
awake. Relocating NPCs are exempt from both return-home paths — maybe_relocate/1
moves tile without moving spawn_tile, so a hopped fishing spot would
otherwise be dragged back to the slot it just left.

Bot navigation (#174)
---------------------
The reroute tier rebuilt its waypoints with the collision-blind
generate_waypoints/2. A bot only reaches that tier because something blocked
it, so the straight line aimed the replacement waypoints back through the
very obstacle that caused the stuck; every reroute reproduced the block and
the budget drained into recover_to_hub, which teleported the bot onto the
identical route. Now routes through build_route/2, and the per-reroute log
drops to debug.

Al Kharid toll gate
-------------------
Both halves of the crossing were stubs returning false, so the gate charged
nothing and was an unbroken wall to every router — the wall the fleets were
grinding against. TollGate is now real, from the 468 landscape: leaves 2882
@{3268,3227,0} and 2883 @{3268,3228,0}, solid, on the west edge of x=3268.

Collision is deliberately untouched. Clearing the wall would open the border
for everyone, bots included, and let A* route through a gate the walker
cannot open; a payer instead crosses under a short noclip window. "Open"
now reaches the Border Guard (925), who asks for the toll in dialogue, and
both routes share TollGate.pay_and_cross/2.

GatePassage drives the same sequence for bots through its three phases,
paying via the human click path so bots get no discount. A bot that cannot
pay fails out to the runner's backoff instead of retrying the border.
sickday force-pushed fix/nav-storm-npc-strand-tollgate from 066c3ff7cd
All checks were successful
ci / test (pull_request) Successful in 2m34s
to c931f6eb5c
All checks were successful
ci / test (pull_request) Successful in 2m33s
2026-07-20 16:33:08 +00:00
Compare
Sign in to join this conversation.
No description provided.