Download

Optimization: Event Tick vs Timeline

Hello Everyone,

I’ve heard that excessive use of the Event Tick can be harmful to your FPS and performance. I am currently optimizing and cleaning up my project to make it a lot more manageable. I was wondering if a loopable timeline set to update every few seconds or so would be a replacement. Will having lots of timelines hinder performance? The Timelines would likely fire from an Event Begin Play node connected to a sequencer ( in case I may need to use multiple timelines for various tasks).

If this isn’t the best solution to using Events Ticks, what would be a better way to achieve the same thing?

I am sure I read somewhere timeline is a good replacement for tick, it uses the animation tick instead but it’s not guaranteed to fire every single tick so if you have something that needs to be tick based it may not be right.

I think that timeline is better just because you can fire exec pin a certain interval. For example every 0.5 seconds. So it will be much better that tick, if u have complex logic.

Before going further with optimizations, have you confirmed which Blueprints are in need of optimization? A timeline being fired every Tick may not be as expensive as lots of Nodes firing simultaneously from an Event.

Raise, oh dead thread. Raise from dead to the world of living! :]

I actually think you are wrong!

Don’t forget that you can bind and unbind events to/from Tick.

UTimelineComponent consumes a lot of RAM. imagine having 10 timelines in your actor - it’s around 500bytes wasted RAM per instance!

Instead, you lads can just bind something to tick event, and after it stops executing - unbind it. no RAM will be wasted, as well as Tick preserved clean.
I would like to hear critics about that method if somebody thinks i’m wrong.

I think the real problem with tick is in trying to do too much in the tick interval - especially when you multiply that by several actors. You can link all sorts of things to tick but ultimately if you’re not careful - you’ll get to a point where your execution path doesn’t have time to finish before the next tick starts. There’s a place for tick, obviously, or it wouldn’t be there, but a lot of things can be handled more smoothly using timers and timelines.

Doing to much in tick doesn’t make a difference to doing to much in timelines or timers. Tick will fire every frame, if you do too much your framerate will simply drop. Unless timers and timelines prioritize being on time rather then doing all you ask… ? I guess the latter also just execute everything you put in them.

But indeed, not everything has to be updated every tick. You can set tick interval per actor though, not sure how stable that is. Or use timers.

So the question is, tick, timer or timelines?

I currently do have a timeline for each property i want to animate in an actor. Those actors are spawned from a factory actor, so if i want same change for all it’s children i use a timeline in the factory instead, then foreach from that.

My timelines are mostly just 0-1 ranges where i set play rate to 1/duration to control it’s length, then lerp with that alpha value, setting the initial and target value to a property before i fire the timeline.

I guess i’m almost doing what i would need to do with timers and tick eh.

Ha, seems you can actually set the tick interval of timelines too…

… and you can suspend tick when you don’t need it.

You can also use timers by function name. Just set their interval to whatever frame rate (1/desired frame rate) you want the functions to be updated at. Not everything needs to be on tick. There are plenty of things that do just well at 10-20 ticks per second. They are also a breeze to turn on and off when you don’t need them.

Yeah, the event based timers quickly mess up your graph since they are all public.

Not if they are implemented correctly… I use the hell out of them and have never had any issues like that.

Question, Cannot find an answer for this any where!

Which of the following would be more efficient on say an **escalator **moving? In this Epic training video to create an excalator he uses tick: https://www.youtube.com/watch?v=aqRUe7pm4Ok
I have watched a few training Videos from Epic that say to never use tick because it is so inefficient. In the comments of one of the videos I asked what you are supposed to use for a line trace if you cannot use tick, but no one responded. I ended up changing my line trace to use Event Timer set to loop at second = .01, would it be better to use an Tick instead of the Event Timer? I changed the Event Timer to .1 but it was too sluggish and had to change it back to .01.

  1. Tick
  2. Event Timer set to loop at second = 1
  3. Event Timer set to loop at second = .1
  4. Event Timer set to loop at second = .01

So not have good answer what good way use, so sad Dudes(

I don’t what is good or bad but If I want to be able to manipulate time in game with Set Global Time dillation it only works with time lines.And its damn fun. Till it breaks