How can I optimise many actors in world?

Seems like you execute too much logic inside your blueprints that is slowing you down (or you just have too many active blueprints that all execute logic).

Approximately how many actors/fishes did you have in your level when you took those stat informations? And how many do you need (so if you would have a system that would activate/inactivate them based on the distance to the player, then how many active actors/fishes would you need?)

Oh really do you think so?

The screenshot was taken in the most densely populated area of my level, around 250 fish actors, which is about as high as I intend to go

C++ should be an option to use, not avoid. I suggest very strongly that you learn it.

Others have suggested particle effects. Also try LoDs. Maybe you can use ISMs, HISMs, etc.

Also try vertex animations:

Good luck.

Ok, if you only have 250 fish actors, then next step you could do would be to get a deeper look into the GameThread. So take a performance profile and look through it: How to improve game thread CPU performance in Unreal Engine - Unreal Engine

So, Cogganator: we’ve done the ‘stat wotsit’ thing and found out what we already knew, you scene is using a lot of tick.

A couple of questions to get you further:

  1. What fps do you get with no fish in the scene?

  2. Are your fish just a skelatel mesh moving on timeline? ( and you have 250 right? )

Hmm I get around 45 fps with an empty scene, and my fish are moving with event tick, and with some animation ontop of that powered by a timeline.

Also, thanks so much for all the help so far it’s already proving quite helpful to me

Thanks for that i’ll give it a look

You cannot have tick on every actor in the scene. That’s the problem.

The flyweight design pattern mentioned above is a good start. The Publisher/Subscriber pattern is good too.

In this pattern, a BP_FishController (publisher) calls a Swim function in each BP_Fish (subscriber). The Swim function determines the movement for each fish independently. This can be done every tick. So now, only one actor (BP_FishController) is on Tick, and not 500 or so. You can use message delegates, register each fish in an array, or use a “GetAllActors” node.

Hi! - ok so the scene probably could use work apart from the fish. I’m assuming the main places to look with this sort of thing would be:

  1. Landscape

  2. Water

  3. Foliage

If you want to know which of them is killing it the most ( make sure you disabled auto-save ) just delete them in turn and watch the fps.

Come back on that one if you want. Also, what’s the machine spec?

Now:

So your fish are sucking frames. I’m still in the ‘somehow cut down the number of fish near the player’ camp, but there’s something else to try.

Go into each fish and change:

the tick interval to .02 ( possibly between .01 and .02 )

Very roughly speaking, that’s gonna make them tick half as much. For the timeline, it wont make any difference, but for the things on tick, they will move half as fast, unless you have already compensted for machine power using ‘world delta seconds’.

Try a few a first, see what it’s like. When you strike the right zone, they will be a tiny bit jerky ( very slight ), but will be using much less CPU.

Also, could you show what you have a tick in your typical fish?

:slight_smile:

Yes, you can :slight_smile:

I’ve done it with 150 fish no problem. I just needs tuning…

150 is not many, or do you mean 150 types of actor?

It is a pain, and you have to find a clever way around it.

For sure, some sort of instancing, but you need to change to an actor when the player wants to interact.

I also have a similar problem, im making a big open world survival game with over 150 actors in world, like trees that can be cutted down, stones that can be mined, etc
How should i implement the culling thingy?
I started by spawning everything wiht everything off, its working well, and the player has a sphere with a begin overlap and when something overlaps with it it become visible, but i forgot that i made them spawn with everithing off, so it has no collision, so no overlap, so no begin overlap event.
What should i do?|
I tried cull distance volume, i have LOD’s on everything.

i meant 150.000 actors, im curious how big games do it, like ark survival evolved, 7 days to die, etc.
How they manage to do it.

I have no idea actually, but it will be stuff like instancing and HLODs.