How Do I Efficently Save Lots Of Actors

Bigometer
Wed, 26 Aug 2020 01:50:04 +0000
Community & Industry Discussion

Hey guys, so I want to refactor my save/load system to be a bit more optimized. I have creature and structure actors right now that I want to save. These both have unique id’s assigned to each instance. My current method of saving them is by creating a new file for each actor. These files contain the actor transform, class, and a TArray that holds all the serialized data and these 3 properties are placed inside a struct. For saving all into a single file, should I add an ID property to the struct and save a file containing an array of the structs? And then for loading, would I go through each struct inside the file and spawn the actor and if the actor is out of range of the player, I disable the renderer or something to improve performance? And for saving individual actors when I need to, would I just get the array of structs from the file and loop through it and search for the id, if it exists, overwrite that struct, if it doesn’t exist, just add a new struct. I can provide more info if needed. Thanks in advance!

4 posts - 1 participant