I have been working on a game for a few years now, and ever since I updated to 4.23, the previously made and fully working save system is now failing.
At the start of the game I check if there’s a pre-existing save file, and if not, I create a save, and then save it to a slot. For some reason, the ‘save game to slot’ section no longer works, and the return bool to check if it worked returns false.
It is worth noting that this only works on deployed mobile devices. Testing it in engine results in the save system working as intended, making it really hard to debug.
Regardless, I tried and couldn’t fix it. I changed the save name in case there was a corrupted save file on my device, nothing. I deployed and installed it through google play and directly installed through USB and neither worked. I tested on multiple android devices and got nothing. From ‘create save game object’ I casted to my save just in case, didn’t work. I tested a windows build and that didn’t work either. I tried looking up this issue on both the forums and answerhub, and the unreal documentation and couldn’t find anything that fixed this issue.
Remove the save to slot when you load the game. When you cast to the save game object to load it, get the variable current level and set it to a locally set variable for reference.
Well I’m going to have to save eventually, you pick up loot in the first level so saving will be required before I load the next level. Let me try doing the first save at the end of the level instead of the start and see if that fixes it.
Okay, take a look at the way I load/save a game. The first custom event I create is Load Game. I use this to determine if we have a saved game and if not we create a default save game with default variables and once again, load the save game and set the variable locally on my Game Instance (Struct named Statistics that I created separately). My save game is called SG_Statistics and you will notice that I utilize that name as the slot name.
I was able to push the save to slot to later in the first level and I still got the issue
I was also able to confirm that ‘create save’ is not the issue, it creates a valid save object. It is the ‘save game to slot’ node that is returning false.
Here is where the save fails, now moved later on in the first level instead of on begin play. I have isolated the issue to this node. The branch will always return false
I’m not near ue4 at the moment but if you could upload your project and PM me the link I will help resolve this issue and determine if it’s a bug or not.