Spawn Marker Specification - wwestlake/Steamforge GitHub Wiki

Spawn Marker Specification

Overview

The Spawn Marker is an editor-visible, runtime-invisible actor used to designate dynamic spawn locations for in-game objects such as collectible rocks, NPCs, or other actors. These markers are designed to be placed manually in the level and managed by the ObjectManagementSystem, a Game Instance Subsystem responsible for runtime instantiation and lifecycle management.

Purpose

  • Reduce manual placement of multiple actors
  • Provide a centralized, scalable method to spawn and respawn items
  • Allow designers to configure spawn behavior using instance parameters

Actor: AGameSpawnerMarker

Components

  • Billboard Component: Provides a visual icon in the editor for easy location and manipulation
    • Visible only in the editor
    • Uses a spawn icon or custom texture for identification

Configuration Variables

Variable Type Description
SpawnClass TSubclassOf<AActor> Class to spawn (e.g., rock, item, NPC)
SpawnRadius float Radius around the marker in which objects may be spawned
SpawnCount int Number of objects to maintain in the spawn area
RespawnDelay float Time in seconds to wait before respawning a despawned item
bRespawn bool Whether objects should be respawned after destruction or collection
InitialSpawnDelay float Optional delay before the first spawn event
GroupTag FName Optional tag for grouping markers

Editor Settings

  • Actor Hidden In Game set to true
  • Collision disabled
  • Optional debug visuals can be added using EditorConstructionScript

Object Management Integration

During initialization or at relevant runtime intervals, the ObjectManagementSystem will:

  1. Query all actors of type AGameSpawnerMarker
  2. Extract configuration data
  3. Spawn the specified number of actors of SpawnClass within SpawnRadius
  4. Monitor spawned instances for lifecycle events (destruction, collection)
  5. Trigger respawn after RespawnDelay if bRespawn is true

Sample Query Code (C++)

TArray<AActor*> SpawnerMarkers;
UGameplayStatics::GetAllActorsOfClass(GetWorld(), AGameSpawnerMarker::StaticClass(), SpawnerMarkers);

for (AActor* Marker : SpawnerMarkers) {
    AGameSpawnerMarker* Spawner = Cast<AGameSpawnerMarker>(Marker);
    if (Spawner) {
        // Handle spawning logic here
    }
}

Future Enhancements

  • Support for weighted spawn tables
  • Integration with region-based streaming or spawn culling
  • UI indicators in editor for better visualization of spawn radius
  • Optional blueprint interface for per-spawn customization

Author: Steamforge Systems Team
Last Updated: April 8, 2025

⚠️ **GitHub.com Fallback** ⚠️