Skip to content

RoamingActorSubsystem#145

Open
Ingarnm wants to merge 8 commits intosinbad:masterfrom
Ingarnm:WanderingActorTracker
Open

RoamingActorSubsystem#145
Ingarnm wants to merge 8 commits intosinbad:masterfrom
Ingarnm:WanderingActorTracker

Conversation

@Ingarnm
Copy link
Contributor

@Ingarnm Ingarnm commented Mar 10, 2026

I spent some time working on actors that move between WorldPartition cells. The idea is that roaming actors "live" in the PersistentLevel, but are saved and loaded per WorldPartition cell. If a roaming actor crosses into the bounds of an inactive cell, it will save itself into that cell.

For a roaming actor to function correctly, it must implement the ISpudRoamingActor interface and register itself with SpudRoamingActorSubsystem. From that point, its save and destroy lifecycle is fully managed by the subsystem. Upon restoration, the actor will always belong to the PersistentLevel rather than the cell it was restored from.

image

USpudRuntimeStoredActorComponent is kept as-is for now, it only subscribes and unsubscribes its owner from subsystem tracking.

Currently, a separate interface is used to distinguish roaming actors during the SPUD save and restore process, there might be a better way to handle this.

@sinbad
Copy link
Owner

sinbad commented Mar 10, 2026

Thanks! Can anyone who uses WP put this through their paces? I'll ping the Discord to see.

@Ingarnm
Copy link
Contributor Author

Ingarnm commented Mar 10, 2026

For those who want to test it, it's better to use console command: RoamingActorSubsystem.DebugDrawCells 1 , WP creates cells automatically, and they may be generated based on actors that don't need WP cells, like a SkySphere or some utility volumes, so this will make them easier to track.

@Ingarnm Ingarnm changed the title Wandering actor tracker RoamingActorSubsystem Mar 10, 2026
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.

2 participants