Add world-worker obstacle awareness - #25
Conversation
|
Live test found a blocked-follow edge case. The blocked-state recheck correctly tested the new direct route to the player, but on resume the normal obstacle wrapper immediately tested the worker's old/current facing before curved locomotion had time to steer. This produced CLEAR -> FOLLOW RESUME -> immediate OBSTACLE STOP loops when the worker was still facing the original object. Refinement added on this PR:
Expected new diagnostics:
This keeps PR #25 stop/hold-only with respect to path selection: it still does not route around obstacles; it only prevents stale facing from falsely re-blocking an otherwise clear follow route. |
|
Second live obstacle-follow test with Root cause isolated: the blocked FOLLOW recheck and current-facing precheck use the prospective walking corridor, but Refinement committed:
Expected result: after a blocked FOLLOW route becomes genuinely clear, the worker should turn in place and then transition directly into continuous locomotion without the repeated short restart/stop cycles. |
|
Live validation PASS (2026-08-09, obstacle-turn-escape-3). Test against John Deere cultivator980: A/Rhys stopped correctly on |
Summary
Builds directly on the validated continuous-follow checkpoint and adds conservative environment sensing before any attempt at obstacle avoidance/pathfinding.
Behaviour
HP_WorldObstacleAwareness.luaoverlapBoxcorridor rather than a centre-line raySTATIC_OBJECT,BUILDING, andVEHICLEwalk/curve/gotomotion ends withobstacle-blockedblockedstate instead of immediately restarting the motionDiagnostic command
hpWorld sense [slot]This reports whether the worker's immediate forward corridor is
CLEARorBLOCKED, plus the hit node/name/group where available.Scope
This PR is deliberately stop/hold only. It does not choose a route around an obstacle, create waypoints, or add navmesh/pathfinding.
Test focus
[WorldObstacle] Loaded ... obstacle-awareness-1appears without Lua errors.hpWorld sense A; expectCLEAR.hpWorld sense Ashould reportBLOCKEDfor each collidable obstacle.hpWorld follow A; A should stop before contact and enterFOLLOW STATE A -> blocked.OBSTACLE CLEARand FOLLOW should resume automatically.No pathfinding/avoidance is introduced yet.