Shrimple Object Pooler

Unreal Engine Actor Pooler Plugin

This is my first object pooler created in Unreal Engine, built as a solo project over one week. I wanted something that could be used across any actor class without restriction, and the Shrimple Object Pooler is my solution to that problem. As the sole programmer, I designed and implemented every aspect of the system — from the pool management strategy to the interface contract and Blueprint integration.

Team Size

  • Solo Project

My Role

  • Programmer

Duration

  • 1 Week

Tech Stack

  • Unreal Engine
  • C++

Context

  • Personal Project

Test Video


Technical Breakdown

Pre-Allocation with Array Reservation

Arrays reserve space upfront, based on configured pool sizes, to prevent costly reallocations during initialization. By allocating the full capacity before any objects are spawned, the pooler avoids the incremental resize overhead that would otherwise occur as actors are added at runtime.

Efficient Pool Management

Objects are stored in two arrays per pooled class — an active array and an inactive array. Instead of costly RemoveAt() calls causing array reshuffling, returned objects are set to nullptr in the active array and placed into available slots in the inactive array. This approach minimizes memory reallocations and fragmentation, maintaining stable performance even with large pools.

Interface Enforcement

Only actors implementing the IPooledObject interface can be pooled, ensuring pooled objects support activation and deactivation hooks. This guarantees that actors correctly reset their state when reused, preventing stale data from leaking between pool cycles.

Expandable Pools and Fallbacks

The pool supports dynamic expansion if configured, allowing new objects to spawn when the pool runs out. Additionally, it can be set to reuse the oldest active object, providing flexible object reuse strategies that fit different gameplay needs.

Configurable Per-Class Cleanup

A cleanup timer periodically compacts pooled arrays by removing invalid or destroyed actor references. This cleanup respects user-configured thresholds and frequencies on a per-class basis, optimizing runtime memory use without causing frame spikes.

Blueprint and Editor Friendly

Spawned pooled actors are organized under a dedicated editor folder (/Pool) to keep the world outliner tidy. Spawn parameters avoid deferred construction to ensure predictable initialization, making the plugin straightforward to integrate from both C++ and Blueprint.


Code

The core pool request logic — showing how the pooler checks for available inactive objects, falls back to expansion or oldest-reuse, and correctly transfers references between the active and inactive arrays.

ObjectPooler.cpp


Project Links