PCG Volumes vs Blueprints Cost / Expense

Question for the community here about actor queries with PCG.
How expensive is the get all world actors if i have it set to overlapping only ?

Does it still cost the same as a get all actors in the world without overlaps ?

I am engineering a PCG and have found volume based spline queries faster in the editor (but slower in the profiling tools vs a component based PCG)

Thank you, happy Monday everyone :slight_smile:

1 Like

Great question. I’ve been wondering the same thing. I wish there was a quick way to see the cost of some of these nodes. I typically try to just look at the type of function they are running and can usually tell based on size of query and whether they are constant, exponential, quadratic functions. I just don’t want to have to run timing tests on every single node. But in PCG, I noticed a lot of the Execute Blueprint options they have seem quite bloated for what they do in. I just assume normally less (non-blueprint) nodes are better as a quick rule of thumb. To me, doing All World Actors seems very expensive since it queries everything in the world vs within the bounds. That would reduce the query immediately. I guess the less you give it to query from the beginning, the better.

Good question,

So as far as queries go, it’s faster if you query by actor class, but otherwise, providing bounds or not isn’t going to be better, because there’s no octree for actors in the engine (at least, as far as I know).
There’s an horizon where maybe we could build one internally/cache some things and/or use physics queries to gather those, but all of these options come with limitations and require some dev time.

Otherwise, for profiling, there’s a few ways for you out there:

1- there’s a profiling window in the PCG editor. You just need to select a debug object to see it populate. Extremely helpful. Note however, that when re-executing, results that are in the cache will be greyed out (and appear as zeroes). You might want to do a flush-cache + regen to get the “worst case” results. You can do so with a alt+click on the regenerate button in the editor.

2- you can profile (-trace cpu), run unreal insights and see all the gory details, you’ll see everything PCG in there.