Specials Telemetry System

The Special Encounter Manager controls when “special” enemies or encounters appear in your game. Some rules can be gated by gameplay conditions — for example:

  • Pressure: a measure of how intense the game currently feels (enemy counts, tension, difficulty curve, etc.).

  • Average Player HP: a measure of how healthy the players are, e.g. “don’t spawn a boss if everyone is almost dead.”

Because every game calculates these values differently, the Spawner package does not hard-code them. Instead, it uses a Telemetry Provider system.


How it works

  • Each SpecialRule in your profile can require a minimum Pressure or minimum Average Player HP.

  • The SpecialEncounterManager asks a telemetry provider for those values when deciding whether to spawn.

  • If no provider is assigned, and a rule requires telemetry, the rule will simply fail the check (the special won’t spawn).


Supplying Telemetry

You have two options:

1. Inspector (ScriptableObject provider)

  • The package includes a base class: SpecialsTelemetryProvider.

  • You can create your own subclass and feed in the values from your systems.

  • Example included: BasicSpecialsTelemetry (in the Samples~ folder). This lets you set static numbers in the inspector — good for testing.

Usage:

  1. Create an instance of your provider (e.g. BasicSpecialsTelemetry) via Assets → Create → MegaCrush → Spawner → Specials Telemetry.

  2. Assign it to the Telemetry Provider field on your SpecialEncounterManager.

2. Code (ISpecialsTelemetry interface)

  • Implement the ISpecialsTelemetry interface in your own game systems.

  • At runtime, call:

    myEncounterManager.SetTelemetryProvider(myCustomProvider);
  • This is ideal if you already have a GameState or Difficulty Manager that knows about player HP, pressure, etc.


What you can track

Right now two telemetry hooks exist:

  • Pressure: Any scalar value you want (0–1, or any scale you prefer).

    • Example: based on total enemies alive / max enemies.

    • Example: based on intensity level or director pacing.

  • Average Player HP: Typically a value between 0–1.

    • Example: sum of all player health percentages / number of players.

Rules can specify thresholds — e.g. only spawn this special when Pressure ≥ 0.8 and Avg HP ≥ 0.5.


Why this design

  • Keeps the package game & engine-agnostic: no assumptions about your health or difficulty systems.

  • Makes the system safe: If you don’t wire telemetry, those conditions just evaluate as unmet.

  • Gives you control: you can tune specials to appear based on the same variables that drive your game’s pacing and difficulty.


Summary

  • Special rules can use extra gameplay conditions (Pressure / Average Player HP).

  • The Spawner doesn’t know how to calculate these — you supply the data.

  • Do this either with a ScriptableObject provider (easy plug-in, test values) or via your own class implementing ISpecialsTelemetry (full integration).

  • If you don’t care about telemetry, just leave the provider empty — rules that depend on it will quietly fail, everything else works as normal.

Last updated