-
Notifications
You must be signed in to change notification settings - Fork 82
Description
I already had a quick chat with @sinbad about this, so I'm mostly putting it up here in case anyone ever takes a look at it or has any ideas or suggestions how to address this.
Upgrading a project between 5.4 to 5.5 it appears that all the SPUD data using world partition will completely break mostly because it appears they changed the way they compute the world partition cell names and all of the data inside for LevelActors is stored inside a TMap using a level name such as 5.4:
[+] Content of Cell MAP_NAME_MainGrid_0_0_0_5 (B3PX6MHSG1U9219QVBOZ06GCS)
|- Actor Count: 47
|- [+] /Game/Maps/MAP_NAME/UEDPIE_0_MAP_NAME.MAP_NAME:PersistentLevel.BP_CutscenePlayer_C_UAID_C87F54545F47343102_1648680475
| |- Package: /Game/ExternalActors/Maps/MAP_NAME/MAP_NAME/1/O2/IO0IC8WN7TG9OOVB7GVUEK
| |- Editor Only: 0
| |- Instance Guid: 01EBD95142BB97D54DCC5F83C22A4CF2
| |- [+] Container:
| | |- ID: 00000000000000000000000000000000
| | |- Transform: 0.000000,0.000000,0.000000|0.000000,0.000000,-0.000000|1.000000,1.000000,1.000000
5.5:
[+] Content of Cell MAP_NAME_MainGrid_L5_X0_Y0_Z0 (1Z4A0V9YX0RUMJEE926CYL2QE)
|- Actor Count: 47
|- Content Bounds: IsValid=true, Min=(X=0.000 Y=450.000 Z=0.000), Max=(X=352629.658 Y=183118.232 Z=55469.770)
|- Cell Bounds: IsValid=true, Min=(X=0.000 Y=0.000 Z=0.000), Max=(X=409600.000 Y=409600.000 Z=409600.000)
|- Is 2D: False
|- [+] /Game/Maps/MAP_NAME/UEDPIE_0_MAP_NAME.MAP_NAME:PersistentLevel.BP_CutscenePlayer_C_UAID_C87F54545F47343102_1648680475
| |- Package: /Game/ExternalActors/Maps/MAP_NAME/MAP_NAME/1/O2/IO0IC8WN7TG9OOVB7GVUEK
| |- Editor Only: 0
| |- Instance Guid: 01EBD95142BB97D54DCC5F83C22A4CF2
| |- [+] Container:
| | |- ID: 00000000000000000000000000000000
| | |- Transform: 0.000000,0.000000,0.000000|0.000000,0.000000,-0.000000|1.000000,1.000000,1.000000
So whenever a streaming cell loads and than we iterate actors inside of it we use the level data to fetch it from the spud data however if epic changes how the cell names are computed OR the object someone ended up inside a different cell for whatever reason, SPUD will fail.
I had some quick thoughts on how to potentially fix this but currently spud level data is stored as TMap<FString, TLevelDataPtr> LevelDataMap
with a comment that all FNames are unique inside Level Name, while this is true the chance of you getting the same actor UAID in 2 maps is almost impossible UNLESS you duplicate your maps. Unreal does not generate new UAID when doing that, so you are stuck.
One solution is that I thought of is that when we tried to restore the actor, if we find that ActorData is null returned from ActorData = GetLevelActorData(...) than iterate the map and load the other sublevels data until you find another sublevel that has actors with the same UAID and than load that data in using a new LevelPtr data and than on next save it will fix its self. This will work unless you duplicated your maps and have same UAID across 2 maps. (Potential solution to the duplicate UAID problem is to actually store LevelDataMap not as TMap<FString, TLevelDataPtr> but rather as TMap<RootLevelName, TMap<FString, TLevelDataPtr>> so that you can search the map for the parent persistent level and than the sub levels under it
I think at least for us I'm going to attempt to solve this using the approach I did above but I would be real curious to see if anyone ran into this and how they approached it. It definitly seems like there is a future where epic changes these again and our game saves will break again.
Some other random idea I had was if it was possible to generate the 5.4 guid inside the 5.5 version than you can try the look up using the old hash as well but Im kind of out of ideas on this