Need Help With Event Tick Frame Rate Drop Over Time

4.9.1

Hi, I have a project where there are 30+ actors with widgets and with event tick I am setting the transparency of the widget via distance to actor from the player. Over time around 30 seconds the frame rate begins to drop from around 70 to around 15 and lower gradually. Ive hacked it at the moment feeding the event tick through a number of flip flops to get the every 16th tick to fire a pin. But this only works for so long.

Is this a bug or am I doing something wrong?

Also make sure you’re not accidentaly spawning a new actor or object every tick.
using “stat Memory” should help you find out if you are increasing your memory use with each frame.

it could be both, is there any part of the code path, that is creating/adding to something that might generate a very large memory requirement, such that after 30 seconds (i.e. 70 fps would be 2100 calls at the end of 30 seconds), so if your generating something, that is constantly consuming memory (yes it would have to be a lot), you could see a slow down in the blueprint, if you have a search function, etc of say an array, etc.

This is just guessing, as there is really not enough information to know, so just a thought.

Hope this helps,

I had a similar case once before.

Is there any chance you are creating and adding new widgets to your view port on event tick?

Because it sounds exactly like that one case I once had. It tanks really hard soon because hidden widgets (if one is behind another) aren’t ignored but still fully rendered meaning after a while it will take forever to render all the pixels even though 99% are exactly the same pixels above of each other.

So I figured out what this was, the bug only occurs in play in editor mode where I had a loop causing an error every tick which wrote the error 1000 times every 2 seconds or so.

ahhh tytyty this was my problem i was drawing the hud every frame or something.

This solved it for me. Thank goodness!

This was the problem I was having. My game would lag over time as the game progressed. The problem was hooking a HUD draw up to an event tick. My hud was only a small aim circle in the middle of the screen, but because it was being redrawn over and over on every tick, it was causing massive frame rate drops. Solution; only draw a hud on a one-time event (like eventbeginplay or something similar). Thanks for all these answers, thought the problem was something massive, but it was very easy to fix.