FoliageInstanceBase.cpp crashing on load

Have been working very hard on a scene for a client complete with incremental saves for just this reason…I don’t know what I did but now when I load it and any of the previous versions of the it crashes on load. Here is the crash report:

MachineId:E3904E87430896E4F032E6B793885FB7
EpicAccountId:738fb2f0e13447d9b38554148b052472

Fatal error: [File:D:\Build++UE4+Release-4.12+Compile\Sync\Engine\Source\Runtime\Foliage\Private\FoliageInstanceBase.cpp] [Line: 90]
Instance base cache - integrity verification(3): Counter: 147 Size: 146, InvSize: 145 (L:1 S:0 T:0)

UE4Editor_Core!FDebug::AssertFailed() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\misc\outputdevice.cpp:440]
UE4Editor_Foliage!operator<<() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\foliage\private\foliageinstancebase.cpp:93]
UE4Editor_Foliage!AInstancedFoliageActor::Serialize() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\foliage\private\instancedfoliage.cpp:2247]
UE4Editor_CoreUObject!FLinkerLoad::Preload() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3293]
UE4Editor_CoreUObject!EndLoad() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:1411]
UE4Editor_CoreUObject!LoadPackageInternal() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:1171]
UE4Editor_CoreUObject!LoadPackageInternal() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:1286]
UE4Editor_UnrealEd!UEditorEngine::Map_Load() [d:\build++ue4+release-4.12+compile\sync\engine\source\editor\unrealed\private\editorserver.cpp:2397]
UE4Editor_UnrealEd!UEditorEngine::HandleMapCommand() [d:\build++ue4+release-4.12+compile\sync\engine\source\editor\unrealed\private\editorserver.cpp:5987]
UE4Editor_UnrealEd!UEditorEngine::Exec() [d:\build++ue4+release-4.12+compile\sync\engine\source\editor\unrealed\private\editorserver.cpp:5477]
UE4Editor_UnrealEd!UUnrealEdEngine::Exec() [d:\build++ue4+release-4.12+compile\sync\engine\source\editor\unrealed\private\unrealedsrv.cpp:744]
UE4Editor_UnrealEd!FEditorFileUtils::LoadMap() [d:\build++ue4+release-4.12+compile\sync\engine\source\editor\unrealed\private\filehelpers.cpp:2135]
UE4Editor_LevelEditor!FLevelEditorActionCallbacks::OpenRecentFile() [d:\build++ue4+release-4.12+compile\sync\engine\source\editor\leveleditor\private\leveleditoractions.cpp:254]
UE4Editor_LevelEditor!TBaseStaticDelegateInstance::ExecuteIfSafe() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:1021]
UE4Editor_Slate!FUICommandList::ExecuteAction() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\slate\private\framework\commands\uicommandlist.cpp:87]
UE4Editor_Slate!SMenuEntryBlock::OnClicked() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\slate\private\framework\multibox\smenuentryblock.cpp:1027]
UE4Editor_Slate!SMenuEntryBlock::OnMenuItemButtonClicked() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\slate\private\framework\multibox\smenuentryblock.cpp:987]
UE4Editor_Slate!TMemberFunctionCaller::operator()<>() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\core\public\delegates\delegateinstanceinterface_variadics.h:161]
UE4Editor_Slate!TTupleImpl >::ApplyAfter_ExplicitReturnType >() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\core\public\delegates\tuple.h:128]
UE4Editor_Slate!TBaseSPMethodDelegateInstance<0,SMenuEntryBlock,0,FReply __cdecl(void)>::Execute() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:321]
UE4Editor_Slate!TBaseDelegate::Execute() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:521]
UE4Editor_Slate!SButton::OnMouseButtonUp() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\slate\private\widgets\input\sbutton.cpp:275]
UE4Editor_Slate!SMenuEntryButton::OnMouseButtonUp() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\slate\private\framework\multibox\smenuentryblock.cpp:385]
UE4Editor_Slate!::operator()() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:4598]
UE4Editor_Slate!FEventRouter::Route >() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:215]
UE4Editor_Slate!FSlateApplication::RoutePointerUpEvent() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:4587]
UE4Editor_Slate!FSlateApplication::ProcessMouseButtonUpEvent() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:5041]
UE4Editor_Slate!FSlateApplication::OnMouseUp() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:5021]
UE4Editor_Core!FWindowsApplication::ProcessDeferredMessage() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\windows\windowsapplication.cpp:1510]
UE4Editor_Core!FWindowsApplication::DeferMessage() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\windows\windowsapplication.cpp:1850]
UE4Editor_Core!FWindowsApplication::ProcessMessage() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\windows\windowsapplication.cpp:745]
UE4Editor_Core!FWindowsApplication::AppWndProc() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\windows\windowsapplication.cpp:667]
user32
user32
UE4Editor_Core!FWindowsPlatformMisc::PumpMessages() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\windows\windowsplatformmisc.cpp:903]
UE4Editor!FEngineLoop::Tick() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2729]
UE4Editor!GuardedMain() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\launch.cpp:148]
UE4Editor!GuardedMainWrapper() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll

Hi,

Sorry about these troubles. This is fixed for 4.13, and your map will load without crashes with a new release. If you have source code you can edit FoliageInstanceBase.cpp and replace all entries of

UE_LOG(LogInstancedFoliage, Fatal 
to 
UE_LOG(LogInstancedFoliage, Warning

That will allow to load crashing map in 4.12.

I am having this same problem. I modified the .cpp file as you noted above but doesn’t this have to be compiled in some manner?

You’ll need to be using a source build of the engine from Github before you are able to make the necessary changes to the source. The binary version from the Launcher will not allow you to make the changes.

Have a great day

Thank you my God for this answer! Thanks guys, with this fix its working like a charm! Have you saved my project.

Just found this answer and thought I just had to say thank you!!! I thought I was literally going insane, but it just turned out to be a UE4 bug. Guess I’ll have to migrate to a newer UE4 version. However, when I did that last, the landscape I had created went into a wacky reflective colour. Is there any way too avoid this?
Many thanks EPIC STAFF

Glad to see that other people have found some help on this subject…it has definitely helped me to learn to make tweaks to the source etc