I’m currently working on a galaxy-wide game using UE5. The UE 5.3.2 game engine kept crashing when I moved from a planet to one of its moons (not vice versa) or when I entered a different planetary system.
The following is the stack trace I was getting:
Assertion failed: IntFitsIn<OutType>(In) [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Templates\UnrealTemplate.h] [Line: 163] Loss of data caused by narrowing conversion
UnrealEditor_Renderer!FSceneRenderer::AddViewDependentWholeSceneShadowsForView() [D:\build\++UE5\Sync\Engine\Source\Runtime\Renderer\Private\ShadowSetup.cpp:5198]
UnrealEditor_Renderer!FSceneRenderer::CreateDynamicShadows() [D:\build\++UE5\Sync\Engine\Source\Runtime\Renderer\Private\ShadowSetup.cpp:5786]
UnrealEditor_Renderer!FGatherShadowPrimitivesPrepareTask::DoTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Renderer\Private\ShadowSetup.cpp:4724]
UnrealEditor_Renderer!TGraphTask<FGatherShadowPrimitivesPrepareTask>::ExecuteTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:1265]
UnrealEditor_Core!`LowLevelTasks::FTask::Init<`FTaskGraphCompatibilityImplementation::QueueTask'::`5'::<lambda_1> >'::`11'::<lambda_1>::operator()() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\Fundamental\Task.h:499]
UnrealEditor_Core!LowLevelTasks::TTaskDelegate<LowLevelTasks::FTask * __cdecl(bool),48>::TTaskDelegateImpl<`LowLevelTasks::FTask::Init<`FTaskGraphCompatibilityImplementation::QueueTask'::`5'::<lambda_1> >'::`11'::<lambda_1>,0>::CallAndMove() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\Fundamental\TaskDelegate.h:171]
UnrealEditor_Core!LowLevelTasks::FTask::ExecuteTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\Fundamental\Task.h:627]
UnrealEditor_Core!LowLevelTasks::FScheduler::ExecuteTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\Fundamental\Scheduler.cpp:150]
UnrealEditor_Core!LowLevelTasks::FScheduler::TryExecuteTaskFrom<LowLevelTasks::TLocalQueueRegistry<1024>::TLocalQueue,&LowLevelTasks::TLocalQueueRegistry<1024>::TLocalQueue::DequeueLocal,0>() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\Fundamental\Scheduler.cpp:350]
UnrealEditor_Core!LowLevelTasks::FScheduler::WorkerMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\Fundamental\Scheduler.cpp:378]
UnrealEditor_Core!UE::Core::Private::Function::TFunctionRefCaller<`LowLevelTasks::FScheduler::CreateWorker'::`2'::<lambda_1>,void __cdecl(void)>::Call() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Templates\Function.h:480]
UnrealEditor_Core!FThreadImpl::Run() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\HAL\Thread.cpp:69]
UnrealEditor_Core!FRunnableThreadWin::Run() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:149]
In order to resolve this issue I had to change the Shadow Map Method from “Virtual Shadow Maps” to “Shadow Maps.”
It looks like VSMs were in beta in UE 5.0:
UE 5 Docs: Virtual Shadow Maps