Procedural Spawner is a code plugin that assists in spawning actors at runtime, or as permanent in-editor placements. The actors can be spawned using a variety of procedurally generated geometric layouts, with options for actor type selection, timing, random transformational offsets, looping and infinite spawning, recursive spawning, or creating chained spawning sequences.
Spawners are added to the level as blueprint actors, and activated either on Begin Play, or triggered via a blueprint function. Completion of spawning can be listened to, allowing chaining of spawning or other events. Various helper blueprints are available, such as grouping, triggers / buttons and spawn event listeners, to allow setting up complex spawning sequences. Network support is also included to control which side of the network spawns are executed, as well as being able to initiate a spawn on the server and multicast it to all clients.
Overview Video: Shows the types of spawners available, and examples of their usage.
Tutorials & Demo Videos: Tutorials for in-depth usage of the spawners, and demos to show various use cases.
Example Project: Demonstrates use of each spawner type (as per video). Requires plugin. Examples in: Examples\Levels
User Manual: Detailed explanation on all available spawners and parameters (draft)
Twitter: Dev log and release announcements
Support: Reply to this thread, or email [EMAIL=“email@example.com”]firstname.lastname@example.org (timezone UTC+10)
See reply below for direct links to demo and tutorial videos, as well as the release change log.
- Spawn actors at runtime or in the editor as permanent placements saved in the game level.
- Various geometric layouts to arrange how actors are spawned (see below).
- Sequential or randomised actor type selection.
- Random world-space transformational offsets to create effects that differ each time the spawn sequence is executed.
- Spawn actors in a single sequence, looped sequences or an infinite loop. Configurable spawn limit to automatically destroy actors when limit is reached.
- Timing options per-spawn (fixed delay per spawn, or random delay per spawn), and per-loop timing (fixed wait time between each sequence loop).
- Allow spawning automatically on BeginPlay, or when triggered via blueprint function (trigger / button blueprint included).
- Controlled recursive spawning with automatic tree depth control.
- Configurable to execute on server-only, client-only, or triggered on server and multicast to client (spawns occur on client, but initiated from server side).
- Optionally spawn via a centralised spawn queue to prevent lag
- Various helper blueprints to work alongside spawners and make using them easier for the developer
The spawning geometries include those with the following dimensions:
- Point: Spawn on single point only
- Line: Spawn along a line (e.g. vector, circle)
- Surface: Spawn on the surface of a two dimensional geometry (e.g. rectangle, circle surface area)
- Volume: Spawn inside the area of a three dimensional geometry (e.g. sphere, box)
The following types of geometry are available to arrange spawned actors:
- Spiral (Archimedean)
- Sine / Cosine Wave
- Concentric Circles
Specific combinations of geometry type & spawn dimensions are available. Not all geometry types are available in all dimensions, as appropriate for the geometry type (e.g. a vector cannot have a surface or volume).
The ordering of multiple spawns in a sequence can be set to:
- Sequential: Spawns occur in a specific order and are evenly spaced along the geometry, with no overlaps (e.g. from one end of a vector to another)
- Random: Spawns occur at random anywhere on the geometric surface, with no ordering, spacing or overlapping checks (e.g. randomly anywhere along a vector)
The following helper blueprints are included to assist in setting up and controlling spawner sequences:
Trigger: Used to create triggers and buttons. Includes:
Mesh version: Used to create visible buttons to be pressed by players
Non-mesh version: Used to create invisible trigger boxes, intended to be activated via overlap
Various options to control use: Trigger mode, activation method, activating class restriction, spawn interrupt, actor destruction, inverted spawn, wait time, etc.
ReTrigger: Listen to the completion of a spawner, and use it to activate other spawners (for setting up spawning sequences)
ReTrigger Builder: Setup ReTriggers by listening to recursive spawns and adding the new Spawners to the ReTrigger. Use for dynamic ReTrigger setups.
Group: Create a hierarchy of spawners in groups, allowing multiple simultaneous activations, and listening to completion of entire group.
PassThrough: Listen to the completion of a spawn sequence, or activate via blueprint function, and use it to call other functionality outside of the Procedural Spawner system. Sample types include:
Destroy Actors: Destroy target actors when spawning completes.
Interrupt Spawner: Interrupt another spawner when spawning completes.
Interrupt Spawner Group: Interrupt another spawner group when spawning completes.
Particle Spawn: Spawn, activate and de-active particle emitters.
Show Text: Display a text object for a fixed period of time.
Spawn Queue: Centralised control of spawn timing, to prevent lag when multiple spawners activate at the same time (due to slowness of spawning actors at runtime).
Trace and Place: Blueprint for spawning static meshes that perform a trace and place themselves on the surface of the object impacted by the trace.
Projectile: Physics project with visuals created via spawners. Includes options for self-destruction. Does not work with replication. Used in demo, not intended for production use.
- **Does this work with networking? **Yes. Although the plugin is intended primarily for single-player games, networking support is included. However, care must be taken in setting up spawning arrangements with networking to ensure they work correctly as intended.
- Does this work with save games? No specific functionality has been included for saving. A limited number of fields in spawners are maked for saving, but no functionality has been included for serialising or deserialising spawner objects. This plugin is intended for runtime effects that execute each time the level is loaded. Additional work will be required to use in save games - for example executing all spawners via triggers and ensuring they are triggered only at the correct times, and saving the actors that are spawned.
- What is spawning performance like? All actors are spawned at runtime using SpawnActorDeferred, which is quite slow. This method is used because the type of actor to be spawned is not known in advance, so a pre-generated pool of a given type can’t be created. Due to the slowness of spawning actors (depending on the type of actor and the resources to be loaded), it is recommended to spawn actors over time, such as using the Spawn Queue, and to have a static copy of any meshes or other resources to be loaded already present in the game level.
- Is the source code available? Yes, source code is included. The source is heavily commented, however the code is not documented in the user manual.
- Are there tutorials or reference material? Yes. A user manual is available (currently available in draft). A sample project is available which demonstrates the use of every spawner type. Video tutorials may also be created in the future.
- Why can’t static meshes be selected in the actor type list? Static meshes in the content browser are not actors by themselves, and cannot be spawned directly. To be spawned dynamically, they must be a static mesh component as part of another actor. This is why spawning static meshes is done via blueprint actors.
Do you use this plugin in your project and find it useful? If so it would be great to hear from you for feedback.