Ends Today: Save up to 95% on the Time Travel Mega Bundle!

Object pooling is a technique used to lower the performance cost of spawning actors during gameplay by spawning a set number of actors beforehand. When an actor is needed during gameplay, instead of spawning a new one, the developer can simply ask one that has already been spawned and stored in the pool that is not currently active and set key properties for it (such as location, rotation, materials, etc..).


This plugin is a really basic implmentation that is intended to be expanded upon without requiring any c++ change, everything is exposed to blueprint.


A main actor that manage every pool you want to create need to be placed in the level, then assign each pool you want in the array.

Every pool manage objects with very simple behaviours through the use of 2 blueprint events and 1 function that need to be called to return actors to the pool:

SetActorActive: Execute behaviour to get the actor you want (for example the niagara system, the location, rotation, etc.).

SetActorInactive: Restore the data of the actor before hiding it from the level.

PoolActor: Is the function that need to be called when the actor is 'expired'(such as when a particle has ended, or an actor timer has expired).

Technical Details

Features:

  •  Actors pooling.
  •  Simple activation and deactivation logic.
  •  Logic is stripped from the actor, instead is all defined in the pool itself to keep the actor clean (In case of actors that expire after some time, in the example I provided one that has the LifeTime on the actor itself and the other that set the LifeTime dynamically (Decals)).
  • Handle cases when the pool has no more actors to provide by optionally spawning a fresh one.
  • Classes are written in c++ and exposed to blueprint for logic.
  • Example function library to access and request actors from the pools.
  • Adding new pools for new actors is easy and can be done in the editor without touching c++ code.
  • Pooled actors are spawned in organized folders inside the scene outliner.

Code Modules:

  •  PoolingManagerRuntime

Number of Blueprints: 5

Number of C++ Classes: 2

Network Replicated: Network agnostic

Supported Development Platforms: Win64

Supported Target Build Platforms: Win64

Documentation: https://drive.google.com/file/d/14ghrqQLDuHdh9jssb5m06rCjIFMIPBJM/view?usp=sharing

Important/Additional Notes: Do not hesitate to contact me for any bug or help

D
defaltdobrasao
All Assets by Author
5.86 
Platforms Windows 64-bit
UE Versions 4.27, 5.0
Tags ACTOR POOL, POOL, PERFORMANCE, NoAI, BLUEPRINTS, POOLS, OBJECT POOL
Release date 12.12.2021

Similar products

Image
Sign In
Image
Sign Up
Image
Recovery