Spawn & Wave System

v1.0.0

Workflows

Complete guides for Tower Defense, Roguelike, and Resource systems.

Overview

SWS is designed to support multiple game genres. This guide provides complete workflows for the three most common use cases: Tower Defense, Roguelike/Survivors arenas, and Resource respawn systems.

Tower Defense

Path-following enemies, towers, end zones

Roguelike Arena

Endless waves, arena spawning, difficulty scaling

Resource Respawn

Harvestable resources with cooldown timers

Quick Start: Use the Scene Generators inTools → Spawn Wave System → Generate Test Scenesto create pre-configured test scenes for any workflow.

Tower Defense

In Tower Defense, enemies spawn at entry points, follow predefined paths, and the player loses lives when enemies reach the exit.

Scene Setup

Scene
├── SpawnManager
├── WaveController (with WaveSequence)
├── --- PATH ---
│   ├── PathAnchor_01 (Start)
│   ├── PathAnchor_02
│   ├── PathAnchor_03
│   └── PathAnchor_04 (End)
├── --- SPAWN POINTS ---
│   └── SpawnPoint_Entry (Tag: "Enemy", Path: PathAnchor_01)
├── --- TOWERS ---
│   └── Tower_01 (SimpleTower component)
├── EndZone (TDEndZone component)
└── UI Canvas
    └── WaveStatusUI

Path Setup

  1. Create empty GameObjects for each waypoint
  2. Add PathAnchor component to each
  3. Connect anchors by assigning Next Anchors array
  4. Position anchors to form your path
  5. Set Wait Time and Speed Multiplier as needed

PathAnchor Settings for TD

Reach Radius0.5–1.0 (tighter paths)
Wait Time0 (continuous movement)
Speed Multiplier1.0 (or vary for difficulty)

Wave Setup

Configure waves for escalating difficulty:

Example Wave Progression

Wave 1: 10x Basic Enemy
Wave 2: 15x Basic Enemy, 3x Fast Enemy
Wave 3: 20x Basic Enemy, 5x Fast Enemy, 1x Tank Enemy
...
Boss Wave: 1x Boss Enemy
End Zone: Add a TDEndZonecomponent at the path exit. It automatically detects enemies reaching the end and marks them as defeated with reason ReachedEnd.

🎯 Roguelike Arena

In Roguelike/Survivors games, enemies spawn around the arena edges and chase the player. Waves get progressively harder with endless mode.

Arena Setup

Scene
├── SpawnManager (high entity settings)
├── WaveController (Endless mode)
├── --- SPAWN POINTS ---
│   ├── SpawnPoint_North (around arena edges)
│   ├── SpawnPoint_South
│   ├── SpawnPoint_East
│   └── SpawnPoint_West
├── Player
│   ├── SimplePlayerController
│   └── SimpleCameraFollow (on Camera)
├── Arena (ground + walls)
└── UI Canvas
    ├── KillCounter
    └── SurvivalTimer

Spawning Setup

SpawnManager Settings for High Entity Counts

Max Spawns Per Frame10–20
Max Active Entities500–2000
Default Pool Size50–100

SpawnPoint Settings for Arena Edges

Spawn Radius2–5 (for spawn variation)
Max Concurrent10–20
Cooldown0.1–0.5

Endless Mode Configuration

Configure the WaveSequence for escalating endless gameplay:

Endless Mode Settings

WaveSequence:
├── Mode: Endless
├── Scale On Loop: ✓
├── Spawn Multiplier: 1.2 (20% more enemies each loop)
├── Stat Multiplier: 1.1 (10% stronger each loop)
└── Wave Delay: 3 seconds
Enemy AI: Enemies should have a simple chase behavior. The included SimpleEnemyChaserexample component targets the Player tag.

🌲 Resource Respawn

Resource systems spawn harvestable objects (trees, ores, plants) that respawn after being collected.

Resource Setup

Scene
├── SpawnManager
├── ResourceManager (custom or use WaveController with single wave)
├── --- RESOURCE SPAWN POINTS ---
│   ├── TreeSpawnPoint_01 (Tag: "Tree")
│   ├── TreeSpawnPoint_02 (Tag: "Tree")
│   ├── OreSpawnPoint_01 (Tag: "Ore")
│   └── OreSpawnPoint_02 (Tag: "Ore")
└── Player

SpawnProfile for Resources

TypeResource
Lifetime0 (don't auto-despawn)
Use Pooling✓ (for respawn efficiency)

Harvesting Workflow

  1. Player interacts with resource (GC2 Trigger)
  2. Check condition: Is Resource Available
  3. Execute instruction: Harvest Resource
  4. Give player items/currency
  5. Resource automatically respawns after cooldown

Visual Scripting Example

Trigger: On Player Interact
├── Condition: Is Resource Available (Entity: Self)
├── Instruction: Harvest Resource (Entity: Self)
├── Instruction: Add Item (Player, Wood x3)
└── Instruction: Play Effect (Harvest particles)
Respawn Timer: Resources automatically respawn after their configured cooldown. Use the On Resource Respawned event to play respawn effects.