Engine fails to load or cook map named "Cave" due to conflict with engine asset file
For some reason, the engine has been confusing a level in my game with an unrelated but similarly named engine asset. When I try to load a level called "Cave", it tries to load /Engine/Content/EngineSounds/ReverbSettings/Cave.uasset as a level, then fails and crashes.
When calling this function with the argument "Cave", that UE_LOG call at the end logs the following:
(I would expect that to look like "/Game/Maps/Singleplayer/Cave", and every other level in my game works as expected)
This issue was easy enough to hack around - I tried adding a check in EnterPortal() for when DestinationLevelName == "Cave" and load "/Game/Maps/Singleplayer/Cave" instead, but that only fixed the problem in the editor. Turns out that the cooker has the same bug.
(I checked, the string "Cave.umap" does not exist anywhere in the cooker log file)
Now it seems like I can hack around this in one of two ways: Either I can use the editor's build tool in the file menu (instead of using UnrealFrontend) to build. This cooks all maps instead of specific maps, and results in my game being significantly larger on disk, or I can rename the level (I've tried this and it seems to work). Both of these are really annoying choices. Why would the engine not check if an asset is actually a map before trying to load it as a map? And why would the cooker choose an Engine asset over a game content umap file to cook when that asset is specified as a map on the command line?
This bug feels like an indicator of a larger bug, or at the very least, something very strange is going on with the internal map check and load functions.
Please let me know if you would like any further debugging data.
Thank you for the additional information. I see what you mean now and have narrowed it down to the MakeSureMapNameIsValid function itself. It takes the FString in and edits it after doing a search. The search ends up giving the wrong result. Instead of reporting this as a crash (since the crash is just from trying to load a level that doesn't exist), I'm reporting this as an error with the function itself.
You can find and track the bug report here: UE-45335.
answered May 23 '17 at 07:59 PM
Matthew J ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here