jeudi 8 janvier 2026

Unreal Engine 5 : Tick groups

Introduction

On game it's sometime to have shape who can control tick speed on actor in this shape. Like a streaming system, object which are far for the player but visible don't need to tick as the same speed as actor near the player.

The idea is inspire by Sea of Thieve talk about managing the tick scale (https://www.unrealengine.com/en-US/events/unreal-fest-europe-2019/aggregating-ticks-to-manage-scale-in-sea-of-thieves)

Architecture

The Idea is to use a subsystem call TickGroupSubsystem which will manager the tick group system. A tick group system have shapes where ticking actor are inside. Depend on if player are inside or near theirs volume, tick group volume will have different tick interval.

When game start, Tick group volume get TickGroupSubsystem and register in it. If actor needs to be inside a TickGroupVolume, user have to add GSTickGroupClient. This component will register actor inside a volume

 The Update Tick Group System

When player spawn, tick group system will detect on which Tick Group volume the player is in. The tickgroup volume will tick are full speed (0.0 tick interval) , for the demo surrounding will tick as lower frequency. Because on this demo it's for a linear game , we just take previous and next tick group of the player current tick group volume

 Tick Group video 

 Github : https://github.com/NicolasBunn/UE5TickGroup.git 

 

  

 

 

dimanche 4 janvier 2026

Unreal Engine 5 : Pool Manager & Projectile Optimization

Features

Pool

Pool system is use to recycle memory and avoid to spawn actor every time it need. Even Unreal Engine have his owns system, every time we spawn actor, it's has to made all the process of actor instantation (memory allocation, component initialization, and constructor execuion, begin play etc etc) which are expensive. On game user can feel a hitch (CPU). 

 By using a pool system, actor are spawn at the beginning in the game on background (hidden,no tick,no collision). When player shoots, we extract a bullet from the pool and make it active

My pool have 2 array : _available_bullet and  _active_bullet . The idea is to eliminate useless iteraction to check to see if bullet is active. When a bullet is need, _available_bullet transfert his bullet to active_bullet. Add a actor on a array it' 0(1) and to avoid that when we delete the actor, array have to reorganize the array, we using RemoveAtSwap.

 Don't use Unreal Engine overlaps

Every time an actor are moving in Unreal. The engine have to : 

- Update Transforms to recompute actor location 
- Spatial Partitioning Update : Unreal reorganize his Bounding Volume Hierarchy , by moving the actor.
- And redo the Collision detection system. 

And this every time the bullet is moving, which happen quite a lot.
For a simple bullet which are moving straigh line it's may be too much. That why I remove the Projectile Component oftenly use on Projectile. Because the bullet goes straigh line, I don't need a heavy component like Projectile Component of Unreal. 

Instead I use a simple travel mathematic function (ActorLocation + velocity * deltatime) and for detection a SweepTrace is enough. The code always destroy bullet and don't manage the interaction.It'sa demo . I also remove Tick and Collision that way Unreal don't add for detection and Tick system which can be an optimization if the pool contain a lot of bullet

Github repository : https://github.com/NicolasBunn/UnrealEnginePoolSystem.git