Renaming AMyWorldSettings leads to map load crash, bug or feature?

If i create AMyWorldSettings, and set it inside “project settings”, then save map, then rename AMyWorldSettings to AAnotherWorldSettings, then recompile C++ code, then crash on map load. (even if i change to default AWorldSettings inside project settings, and resave map, before renaming).

Log:

[  0]LogLinker:Warning: CreateExport: Failed to load Outer for resource 'StaticMeshComponent0': MyWorldSettings /Game/Maps/Lobby.Lobby:PersistentLevel.MyWorldSettings
[  0]LogWindows:Error: appError called: Assertion failed: WorldSettings != NULL [File:D:\UE4.4.1\Engine\Source\Runtime\Engine\Private\Level.cpp] [Line: 1561]

So i have to delete level and create new, luckily its just test levels.

There is no way for the level to know that you have renamed your World Settings class, and changing the World Settings class in the ini does not affect levels that have already been created and saved. You may be able to set up a class redirect in the engine ini to redirect to your new class. Have not tested that though.

i understand that Level can keep MyWorldSettings specific data, but i think there should be some mechanism for convering MyWorldSettings to default WorldSettings, if MyWorldSettings is not found, even if MyWorldSettings specific data will be lost, or at least Editor could ask new name of WorldSettings when map loads in Editor. May be im wrong.

Dont know about “class redirectors”, may be this could help.

PS: found the same problem with blueprints and its renamed base classes (when i press RMB on that blueprints, editor crashes). The problem is, there is no way to fix names using Editor, or at least i dont know.

UE4.4.1

Hi newbprofi,

Could you provide some additional information about how you are trying to accomplish this? I tried to create a new class based on WorldSettings and it was created as an Actor class instead of a UObject class (my class was named AMyWorldSettings instead of UMyWorldSettings). Could you provide the exact steps that you are following?

Sry, ofcourse, my class is called AMyWorldSettings.

When i tryed to reproduce this with new projects (basic code, default levels), i failed to reproduce 5 times (level work even after renaming) and success only 1 time (editor hang+crash, after renaming). I do not know exactly why, i was not able to repeat this again.

But, in past, when i did this with project, that was not empty, and was modified couple of times, may be had some static meshes on map etc. Then it happened 100% twice, when i renamed WorldSettings.

Hope that will help.

If i will corrupt some important map again, i will tell about that. For now, i will not use custom World Settings at all, or i will use “const” name for it.

So, i do not know, how to reproduce this exactly.

Thank you for the additional information. I continued from where I had left off and I was able to see a crash occur the first time I tried to open the project after setting the custom WorldSettings class, then renaming the class. I will do a little more investigation into this issue tomorrow morning.

I think i was able to reproduce it, (in short, i added Editor restart and additonal Save), here steps:

Preparation:

  1. Create “Basic Code” (without starter content), build, open project in editor.

  2. Edit->AddCodeToProject->WorldSettings (“MyWorldSettings”).

  3. Close editor, rebuild project, open project in editor.

  4. Set “Project Settings” → “Editor startup map” = “/Game/Level”.

Most interesting part:

  1. Set “Project Settings” → “World Settings” = “MyWorldSettings”.

  2. Create new level (“Default Level”).

  3. Save As (“Level.umap”).

  4. Close editor.

  5. Reopen project in editor. (Level.umap loaded at startup).

  6. Set “Project Settings” → “World Settings” = “WorldSettings”.

  7. Save. (save current level to disk).

  8. Close editor.

  9. Rename “AMyWorldSettings” to “AOtherWorldSettings”. (or just delete AMyWorldSettings at all, i think no matter).

  10. Rebuild project.

  11. Open project in editor. (hang + crash).

  12. Manually delete “Level.umap”, to open project again.

Notes:

if you swap (5) and (6-7), crash will not occur. (not 100% sure though)

if you remove (11), crash will not occur. (99% sure)

if you remove (8) and (9), crash will not occur. (99% sure)

Hi newbprofi,

Thank you for the detailed reproduction steps, they were very helpful. I have submitted a report about this issue to our development team for further investigation (TTP# 348335). We appreciate you bringing this to our attention, and hope to have it corrected soon.

If you open the DefaultEngine.ini for your project, you can add something like this:

[/Script/Engine.Engine]
+ActiveClassRedirects=(OldClassName=“AMyWorldSettings”,NewClassName=“AAnotherWorldSettings”)

+ActiveClassRedirects=(OldClassName=“MyWorldSettings”,NewClassName=“AnotherWorldSettings”)

yes, that worked. But i cant make:

+ActiveClassRedirects=(OldClassName=“MyWorldSettings”,NewClassName=“WorldSettings”)

I think that means, that: “if i create level with SpecificWorldSettings, i can not change that settings to smth else, ever, i can only redirect name for that settings, but class body must remain unchanged”.

Also, “MyWorldSettings” name still exists inside Level.umap, even after redirect. Well thats actually what i did expect from redirect - “accumulative redirecting”.

Actually i was also expecting ability, that i could completely change “MyWorldSettings” to “WorldSettings” for my level, cutting out all information about “MyWorldSettings” from level. (permanent redirecting).

But thats ok. I think i was wrong, because anyway i was supposed to use single WorldSettings for entire project and all levels at project beginning, i should never change it to smth else at the middle of project lifetime.

I have the same problem, Do you have any solution for changing worldsettings in every map file now?

I finally modify the source of Engine, and change AMyWorldsettings to AWorldSettings when the editor save map. But it’s not the best way to do it, I have to revert engine source code after that. I hope UE4 Team can give us a more easy way to do this.

Hey Bingll,

I have the same problem, even though I got rid of old extended world settings class the map file still holds a reference inside and crashes as a result. Can you show me how you modified engine source code to force overwrite map details during same. I think it can come in handy :).

Thank you.

Hi Gam3r,

Did the process mentioned by JamesG not work for you?