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).
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.
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.
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.
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.
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 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.
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 :).