I have searched around quite a bit and can’t seem to figure this out. I am working on a very basic game and am trying to save high scores via blueprint. I am successfully saving and loading scores while playing in the editor but I can’t seem to get the scores saved on android! The app has USB storage write permissions which is all it would need I assume?
I’m using the default app manifest and am packaging in development mode. Do I need to add anything to allow me to save the game?
If it helps at all, I’m using Save Game To Slot in blueprints on a SaveGame object.
Please help! I will include screenshots of blueprints if it helps!
Has nobody else ever had this issue? I’ve pretty much exhausted all of the search queries I can think of to try and solve this. It’s still unsolved and I would show everlasting gratitude to whoever points out the (hopefully obvious) mistake I’ve made. I would really appreciate someone with more experience in android deployment to at least tell me where to look. (Ie. Manifest, blueprint, etc). I have tried everything and it’s really disheartening not receiving any responses :(.
Thank you so much for the response!!! Let me answer your questions. Please let me know if you need anything else!
UE 4.5.1
I’ve attached the blueprint screenshots
Samsung Galaxy S5
Android version 4.4.2
Not receiving any errors. If I was then it would really help!
Is there any settings (ie. default save directory) that I need to set to enable saving on android? I have only been using UE4 for about a month now and this is my first project that involves saving.
Once again thank you so much for your response. I was starting to lose hope! I apologize for all the bumps. If you’re able to figure out the problem then I’m forever in your debt!
Blueprint Screenshots (Function in level blueprint):
After adding new debugging output, I noticed that the second cast to MySaveGame is failing. I am only having this issue on android and the cast doesn’t fail when tested within UE4.
Anyone have an idea why this may be happening?
Just to clarify: the cast directly after “Load Game From Slot” in the blueprints above is failing. It is only failing on android and does not fail when run within the editor.
I have another quick question for you. Are you launching it straight to the device or are you packaging the game and then installing it onto the device?
Thanks again for the response! I am packaging it in development mode and running the batch file. I tried once packaging it in shipping mode with no luck.
I found the error log on the android device! This should definitely help! Here is the log:
NewMap_C /Game/Maps/NewMap.NewMap:PersistentLevel.NewMap_C_0
Function /Game/Maps/NewMap.NewMap_C:SaveGameSubmit:051E
[2014.12.05-14.02.22:168][ 0]LogScript:Warning: Attempt to assign variable through None
NewMap_C /Game/Maps/NewMap.NewMap:PersistentLevel.NewMap_C_0
Function /Game/Maps/NewMap.NewMap_C:SaveGameSubmit:0534
[2014.12.05-14.02.22:169][ 0]LogScript:Warning: Accessed None 'TopDownSaveGameObj'
NewMap_C /Game/Maps/NewMap.NewMap:PersistentLevel.NewMap_C_0
Function /Game/Maps/NewMap.NewMap_C:SaveGameSubmit:057F
[2014.12.05-14.02.22:169][ 0]LogScript:Warning: Accessed None 'TopDownSaveGameObj'
NewMap_C /Game/Maps/NewMap.NewMap:PersistentLevel.NewMap_C_0
Function /Game/Maps/NewMap.NewMap_C:SaveGameSubmit:059F
[2014.12.05-14.02.22:169][ 0]LogBlueprintUserMessages: SAVE GAME SUCCESS: false
[2014.12.05-14.02.22:169][ 0]LogStreaming:Warning: Failed to read file '../../../TopDownMobileEating/Saved//SaveGames/Profile1.sav' erro
Android is clearly unable to find the .sav file! Do you know what’s happening here? Why isn’t the sve game file being created? Do I need to manually create it for Android?
Here is more of the log that is likely relevant but wasn’t able to fit in the above comment because of the character limit. This part of the log is directly above what I just posted.
Function /Game/Maps/NewMap.NewMap_C:SaveGameSubmit:043C
[2014.12.05-14.02.22:168][ 0]LogScript:Warning: Accessed None 'K2Node_DynamicCast_AsTopDownEatSaveGame_C'
NewMap_C /Game/Maps/NewMap.NewMap:PersistentLevel.NewMap_C_0
Function /Game/Maps/NewMap.NewMap_C:SaveGameSubmit:040D
[2014.12.05-14.02.22:168][ 0]LogScript:Warning: Accessed None 'K2Node_DynamicCast_AsTopDownEatSaveGame_C'
NewMap_C /Game/Maps/NewMap.NewMap:PersistentLevel.NewMap_C_0
Function /Game/Maps/NewMap.NewMap_C:SaveGameSubmit:03DE
[2014.12.05-14.02.22:168][ 0]LogScript:Warning: Accessed None 'K2Node_DynamicCast_AsTopDownEatSaveGame_C'
NewMap_C /Game/Maps/NewMap.NewMap:PersistentLevel.NewMap_C_0
Function /Game/Maps/NewMap.NewMap_C:SaveGameSubmit:03AF
[2014.12.05-14.02.22:168][ 0]LogScript:Warning: Accessed None 'TopDownSaveGameObj'
I made a test level and created a save system to try and reproduce this issue. I was unable to reproduce this on the device. My save file worked correctly. I have a few things that should be noted. When launching the project straight from the engine the save file will not work because there is no save file being created on the device. However, I see that you said that you were running it via the batch file which installs it onto the device. This worked for me. I have a couple of more questions for you that will help eliminate a couple of possible issues.
Quick questions:
When you package the device are you using Android (ETC1)? This was what I was using.
Are you making sure to set your variable “SaveSlotName”? I see that you “Get” this variable throughout your blueprint but I do not see it being “Set” anywhere.
We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.
A year after i have encountered the very same issue… Save is not loaded on android, even if in simulation mode it works. I have attached screen with both save and load.
Sorry about the mix up with the name. You can send it to me in a private message on the forums via drop box or google drive. You could also attach it to a reply here if you can get it to a small enough size. Please be sure to include the steps needed to reproduce this issue in the project provided.
After looking over your project and following the instructions that were given in the email, I found that the project was working as intended. However, I believe that I understand what issue it is that you are running into. From what I read in the instructions you appear to be using the launch on feature. This feature only loads up the current level and no other data. The files used to store the save data are not included when using launch on. I packaged out your project and then added it to the device that way and it saved the information as expected. I hope that this information helps.
Well i have tried to package the app an then test it out on device, however with no luck.
Tell me did it worked without any modifications to the blueprints? And on which Android did you tested?
Edit:
I have made some changes to my blueprints. For me it looks like Game instance is not getting Event Shutdown on time and it does not save anything. After i have added save to slot while clicking back in options it worked. Event Init is invoked correctly, however i did not see Event Shutdown to fire
With the additional information provided I was able to reproduce this issue on our end. I have written up a report ( UE-22652) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for your time and information.
UE-22652 is unfortunately a limitation of the platform. There is no such concept as “quit” on Android. The Event shutdown won’t get called by killing the app. One way to do this for Android is to save the game on pause instead. Another way to go is to put in a save game button, but pause is easiest. (paused fire off if you hit home or the pause button) I hope that this information helps.