Unreal - Tick Functions, Delta Time, and the Task Graph
(The full post is now published at http://www.recursiveblueprints.fun/unreal-delta-seconds/)
All video games need to execute code before rendering a frame. The Tick() function is the core mechanism in Unreal that allows your game to execute code every single frame.
Ticking in UE is more complex than you might think, so let's go on a bit of deep dive into how it works. To follow along, you should have a basic understanding of what Tick() is and how it's used in Unreal. If you're unsure about the basics of ticking, or are a little rusty, Epic has a great overview right here .
There are actually two different ticking implementations you can leverage in UE.
The first uses FTickFunction and supports features like TickGroups,TickIntervals,TickDependencies. This is what AActor uses.
The second is is for gamethread tickable objects. To use, just inherit from FTickableObjectBase and override tick. It is ticked by UWorld::Tick after all the other groups fire. It is often used by object managers like Niagara, AI, Sequencer, and NetworkReplayStreaming.
Understanding UE ticking also helps immensely when using profiling tools, as they are typically the top level code you drill into when you are cpu bound.
(Read the full post at http://www.recursiveblueprints.fun/unreal-delta-seconds/)