Set relative location takes a lot of performance!

I’m doing a round based multiplayer sorta board game. Each player has 35 tiles which are actors, the meshes have just a couple of polys and simple collisions but they also have a few hidden components and they all use dynamic material effects but not while moving.

Now all 35 actors are attached to each players board by attaching it to a arrow component inside that board actor which moves each round by a timeline with set relative position in blueprint, so there are just 2 components which get set a set relative position at update of the timelines. I’m running it with the 2 player option in the editor, without movement it is 40 fps and with movement it is only 18 fps!

What is the reason for that huge FPS drop? Any ideas what I can do to improve it?

I think that might be related to blueprint performance overall, blueprint is 10x slower then native code, if you have too much blueprint operations per frame it will kill the performence thats why you should not overuse tick in blueprint ot timeline.

Type in console “stat game” and there should be blueprint time, if it’s bigger then 16ms it means blueprint will drive game lower then 60FPS

1 Like

While not moving, blueprint time it is at ca 2ms, while moving it gets slowly up to a average of 18ms. There are not many blueprint operations going on, it is a turn based game. While moving the only thing really happening is those 2 timelines with set relative position. Do I have to assume that moving the parent also updates all childs each ticks separately through BP and also all the components of those child actors? Is there any other way to move a actor with childs that is not so performance costly?

It is lot of operations going on, since timeline is running blueprint on everyframe for each object you use it (and you mentioned you have 35 of them), similar to tick, solution here would be either move timeline (or rether tick) to C++ or try using some movement component or try using matinee insted of timeine (you can use actor child component)

Well, it is just 2 timelines running at once,one for the board of player 1 on which the 35 tiles are attached and one for player 2. I have no clue how set position is handled at runtime with childs though. Matinee might be a good option since it is interpolating position, it is just pretty annoying that matinee has to be inside the level and in the level blueprint. I wish there would be something like matinee instead of timelines, interpolating position instead of setting position each tick makes much more sense from my understanding. Well, will see how it works out.

I hinted child actor component ;] it let you use actors as components

I tried matinee instead which resulted in the same fps, interestingly Blueprint tick time remained only 2ms while moving but overlap tick time went up to a avg of 12ms which it didn’t with the set position movement. I then went to turn off all Generate Overlap Events of all the components in the Tile BP. After that fps is improved to 30 fps while movement and that for both, matinee and set position. Generate Overlap Events appears to be always default on, I guess a good rule of thumb is then to always turn it off and only turn it on when needed.
I should be able to improve performance a bit more by getting rid of as many components as I can in the Tile BP and then create and delete components where needed.