save file gone when update game(new feature)

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
kmsjkh
Posts: 6
Joined: Tue Oct 10, 2017 1:18 am

save file gone when update game(new feature)

Post by kmsjkh »

on some phones(android) if i update game , save files gones
i'm using unity(5.3~) (write access : external)
i got many complain from users about this problem
is there solutin about this problem
kmsjkh
Posts: 6
Joined: Tue Oct 10, 2017 1:18 am

Re: save file gone when update game(new feature)

Post by kmsjkh »

on my phone, there isn't my game package name folder
but save works well

on some devices save not works
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: save file gone when update game(new feature)

Post by Joel »

Hi there,

The location of the save file is managed by Unity (we simply hook into their Application.persistentDataPath variable), so unfortunately we don't have control of this at our end.

What you're encountering is a bug at Unity's end where they've changed the location of the persistent data path between versions of Unity (and in some cases between versions of Android). There's a discussion about this on the Unity forums HERE, with the main suggestion being to use an absolute path and hardcode it to the correct one.

There's also a list of possible paths in the thread which I've pasted below:

Code: Select all

/data/data/com.mycompany.mygame/files
/data/user/0/com.mycompany.mygame/files
/data/user/11/com.mycompany.mygame/files
/mnt/expand/<uuid>/user/0/com.mycompany.mygame/files
So if you can work out what folder it was originally saving to, and then prefix that to your filename when calling Easy Save methods, according to them this should fix your issue. i.e.
ES2.Save(myData, "/data/data/com.mycompany.mygame/files/filename.txt?tag=myTag");
You might need to contact Unity for more information regarding this however, as I can find no official comment from Unity regarding this issue.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
kmsjkh
Posts: 6
Joined: Tue Oct 10, 2017 1:18 am

Re: save file gone when update game(new feature)

Post by kmsjkh »

thank joel
my gamers complains about this problem so many many many :( :x :x :x :x
finally i can solve this problem
i wish this problem will be solved in es3
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: save file gone when update game(new feature)

Post by Joel »

Hi there,

As the problem is at Unity's end rather than ours, we're unable to fix it ourselves in Easy Save 3. However, I think it might only affect earlier versions of Unity 5 prior to 5.5, but you'll need to ask Unity for clarification on this.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
yamada
Posts: 8
Joined: Sat Aug 13, 2016 1:32 pm

Re: save file gone when update game(new feature)

Post by yamada »

Hi.

I have same issue about my app. What is the best solution of this problem? Already many android users are playing my app. So I want to solve this problem without affecting current players' save data.

Best Regards
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: save file gone when update game(new feature)

Post by Joel »

Hi there,

As this is a bug at Unity's end, we have no control over this so you will need to contact them regarding information on this.

However, there is a thread here on the Unity forums which describes what is happening, and possible solutions. You might also want to post in that thread if you require further assistance with the suggested fix.

Also in my post above (from Oct 10 8:12am), I suggest a possible solution.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
yamada
Posts: 8
Joined: Sat Aug 13, 2016 1:32 pm

Re: save file gone when update game(new feature)

Post by yamada »

Thank you for your reply.

I want to know more details of your solution. In the case of my app, I'm already using ES2.Load and ES2.Save in my app without any absolute path. And some users sometimes said their all save data have gone and others not. In this case, how can I fix the source code? If I change ES2.Load and ES2.Save path to absolute path from now, I think almost current users save data will not be loaded. Because their current save data are not located new absolute path, and their current save data location might be different depend on the device.

I'd appreciate it if you could help me.

Thank you in advance.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: save file gone when update game(new feature)

Post by Joel »

Hi there,

Easy Save 2 simply uses Unity's Application.persistentDataPath as part of the path, so this:
ES2.Save(123, "myFile.txt?tag=myTag");
Is equivalent to this:
ES2.Save(123, Application.persistentDataPath + "/" + "myFile.txt?tag=myTag");
The issue is not at our end, but is a bug at Unity's end with their Application.persistentDataPath, so modifying our source code won't solve the issue.

The suggested solution is to try to find out where the data was originally stored (there's a list of possible locations in my post above), and use an absolute path to load the data from there, and then re-save it to the new location of Application.persistentDataPath.

Because we have no control or access to the source-code for Unity's Application.persistentDataPath, you'll be best off contacting them via the Unity forums if you require more information on what the original location might be as it's not possible for me to determine this from my end.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
yamada
Posts: 8
Joined: Sat Aug 13, 2016 1:32 pm

Re: save file gone when update game(new feature)

Post by yamada »

Thank you for your reply.

Of course I understand that this is not ES2's problem but Unity's bug. Despite that, you reply very kindly agin and again. So I really appreciate you.

> The suggested solution is to try to find out where the data was originally stored (there's a list of possible locations in my post above), and use an absolute path to load the data from there, and then re-save it to the new location of Application.persistentDataPath.

OK, I understand the outline of your solution. Now I don't know how to confirm the existence of folder of specific location and how to move the folder to new location, so first of all I'm going to search these information.

Thank you for your continuous support for me.
Locked