- What functions exist conceptually
- How they’re typically used
- Which are core vs optional/advanced
Exact naming may differ slightly in your project. Treat this as the “design contract” for how the subsystem is intended to be used.
1. Core Class
URespawnManagerSubsystem
Type:UWorldSubsystemHeader (example):
#include "RespawnManagerSubsystem.h"
Purpose:Centralized management of all respawnable actors and timed respawn entries in the world. Accessible from any actor:
2. Core Registration API
These are the essential functions you’ll use in almost every integration.RegisterRespawnRequest
Registers an actor to be respawned after a delay. C++ (concept):Targetis usuallyself(resource node, loot chest, trap, etc.)- After
DelaySeconds, the subsystem will trigger the respawn callback
(typicallyOnRespawnRequestedvia interface)
CancelRespawnRequest (Optional but recommended)
Cancels a previously registered respawn for an actor. C++:- Actor is permanently destroyed
- Actor changes behavior (e.g., converted to another type)
- Dungeon or region is being reset manually
3. Interface / Callback API
The Respawn Manager calls back into the actor when it’s time to respawn.This is usually done via an interface.
IRespawnable / BPI_Respawnable
Interface Name (example):- C++:
IRespawnable - Blueprint:
BPI_Respawnable
- Reset internal flags (
bHasBeenHarvested = false) - Reset loot (
LootComponent → ResetLoot) - Re-enable mesh visibility and collision
- Re-enable interaction
GetRespawnDelay (Optional) If you want per-actor or dynamic respawn times, the interface may expose: C++:
RegisterRespawnRequest is called with a sentinel delay (e.g., ≤ 0).
4. Query API (Optional)
For debugging and advanced logic, you may expose basic queries.HasPendingRespawn
Check if a given actor has an active respawn entry. C++:GetTimeRemainingForActor
Returns how many seconds remain before a respawn fires. C++:5. Region & Category Controls (Advanced / Optional)
If you implement region/category grouping as described in Advanced Topics, the API typically looks like this. Treat all of these as optional / advanced.SetRegionPaused
Pause or resume respawns for a logical region. C++:ForceRespawnByRegion
Immediately trigger respawn for all pending entries in a region. C++:ForceRespawnByCategory
Same idea, but grouped by “category” tag (e.g.,"Resource.Tree", "Chest.World").
C++:
6. Foliage-Specific Helpers (Optional)
If you decide to expose foliage helpers directly from the Respawn Manager (rather than routing everything through a FoliageInteractionManager), you might have something like:RegisterFoliageRespawn (Pattern-Level)
Registers a foliage instance to be respawned. C++ (concept):FFoliageRespawnEntry contains:
- Weak pointer to
UHierarchicalInstancedStaticMeshComponent - Transform of the instance
- Optional type/category info
If you keep foliage logic in a separate manager, this may not be exposed as public API at all, but it’s useful to describe at the design level.
7. Debug / Utility API (Optional)
For development and admin tools, you might expose:ClearAllRespawnEntries
Remove all pending respawns (useful for debugging, admin tools, level resets). C++:GetTotalActiveRespawns
Returns the total number of currently tracked respawn entries. C++:8. Typical Usage Flow
For most actors, you will only need:RegisterRespawnRequest(this, RespawnTime);- Implement
OnRespawnRequested(interface or Blueprint event)