Respawn & Replication
Foliage instance state needs to be consistent across clients. EDInteractionSystem handles this through the GameState component.
Replicating “removed instances”
UEDInteractionGameStateComponent maintains a replicated fast array:
FEDRemovedFoliageInstanceList
Each item contains:
StaticMesh(mesh type)Location(quantized)
Clients apply replication updates by finding a matching instanced component in the world and removing the instance.
Respawn
If a foliage entry has Respawn.bShouldRespawn = true, the server can schedule respawn.
The server stores respawn queues per instanced component and periodically decrements countdowns.
When a respawn triggers:
- The “removed instance” entry is removed from the replicated list
- A multicast notifies clients to refresh focus state
- The instance is added back to the matching instanced component
Destruction effects and sounds
Foliage entries can specify:
- A destruction effect actor class (
DestructionEffectClass) - An optional destruction sound
- Whether effects/sounds should clone scale from the original instance
The GameState component spawns effects and multicasts sound playback.