CrimsonObjectPool
Actors that spawn and die in bursts - projectiles, impact effects, pickups, decals, shell casings, summoned turrets - pay for a full SpawnActor and Destroy every single time. CrimsonObjectPool replaces that with a per-world subsystem that recycles actors by class: Acquire Actor hands you a live instance, Release Actor stands it down and parks it, and the next acquire reuses it.
Pooling is always explicit. The plugin never hooks engine spawn paths, so an actor is pooled only where you asked for it to be, and turning pooling off is a single console command.
Replicated actors have extra rules
Pooling a cosmetic actor is trivial. Pooling a replicated actor works and is fully supported, but it has rules - the most important being that
COND_InitialOnly silently breaks, because a recycled actor's channel is already open on its second use. Read How-To: Pool a Replicated Actor before pooling anything that replicates.What's included
| System | Key types | Purpose |
|---|---|---|
| The pool | UCrimsonObjectPoolSubsystem | Per-world, per-class actor recycling. Acquire, release, prewarm, drain, stats. |
| Actor contract | ICrimsonPoolable, ICrimsonPoolableAdapter | Optional. Lets an actor control its own reactivation and optionally reclaim itself - or, through an adapter, supplies the same hooks for a class you cannot modify. |
| Configuration | UCrimsonObjectPoolSettings, FCrimsonObjectPoolClassConfig | Capacity, growth policy, prewarm counts - globally or per actor class. |
| Diagnostics | FCrimsonObjectPoolStats, Crimson.ObjectPool.Bypass, Crimson.ObjectPool.Dump | See what each pool is doing, and turn pooling off to isolate a bug. |
Plugin dependencies
| Dependency | Kind | Why |
|---|---|---|
| Crimson plugins | None | The plugin is fully standalone. |
Core, CoreUObject, Engine | Engine module | Actors, worlds, subsystems. |
DeveloperSettings | Engine module | Project Settings integration. |
NetCore | Engine module (private) | The replicated-actor path. |
Slate, SlateCore, ToolMenus, UnrealEd, AssetTools | Engine module (editor module only) | The CrimsonObjectPoolEditor module. |
Pooling a class you cannot edit
The actor contract,
ICrimsonPoolable, ships in this plugin. For an actor class you cannot add an interface to - a class from another plugin, or third-party code - register an ICrimsonPoolableAdapter for it instead, and the pool calls the adapter wherever it would have called the interface. See How-To: Make an Actor Poolable.Using with other Crimson plugins
CrimsonObjectPool works alone. When you own other Crimson plugins, CrimsonCore contains the full-suite wiring for it in
Source/CrimsonCore/{Public,Private}/Integration/ObjectPool/: UCrimsonCoreProjectilePoolingSubsystem registers an ICrimsonPoolableAdapter for the CrimsonHitDetection projectile, and CrimsonCore's pooled launch tasks (UCrimsonAbilityTask_LaunchPooledProjectile) acquire projectiles from the pool with no extra code. To wire it yourself, see CrimsonCommon -> Concept: Connecting Crimson Plugins; for what CrimsonCore installs, see CrimsonCore -> Concept: The Integration Layer.Where to go next
- New here? Quick Start - pooling a cosmetic actor end to end, in about five minutes.
- Actor needs to control its own reactivation, reclaim itself, or belongs to a class you cannot edit? How-To: Make an Actor Poolable.
- Pooling something that replicates? How-To: Pool a Replicated Actor - read this one before you write the code, not after.
- Deciding capacities? How-To: Size and Prewarm a Pool.
- Something is behaving oddly? How-To: Diagnose Pool Problems.
- Want the model rather than the recipe? Concept: The Reuse Contract and Concept: Replication and Recycling.
- Need an exact signature? API Reference.