Skip to content

Add continuous world-worker follow behaviour - #24

Draft
SimGamerJen wants to merge 2 commits into
agent/world-workers-alpha4-target-navigationfrom
agent/world-workers-alpha4-continuous-follow
Draft

Add continuous world-worker follow behaviour#24
SimGamerJen wants to merge 2 commits into
agent/world-workers-alpha4-target-navigationfrom
agent/world-workers-alpha4-continuous-follow

Conversation

@SimGamerJen

Copy link
Copy Markdown
Owner

Summary

Builds directly on the validated target-navigation checkpoint and adds session-only continuous following of the local player.

Commands

  • hpWorld follow [slot] [standOffMetres]
  • hpWorld unfollow [slot]

Aliases:

  • followme, trail
  • followstop, stopfollow

Behaviour

  • reuses the validated target-navigation + bounded-yaw locomotion pipeline
  • continuously retargets the active navigation target to the player's live position every frame
  • preserves the existing native-style gait, steering, acceleration/braking, terrain following and persistence
  • default stand-off: 1.8 m (clamped 0.75–5.0 m)
  • hysteresis prevents constant foot-shuffling: after stopping, the worker resumes only once the player is roughly 0.75 m beyond the stand-off
  • stops immediately if the player moves inside the requested stand-off while the worker is approaching
  • pauses if player/worker data becomes unavailable
  • direct-follow range remains capped at 100 m for this prototype
  • unfollow cleanly stops any active follow motion and persists the worker's final position

Persistence

The resulting worker position persists normally, but FOLLOW mode itself is deliberately session-only for this prototype. Reloading a save will not make a worker automatically resume chasing the player.

Test focus

  1. Confirm [WorldFollow] Loaded ... continuous-follow-1 appears.
  2. Place A outdoors and run hpWorld follow A.
  3. Walk away slowly and confirm A starts, continually steers toward the moving player, and stops around the stand-off.
  4. Hover around the stand-off and confirm A does not constantly take tiny corrective steps.
  5. Open the gap again and confirm A resumes automatically.
  6. Walk across A's path / change direction sharply and confirm live retargeting remains smooth and jitter-free.
  7. Try hpWorld follow A 2.5 to update the stand-off while already following.
  8. Run hpWorld unfollow A while moving and while waiting; both should cancel cleanly.

No obstacle avoidance or pathfinding is introduced in this PR.

Copy link
Copy Markdown
Owner Author

Test result — FULL PASS

The remaining continuous-follow cases are now validated in-game.

  • Live stand-off update while already following: PASS. hpWorld follow A 2.5 updates standOff=2.50 and resumeAt=3.25, then the worker resumes once the gap reaches ~3.26–3.28 m and subsequently settles cleanly at ~2.50 m.
  • unfollow while actively moving: PASS. Active curved locomotion stops immediately with reason=follow-cancelled, followed by FOLLOW STOP A reason=requested and a successful command result.
  • Continuous retargeting remains smooth through large heading changes during the 2.5 m follow test.

Combined with the earlier visual and log validation, PR #24 is now the known-good continuous-follow checkpoint.

@SimGamerJen
SimGamerJen force-pushed the agent/world-workers-alpha4-continuous-follow branch from 3b70495 to 0954da3 Compare August 8, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant