Core Overview

com.megacrush.runtimespawner.core

The Runtime Spawner Core package provides the foundational systems responsible for executing and managing all spawning behavior.

It is designed to be:

  • Modular - works with multiple addons and systems

  • Data-driven - controlled through assets and configuration

  • Extensible - supports custom factories, placement logic, and integrations

The Core does not define gameplay scenarios directly - instead, it provides the engine that executes them.

What Core Includes

The Core package contains the systems required to:

  • Define what can be spawned

  • Control where things can appear

  • Execute and track spawn requests

  • Manage pacing and intensity

  • Handle pooling and instantiation

Core Assets

  • Spawn Entry - Defines what can be spawned

  • Prefab Collection - Groups multiple prefabs for variation

  • Spawn Placement Profile - Controls placement behavior and validation

  • Intensity Profile - Defines pacing and difficulty scaling

  • Single Player Pool Factory - Default pooling/instantiation system

Core Components

  • Runtime Spawner - Central execution engine

  • Spawn Director - Controls pacing and intensity over time

  • Spawn Hint Point - Optional placement guidance in the scene

  • Team Component - Identifies faction/team relationships

Core Responsibilities

The Core is responsible for:

Executing Spawns

  • Processes spawn requests from addons or systems

  • Selects entries, validates placement, and performs instantiation

Managing Population

  • Tracks active spawned objects

  • Enforces alive caps and limits

Handling Placement

  • Evaluates spawn positions using:

    • Nav Mesh

    • Placement profiles

    • Hint points

Controlling Pacing

  • Uses the Spawn Director and Intensity Profiles to scale difficulty

  • Adjusts spawn pressure over time or progression

Managing Object Lifecycle

  • Delegates creation and reuse to the Object Factory system

  • Ensures efficient pooling and cleanup

Core Execution Flow

At runtime, the Core processes spawning in a consistent pipeline:

  1. Spawn Request

    • Triggered by an addon or system

  2. Entry Selection

    • A Spawn Entry (or collection) is selected

  3. Placement Evaluation

    • A position is chosen and validated

    • Hint Points and Placement Profiles may influence the result

  4. Spawn Execution

    • The Object Factory instantiates or retrieves a pooled object

  5. Tracking

    • The Runtime Spawner registers and tracks the spawned instance

Core vs Addons

A key concept in 2.0 is the separation between Core and Addons.

Core

  • Executes spawns

  • Manages population and lifecycle

  • Controls pacing via the Spawn Director

Addons

  • Define when, where, and why things spawn

  • Examples:

    • Global Spawner (ambient population)

    • Local Area (region-based encounters)

    • Waves (structured spawning)

    • Spawnpoints (authored placement)

Core = execution engine Addons = gameplay behavior

Typical Setup Flow

A basic setup using Core systems looks like:

  1. Add a Runtime Spawner to the scene

  2. Assign:

    • Placement Profile

    • Factory (default or custom)

  3. Optionally add:

    • Spawn Director + Intensity Profile

    • Spawn Hint Points in the scene

  4. Add one or more addons to drive spawning behavior

Placement Systems

Core supports multiple placement strategies:

Procedural Placement

  • Uses Nav Mesh and sampling

  • Default behavior

Hint-Based Placement

  • Uses Spawn Hint Points as weighted suggestions

Authored Placement (Addon)

  • Provided by the Spawnpoints addon

  • Enables exact placement at predefined locations

Pacing and Intensity

The Spawn Director and Intensity Profile work together to control:

  • Spawn rates

  • Population limits

  • Difficulty progression

This allows scenarios to:

  • Start calm

  • Gradually increase pressure

  • Reach a peak

  • Recover or reset

Key Design Principles

Separation of Concerns

  • Core executes

  • Addons define behavior

  • Factories handle instantiation

Data-Driven Configuration

  • Most behavior is defined through assets

  • Systems can be reused across scenes

Extensibility

  • Custom factories can replace instantiation logic

  • Addons can introduce new spawning behavior

  • Placement systems can be extended

Summary

The Runtime Spawner Core provides the foundation for all spawning systems.

It does not dictate gameplay - instead, it provides:

  • A consistent execution pipeline

  • Flexible placement and validation

  • Scalable population management

  • Extensible integration points

Everything else - from ambient population to scripted encounters - is built on top of this foundation.

Last updated