IGameMoviePlayer playback of a movie during loading screen lets you set bAllowEngineTick = true as a parameter. This will make FDefaultGameMoviePlayer manually tick the engine:
if (GEngine && bAllowEngineTick && LoadingScreenAttributes.bAllowEngineTick) { GEngine->Tick(DeltaTime, false); }
However, it does not update the timestamp that is used to calculcate DeltaSeconds during normal ticking, which LaunchEngineLoop calls with
GEngine->UpdateTimeAndHandleMaxTickRate()
This results in a high value for FApp::GetDeltaTime() when the movie finishes playing and normal ticking resumes. FApp::GetDeltaTime() is used as delta seconds in FEngineLoop::Tick():
GEngine->Tick(FApp::GetDeltaTime(), bIdleMode);
So this leads to an incorrect DeltaSeconds for systems that have ticked in the meantime.
The fix may be to call GEngine->UpdateTimeAndHandleMaxTickRate() inside FDefaultGameMoviePlayer. However, perhaps more logic from FEngineLoop::Tick() should also be handled when playing a movie. Logging this task so someone can properly evaluate this.
void AMyPlayerController::Tick(float DeltaSeconds) { Super::Tick(DeltaSeconds); if (FApp::GetDeltaTime() > 5.0f) { UE_LOG(LogTemp, Error, TEXT("AAA | Long FApp::GetDeltaTime: %.2f"), float(FApp::GetDeltaTime())); } }
// Manually bring up loading screen FLoadingScreenAttributes LoadingScreen; LoadingScreen.bAutoCompleteWhenLoadingCompletes = false; LoadingScreen.WidgetLoadingScreen = FLoadingScreenAttributes::NewTestLoadingScreenWidget(); LoadingScreen.bAllowEngineTick = true; LoadingScreen.MoviePaths.Add("DummyMovie"); // Put a 10+ seconds long DummyMovie.mp4 in /Content/Movies LoadingScreen.bMoviesAreSkippable = false; GetMoviePlayer()->SetupLoadingScreen(LoadingScreen); GetMoviePlayer()->PlayMovie();
How does TextureRenderTarget2D get TArray<uint8> type data?
How do I set a material as a post-processing material?
Why does the REMOVE method of map container remove elements have memory leaks?
How to delete some elements correctly when deleting an array loop?
What is the cause of the packaging error falling back to 'GameUserSettings' in ue5?
What is the difference between Camera and CineCamera?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-207172 in the post.
0 |
Component | UE - Gameplay |
---|---|
Affects Versions | 5.1, 5.2, 5.3 |
Created | Feb 16, 2024 |
---|---|
Updated | Sep 4, 2024 |
12076 - m-grunwald |