The Wave Manager tool is responsible for configuring and managing enemy waves for each level. Our game uses a fixed number of waves per level (5), and each wave consists of multiple pulses.

A pulse defines which enemies are released and how many are spawned simultaneously. A wave is considered complete when all enemies in that wave have been defeated. This system allows designers to control pacing and enemy combinations dynamically.

The Manager

Core Functionalities

  • Create and edit Wave Configs for levels
  • Define enemy types and amounts per pulse
  • Control the number of pulses per wave
  • Start and restart wave sequences in-game
  • Save and load wave configurations to/from binary files

Tweakable Values & Controls

  • Save Config: Export created wave settings to binary
  • Load Config: Import pre-made wave settings from binary
  • Start Waves: Begin the wave sequence
  • Restart Waves: Resets all wave progress
  • Preparation Time: Time before the first pulse in a wave
  • Time Between Pulses: Delay between each enemy pulse
  • Enemies per Pulse: Amount of enemies released at once
  • Max Enemies per Wave: Used to size the EnemyPool efficiently
View Enemy Pool on GitHub

Behind the Scenes

The Wave Manager not only handles spawning logic, but also serves as a central data provider for enemies through the Enemy Pool. It calculates pathfinding points from every spawn location to all critical targets (like drills) and stores this data in a fast-access map.

It also populates the AI Blackboard with necessary references, such as target positions, path data, or pointers to shared systems. This ensures all enemies receive the info they need without unnecessary overhead.

Enemy Pool Integration

The EnemyPool works alongside the Wave Manager to handle enemy spawning. It allocates memory for all enemies in a wave ahead of time, ensuring that no enemies need to be loaded during gameplay. This guarantees smooth performance and fast spawning.

The TriggerPulse function in the Wave Manager signals the EnemyPool to spawn enemies in a defined formation, allowing for structured entry into the game area. Each enemy is initialized with a PhysX body template and receives its steering behavior setup before the game starts.

Core Functionalities

  • Memory Allocation: Pre-allocates all enemies for a wave to prevent runtime loading
  • Spawning Logic: Works with Wave Manager’s TriggerPulse to spawn enemies in formation
  • Steering Rays: Sets default behavior via preset parameters
  • ImGui Control Panel: Provides UI to tweak all enemy-related values.
View Enemy Pool on GitHub