Skip to content

feat: move culled NPCs to their routine waypoint on schedule change#376

Open
BoroBongo wants to merge 5 commits into
mainfrom
feat/npc-culling-routine
Open

feat: move culled NPCs to their routine waypoint on schedule change#376
BoroBongo wants to merge 5 commits into
mainfrom
feat/npc-culling-routine

Conversation

@BoroBongo

@BoroBongo BoroBongo commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

NpcRoutineService.CalculateCurrentRoutine now calls NotifyNpcRoutineChanged when the active routine slot changes, moving the culling sphere (and unloaded GO) to the new waypoint so off-screen NPCs progress their daily schedule. RecalculateAllNpcRoutines() iterates every NPC container and can be called after a time skip to synchronise all culled NPCs at once.

Summary

  • When a routine schedule change fires (e.g. time of day changes and an NPC should move to a new waypoint), NPCs that are currently culled (outside the active culling distance) are now teleported to their new routine waypoint immediately
  • Previously culled NPCs would stay at their last known position and snap back weirdly only when the player got close enough to un-cull them
  • NpcMeshCullingDomain and NpcMeshCullingService coordinate with NpcRoutineService to apply the waypoint update without enabling the NPC's full GameObject

How to test

  1. Find an NPC with a time-based routine (e.g. a guard who walks to a fire at night) - I tested it with Kalom resetting routines after giving him Almanach and triggering THE GREAT SUMMONING
  2. Walk far enough away that the NPC culls (disappears from active scene)
  3. Use the time skip cheat (or wait) until the NPC's routine schedule changes
  4. Walk back to the NPC's new routine waypoint — verify the NPC is there, not at their old position
  5. Repeat with a sleeping NPC whose morning routine moves them to a work spot

BoroBongo and others added 2 commits June 15, 2026 21:48
NpcRoutineService.CalculateCurrentRoutine now calls NotifyNpcRoutineChanged
when the active routine slot changes, moving the culling sphere (and unloaded
GO) to the new waypoint so off-screen NPCs progress their daily schedule.
RecalculateAllNpcRoutines() iterates every NPC container and can be called
after a time skip to synchronise all culled NPCs at once.
@BoroBongo BoroBongo marked this pull request as ready for review June 15, 2026 22:41
@BoroBongo BoroBongo requested a review from JaXt0r June 16, 2026 09:56
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