Intensity Profile

(used by SpawnDirector)

Overview

An Intensity Profile defines how your spawning system escalates or relaxes over time. It contains a sequence of steps, each step modifying spawn rules such as rate, concurrency, and pacing.

The SpawnDirector component reads this profile and advances through its steps either manually (via code/events) or automatically (based on time).

This lets you design pacing curves like:

  • A slow trickle at the start of a mission

  • Increasing pressure as players progress

  • A high-chaos finale or boss phase


Properties

Property
Description

Advance Mode

Determines how steps advance: • Manual – you control step progression via code/events. • AutoByTime – profile automatically advances after a set time.

Seconds Per Step

Duration (in seconds) for each step when AutoByTime is active.

Steps (List)

The ordered sequence of pacing steps. Each step defines:

Concurrent Alive Cap

Maximum enemies alive at once (across all spawners).

Global Spawn Window (Min/Max)

Delay between spawns. Narrow ranges = faster pacing.

Spawn Rate Multiplier

Scales spawn rates for all active spawners.

Wave Rate Multiplier

Scales wave timing (if spawners use wave logic).


How to Use

  1. Create a Profile

    • Right-click in Project → Create → Runtime Spawner → Intensity Profile.

  2. Assign It

    • Attach a SpawnDirector to a GameObject with a RuntimeSpawner.

    • Assign your Intensity Profile in the inspector.

  3. Configure Steps

    • Add steps to the list.

    • Tune values to match your desired pacing curve (e.g., slow → steady → chaotic).

  4. Test

    • Enter Play Mode.

    • If Advance Mode = AutoByTime, the profile will progress through steps on its own.

    • If Manual, you can advance steps via script calls (StepUp, StepDown, SetStep).


Example

  • Step 0: 5 alive cap, spawn every 5–7s → Calm start

  • Step 1: 10 alive cap, spawn every 3–5s → Escalation

  • Step 2: 20 alive cap, spawn every 1–2s → Final chaos

This curve mimics the pacing of games like Left 4 Dead, where difficulty ramps dynamically.

Also see

Spawn Director

Fundamentals

IntensityProfile is a ScriptableObject that defines how spawn intensity changes over time or progression. Each Step in the profile configures:

  • A hard cap for all spawns.

  • A target global population window.

  • Multipliers for:

    • Global spawn rate.

    • Wave spawn timing.

At runtime, SpawnDirector reads an IntensityProfile and applies the active step’s values to RuntimeSpawner.


Progression Settings

[Header("Progression")]
public AdvanceMode advance = AdvanceMode.Manual;

[Range(1f, 300f)]
public float secondsPerStep = 30f;

AdvanceMode

public enum AdvanceMode
{
    Manual,
    AutoByTime
}
  • Manual Steps only change when code requests it (e.g. SpawnDirector.StepUp() / SetStep()).

  • AutoByTime Steps advance automatically every secondsPerStep seconds while the director is running.

secondsPerStep

  • Used only when advance == AutoByTime.

  • Controls how frequently the SpawnDirector moves from one step to the next.


Step Definition

[System.Serializable]
public class Step
{
    public string   name            = "Step";

    [Range(0, 250)]
    public int      concurrentAliveCap = 30;

    [MinMaxRange(0, 250)]
    public Vector2Int globalRange       = new Vector2Int(10, 25);

    [Range(0.1f, 5f)]
    public float    spawnRateMult   = 1f;

    [Range(0.1f, 5f)]
    public float    waveRateMult    = 1f;
}

Each step describes one intensity band.

  • name Display name for the step (used for authoring/UI only).

  • concurrentAliveCap Hard cap across all spawns while this step is active. Applied via:

    _spawner.SetConcurrentAliveCap(step.concurrentAliveCap);
  • globalRange Target global population window (min, max) for ambient/global spawning. Applied via:

    _spawner.SetGlobalSpawnWindow(step.globalRange.x, step.globalRange.y);
  • spawnRateMult Multiplier for the global spawn loop rate:

    • < 1 → slower spawning.

    • > 1 → faster spawning.

    Applied via:

    _spawner.SetSpawnRateMultiplier(step.spawnRateMult);
  • waveRateMult Multiplier for wave spawn intervals:

    • < 1 → shorter gaps between wave spawns (faster).

    • > 1 → longer gaps (slower).

    Applied via:

    _spawner.SetWaveRateMultiplier(step.waveRateMult);

Step List

public List<Step> steps = new();

Steps are ordered from lowest to highest intensity by convention:

  • Index 0 → “Calm” / early game.

  • Middle indices → mid-intensity encounters.

  • Last index → peak or endgame intensity.

SpawnDirector uses:

  • StepsCount = steps.Count

  • MaxStep = steps.Count - 1

  • CurrentStep to pick the active Step.


Creating and Assigning an IntensityProfile

  1. Create a profile asset:

    • Right-click in the Project window:

      • Create → Runtime Spawner → Profiles → Create Intensity Profile

    • Name it (e.g. Survival_DefaultIntensity).

  2. Configure progression:

    • Choose advance:

      • Manual for mission-driven control.

      • AutoByTime for time-based ramps.

    • If AutoByTime, set secondsPerStep (e.g. 60 seconds).

  3. Add and edit steps in steps:

    Example:

    • Step 0:

      • name = "Warmup"

      • concurrentAliveCap = 20

      • globalRange = (5, 15)

      • spawnRateMult = 0.8

      • waveRateMult = 1.0

    • Step 1:

      • name = "Mid"

      • concurrentAliveCap = 40

      • globalRange = (15, 30)

      • spawnRateMult = 1.2

      • waveRateMult = 0.9

    • Step 2:

      • name = "Final"

      • concurrentAliveCap = 60

      • globalRange = (25, 45)

      • spawnRateMult = 1.6

      • waveRateMult = 0.7

  4. Assign the profile to a SpawnDirector:

    • Add SpawnDirector to the same GameObject as your RuntimeSpawner (or nearby).

    • Set Profile to your new IntensityProfile.

    • Optionally set startStep.

At runtime, SpawnDirector applies the profile’s current step to the spawner, either automatically (if AutoByTime) or via explicit calls to StepUp, StepDown, or SetStep.

Last updated