Hi everyone!!
I’m working on a physics-based conveyor system in Unreal Engine, and I’m running into performance bottlenecks. I want to share my setup and experiments to see if anyone has ideas for improvement.
Setup details:
-
Each item is a Blueprint, and each conveyor is also a Blueprint.
-
Conveyors have an Overlap Box that detects when an item enters.
-
On BeginOverlap, the item’s Primitive Component is stored in an array; on EndOverlap, it’s removed.
-
Every 0.05 seconds, a function loops through the array and applies Add Linear Force to each primitive. I’ve also tried Add Impulse and Add Force, but performance is similar or worse.
Things I’ve tried to optimize:
-
Using an Event Timer (0.05s) and then Tick to avoid creating many parallel functions. The timer stops when the array length is 0, though for my tests this doesn’t happen because many conveyors and items are constantly moving.
-
Async Tick in UE5.4+ for physics.
-
Having a BP manager that holds a single array of all items in the scene, so only one function/tick iterates over thousands of items instead of each conveyor having its own function/tick.
Performance observations:
-
Around 2k items seems to be my bottleneck.
-
In UE 4.27, most of the time is spent in GPU and Game Thread.
-
In UE 5.4+, looking in more detail, Overlaps seem to be the main cost.
-
I used to have draw call issues, but those are already solved.
-
I’ve tested UE 5.4 – 5.7 and 4.27; results are consistent with 2k actors dropping FPS to ~30.
Other optimization settings:
-
Physics-simulated actors have shadows off.
-
Overlaps are only enabled for a custom Object Type, everything else ignored.
-
Items and conveyors use simple block collision.
Questions:
-
Is there a better way to move items with physics on conveyors more efficiently?
-
Can 10k actors at 30 FPS+ realistically be achieved in Unreal using physics?
-
Any advice on using Unreal Insights effectively to find the bottlenecks?
Last test I made was in 4.27.2 since ppl say performance with physicx its better, didnt find it much better, probably even worst since I had to disable A LOT of stuff to make it comparable to 5.4+, created a zip with a dev package in case you wanna check it: Unique Download Link | WeTransfer
Thanks in advance for any advice!