Unreal Engine 5.1 crashes when I switch to Landscpa mode.

I have been working on this project for quite some time and everything was working fine, but one day I started the engine and ervy time I try to enter Landscape mode it crashes.

Assertion failed: (DefaultAlphaTexture != nullptr) && DefaultAlphaTexture->Source.IsValid() [File:D:\build++UE5\Sync\Engine\Source\Editor\LandscapeEditor\Private\LandscapeEditorObject.cpp] [Line: 541]

UnrealEditor_LandscapeEditor!ULandscapeEditorObject::SetAlphaTexture() [D:\build++UE5\Sync\Engine\Source\Editor\LandscapeEditor\Private\LandscapeEditorObject.cpp:541]
UnrealEditor_LandscapeEditor!ULandscapeEditorObject::Load() [D:\build++UE5\Sync\Engine\Source\Editor\LandscapeEditor\Private\LandscapeEditorObject.cpp:231]
UnrealEditor_LandscapeEditor!FEdModeLandscape::Enter() [D:\build++UE5\Sync\Engine\Source\Editor\LandscapeEditor\Private\LandscapeEdMode.cpp:589]
UnrealEditor_UnrealEd!ULegacyEdModeWrapper::Enter() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\Tools\LegacyEdMode.cpp:286]
UnrealEditor_UnrealEd!FEditorModeTools::ActivateMode() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorModeManager.cpp:911]
UnrealEditor_LevelEditor!SLevelEditor::ToggleEditorMode() [D:\build++UE5\Sync\Engine\Source\Editor\LevelEditor\Private\SLevelEditor.cpp:1677]
UnrealEditor_LevelEditor!TBaseSPMethodDelegateInstance<0,SLevelEditor,1,void __cdecl(void),FDefaultDelegateUserPolicy,FName>::ExecuteIfSafe() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:312]
UnrealEditor_Slate!FUICommandList::ExecuteAction() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Commands\UICommandList.cpp:111]
UnrealEditor_Slate!SMenuEntryBlock::OnClicked() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\MultiBox\SMenuEntryBlock.cpp:1148]
UnrealEditor_Slate!SMenuEntryBlock::OnMenuItemButtonClicked() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\MultiBox\SMenuEntryBlock.cpp:1108]
UnrealEditor_Slate!TBaseSPMethodDelegateInstance<0,SMenuEntryBlock,1,FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:295]
UnrealEditor_Slate!SButton::ExecuteOnClick() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Widgets\Input\SButton.cpp:465]
UnrealEditor_Slate!SButton::OnMouseButtonUp() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Widgets\Input\SButton.cpp:390]
UnrealEditor_Slate!SMenuEntryButton::OnMouseButtonUp() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\MultiBox\SMenuEntryBlock.cpp:434]
UnrealEditor_Slate!<lambda_51e270ca99ea7ce852539efd04dd453f>::operator()() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5046]
UnrealEditor_Slate!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,<lambda_51e270ca99ea7ce852539efd04dd453f> >() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:412]
UnrealEditor_Slate!FSlateApplication::RoutePointerUpEvent() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5032]
UnrealEditor_Slate!FSlateApplication::ProcessMouseButtonUpEvent() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5601]
UnrealEditor_Slate!FSlateApplication::OnMouseUp() [D:\build++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5566]
UnrealEditor_ApplicationCore!FWindowsApplication::ProcessDeferredMessage() [D:\build++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2219]
UnrealEditor_ApplicationCore!FWindowsApplication::DeferMessage() [D:\build++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2726]
UnrealEditor_ApplicationCore!FWindowsApplication::ProcessMessage() [D:\build++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:1895]
UnrealEditor_ApplicationCore!FWindowsApplication::AppWndProc() [D:\build++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:925]
user32
user32
UnrealEditor_ApplicationCore!FWindowsPlatformApplicationMisc::PumpMessages() [D:\build++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsPlatformApplicationMisc.cpp:142]
UnrealEditor!FEngineLoop::Tick() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5291]
UnrealEditor!GuardedMain() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:202]
UnrealEditor!GuardedMainWrapper() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:107]
UnrealEditor!LaunchWindowsStartup() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:244]
UnrealEditor!WinMain() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:282]
UnrealEditor!__scrt_common_main_seh() [D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll

Does anybody know waht I can change to stop it from crashing?

1 Like

You could try verifying your unreal engine install. Did you have “Show engine content” on and delete any of the engine materials / textures?

DefaultAlphaTexture being nullptr would imply that it is not finding the alpha texture (probably for the sculpting brush)

DefaultAlphaTexture.uasset (3.8 KB)

1 Like

Also, validating the EditorLandscapeResources folder (where that texture is stored) shows no errors:

image

I also started getting this error yesterday after some intensive landscape editing. The error is specific to the project I am working on - other projects and new projects are fine.

Confirmed the texture is present:

image

Full error dump:

Assertion failed: (DefaultAlphaTexture != nullptr) && DefaultAlphaTexture->Source.IsValid() [File:D:\build++UE5\Sync\Engine\Source\Editor\LandscapeEditor\Private\LandscapeEditorObject.cpp] [Line: 541]

UnrealEditor_LandscapeEditor
UnrealEditor_LandscapeEditor
UnrealEditor_LandscapeEditor
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor_LevelEditor
UnrealEditor_LevelEditor
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_ApplicationCore
UnrealEditor_ApplicationCore
UnrealEditor_ApplicationCore
UnrealEditor_ApplicationCore
user32
user32
UnrealEditor_ApplicationCore
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
kernel32
ntdll

@Bionic-Blob what is your video ram usage before switching to editing? Could it be possible that unreal doesn’t have enough to allocate the texture once you switch to landscape mode?

@3dRaven Thanks for the suggestion. I checked if the file was there, it is. I also validated it and the folder. Its the same for me like @Bionic-Blob, All files Passed, and I have almost nothing in the scene, so I dont think its the VRAM, as i have other projects that have alot of assets that work just fine.

Are you running from a source build engine? If so you could track down the fail point in the engine.

The bool ULandscapeEditorObject::SetAlphaTexture in the cpp file seems to be setting the alpha texture for the terrain and not the editor brush.

There was a change between 5.0.3 source and 5.1

5.1 added a check


	// Load fallback if there's no texture or valid data
	if (NewAlphaTexture == nullptr)
	{
		UTexture2D* DefaultAlphaTexture = GetClass()->GetDefaultObject<ULandscapeEditorObject>()->AlphaTexture;
		check((DefaultAlphaTexture != nullptr) && DefaultAlphaTexture->Source.IsValid()); // The default texture should always be valid
		//..... more code
	}

This is the line that fails

UTexture2D* DefaultAlphaTexture = GetClass()->GetDefaultObject<ULandscapeEditorObject>()->AlphaTexture;

I’m guessing GetClass()->GetDefaultObject()->AlphaTexture; is the line that sinks the engine. It for some reason returns a nullptr even though it’s supposed to be failproof.

If you added an alpha channel by hand then maybe it would not trigger the crash. (not sure how to do that out of engine though)

Thanks for looking at this 3dRaven. I took a process of elimination and started deleting & restoring folders inside the project to see if there was a cause.

Deleting \Saved\Config\WindowsEditor\EditorPerProjectUserSettings.ini resolve the issue, but I restored it too quick and UE overwrote it with a fresh version - I don’t have the original broken version to share.

Unex could you see if this fixes your issue and potentially share the file please? I don’t think there is anything sensitive in this config as far as I can tell - maybe if someone could confirm first…

8 Likes

Thanks @Bionic-Blob, it really did resolve the problem, here is the broken file!
EditorPerProjectUserSettings.ini (385.2 KB)

2 Likes

Same issue - Thanks to @Bionic-Blob narrowing it down i was able to go one step further

  • Fixed for me by removing the entire [LandscapeEdit] section in EditorPerProjectUserSettings in path @Bionic-Blob mentioned.

I tried removing the alpha texture after “AlphaTextureName=” but that didn’t work - on second thought maybe removing that line will fix it

3 Likes

Good suggestion @Darjlive deleting the entire LandscapeEdit section in EditorPerProjectUserSettings resolved the issue for me! I attempted your alpha solution, but also forgot to remove the entire line for testing purposes :woozy_face:

edit: realized this error occured after i removed a file from the project containing an alpha brush used on the landscape

2 Likes

Hi everyone, sorry to bring this issue back but I was battling this for some 48h and I found yet another solution for it(for now) in case some else is still struggling.

Problem:

  • instant crash when Landscape Mode is activated

I have tried:

  • reinstalling UE 5.1 (worked until I decided to play with LandscapeMode again simply to create a Water Body Lake and eventually crash was back, zero landscape sculpting involved)
  • Deleting the [LandscapeEdit] section of the EditorPerProjectUserSettings.ini

Working solution for now:

  • Starting a fresh project worked, but I don’t want to start fresh every time…so I have overwritten the EditorPerProjectUserSettings.ini from the broken project, with the fresh one and it worked. A bit of a shotgun approach but I am new to this.

Have a great weekend everyone,

T

1 Like

This solution worked for me. Thanks a lot!

Edit: Unfortunately, the issue still here. Your solution worked until I rebooted UE.

1 Like

Sorry to bring this back again too but I just had this issue and based on all the information in this thread, changing the value of AlphaTextureName in the EditorPerProjectUserSettings.ini file to a new alpha texture worked for me.

To do this, add the alpha texture to your content folder, then in the ini, change the value to /Game/Name_of_alpha_texture.Name_of_alpha_texture

1 Like

Removing just the “AlphaTextureName=” line worked for me. Thanks!

1 Like

I can’t find the file everybody is talking about?

Simple solution: Go to Unreal Projects'‘ProjectFolder’'\Saved\Config\WindowsEditor\EditorPerProjectUserSettings, Search [LandscapeEdit] See if you have a line like this ‘‘AlphaTextureName=/xxxxxxxx’’ and delete it then save.
It’s caused by moving or deleting the brush texture on landscape mode. So don’t forget to change the brush to something else before you delete or move the texture asset.

Hey, thanks for help but I switched to 5.2 preview… It doesn’t appear to have the issue. I’ll just be carful to not touch anything new XD

I was able to replicate the crash by moving the alpha file to another folder. And then fix it the way you mentioned :+1:

You can try to optimism your scene and make the Cache memory clear while using unreal engine.

Keep in mind, It’s not an light software.