Hello,
We’re working on a open world game with Save System. Currently we’re going down the rabbit hole of actor identification.
Like other developers, we decided to introduce GUIDs for actors in order to identify them for save system. GUIDs have to be editable, so we can recreate an actor in case we need to change the class.
Everything works fine until Level Instances step in. If we have multiple copies of the same level instance placed onto Main World, technically we have multiple actors with the same GUID.
In order to fix that we serialize the level instance GUID into the Actor during cooking. So we have two GUIDs (GUID of LI + GUID of Actor inside LI) per actor.
The only caveat is the inability to move actors between level instances.
The simplest (and the least efficient solution) will be implementing the separate redirector system. However, it’s highly inefficient since we might need to update multiple actors. Maintaining of a huge map might quickly become painful.
Another solution is to store the whole LI hierarchy, so we can preserve old IDs (by forcing a new LI to “return” the old ID). There are multiple other edge cases:
- LI hierarchy flattening (removing intermediary level instances)
- LI hierarchy growing (adding intermediary level instances)
Our desirable requirements:
- Actor GUIDs have to be persistent between builds
- We should be able to set any GUID to any actor (to preserve full compatibility of older save files)
- We should be able to move actors between level instances
- Existing level instances can be merged/separated without breaking GUIDs
- Having multiple copies of the same LI is allowed
- LIs can contain nested LIs, including multiple copies of the same LI
- Avoid redirector tables if possible
Is there any way to make GUIDs actually unique and editable without dark magic and having too much restrictions in terms of compatibility?
Thanks in advance!