Download

class'Engine'.static.BasicSaveObject() called asynchronously?

I’m currently using the save-game gem as reference for my save game system: https://api.unrealengine.com/udk/Thr…ameStates.html

I’ve recently noticed that some players with slow machines encounter a small lag spike when the file is written to disk. It appears this function runs synchronously (i think anyway).

Does anyone know if there is a way to handle this job asynchronously, so that it does not block other game execution?

Cheers

It depends on what you’re saving and how. The save-game gem iterates through all dynamic actors and checks to see if they implement the save game interface, and does that all in a single function. The iteration can take a while if you have lots of dynamic actors. What might work better is keeping a separate array of actors that need to be saved and then iterating through just that list, perhaps going through one or a few on every game tick.

Also, I’m not sure how much of a slowdown this is, but I think it might be faster if instead of encoding the JSonObject as a string when you send it, you just send the JSonObject itself.