DonaldW's github pages
Unreal Source Explained (USE) is an Unreal source code analysis, based on profilers.
For more infomation, see the repo in github.
See Table of Contents for the complete content list. Some important contents are listed below,
#Loop
Every game is running frame by frame. Inside one frame, several submodules are called sequentially. This routine is known as Game Loop.
Inside FEngineLoop::Tick()
(link), there are many hardcoded submodules’ ticks get called sequetially. This following image is the tick overview, however, it’s sorted by the CPU Time, not the calling order.
Calling order is important, it’s one of the reasons that lead to one-frame-off bugs.
The general rule is: if statusa is depended by statusb, then statusa should gets updated earlier than statusb inside one frame.
This seems to be easy, but if there are lots of status, and the dependecies are complicated, it needs lots of effort to achieve correct status update order.
But luckily, lots status dependecy don’t care correct update order at all because their one-frame-off usually dont’t result in visually noticeable motion. For other crucial status (e.g., camera, character), they still demands correct update order.
So, here is some important call extractions from FEngineLoop::Tick()
, sorted by the calling order:
FCoreDelegates::OnBeginFrame
(link);UEngine::UpdateTimeAndHandleMaxTickRate()
(link)FIOSApplication::PollGameDeviceState()
(link);UGameEngine::Tick()
(link), this is the most important call among others;FEngineLoop::ProcessLocalPlayerSlateOperations()
(link);FSlateApplication::Tick()
(link);FTicker::Tick()
(link)FCoreDelegates::OnEndFrame
(link)