Hi there.
I’m having a problem developing for WP8 and need some help working out where to look for a solution.
I have a game on the market that was built and published via the Windows Phone Unity build path. The game stores all of the users’ save data using IsolatedStorage (the game was first developed using XNA where this was the best / only option and I have stuck with this during the switch to Unity so that player saves are maintained). However, since upgrading to Windows 10, and reinstalling Visual Studio, I am unable to use the isolated storage libraries. It has also been announced that I will have to switch to the Windows Store build path as of Unity 5.3+, where IsolatedStorage is not available.
Looking at alternatives, I have implemented a new save system using LocalStorage (Windows.Storage - the encouraged system for WSA). However, I need to be able to load the save files that users previously saved to IsolatedStorage. Is this possible, and if so, how would I start. The major problem I have is that I am now completely unable to build using the old path so can not actually deploy any debug apps using Isolated to test.
I’ve done a lot of googling, but all of the answers I’ve found have been “why would you use isolated storage in the first place?” - not so useful.
Any help / guidance would be greatly appreciated.
Thanks
Chris
Do you know where IsolatedStorage was placing files?
Maybe you can form the same path using Unity - Scripting API: Directory tempFolder, localFolder or roamingFolder? After that it’s pretty simple, load file contents using Unity - Scripting API: File and do what you need to do.
Well with more digging, some people are suggesting that using Windows.Storage.ApplicationData.Current.LocalFolder is the same as the IsolateStorage.GetUserStoreForApplication however, without being able to test this for myself, I’m hesitant to rely on that info.
I’m guessing that the above local folder is the same as UnityEngine.Windows.localFolder?
As for where the files are placed, I’ve just been looking into that using the Windows Phone Power Tools. It seems I can still deploy an old WP8 build from VS. I just can’t build a new one from Unity 5.2 because it errors on finding the IsolatedStorage namespace. Anyhow, with the old WP8 build, it seems that the files are placed in the root storage of the application. This also includes the UnityPlayer.log which might offer some clues. When I deploy the WSA version, the files are placed inside the Local subfolder of the root. This also includes the UnityPlayer.log.
Screenshots attached (not sure why it’s named Isolated Storage).
I’m hoping this means that when users are upgraded from one to the other, that the files are moved or at least not deleted and the pathing adapted to match the new layout. Unfortunately, deploying one then the other from VS is considered a major change so storage doesn’t persist.
I’ll try rolling back my Unity to 5.1 and see if I can then rebuild the WP8 version. This way I should be able to test both save systems in 1 app. I’ve a feeling that it’s something to do with the reinstalled WP SDK though and not Unity.
I am slightly confused, what’s the upgrade, are you upgrading WP8 application to WP8.1 application?
Yes. As in on the store currently it is a Windows Phone 8 Application (built via the Windows Phone platform in Unity), and I plan to upgrade it to a Windows Phone 8.1 Application (built via the Windows Store Application platform with the Phone 8.1 setting). This should be invisible to the end user, but I’m cautious when it comes to things like save files when MS go chopping and changing libraries, and their documentation is so vague (this was best practice, now this is, just go with it :P)
I know for sure that application files persist when simply updating application, but in this case you’re updating target OS of your application, are you sure application files persist during such upgrade as well?
They did when I went from WP7 with XNA to WP8 with Unity. I was able to keep using IsolatedStorage for that transition too, however. This is what I find vague in the docs. Things like this tend to only be touched on in side notes and the information can sometimes conflict. The implementation details are all very good, but it’s the higher level understanding of how the changes relate that can be hard to find.
Dang. I’ve managed to get WP8 building properly again, but it seems that with whatever SDK I now have installed I get a crash when running because IsolatedStorage can’t find the relevant stream constructor that I use.
New plan: upload an old WP8 package as a beta app on the WP store (private to me), run it so it saves the game, then upgrade the beta with a new package and see whether the save file persists. If I’m lucky, it’ll work. If not then it’ll be a slow way to investigate.
Not sure if you’ve tried, but you can also try asking here - Microsoft Q&A | Microsoft Learn