Saving player data - bin file or SaveState?
Monkey Forums/Monkey Programming/Saving player data - bin file or SaveState?
| ||
I'm a little confused here. I've searched all over the forums and online help, and am getting nowhere with Binary files (using HTML but final target will be Android). With an Import brl.filestream I get a message immediately upon compiling "Native FileStream class not found." Should I be creating binary files on devices? or are SaveStates really the proper way to do it? |
| ||
SaveState should be enough to save player progress. brl.filestream is not available on html5. You can check the API page in the docs to see on which platform a module is available. (generally if it's a brl module it might not be available on all platforms) |
| ||
Now I'm curious - is it available on iOS/Android? I look at the code, and I can see a filestream.java... If it's available on both, where exactly should someone save? I ask this, because using just LoadState/SaveState to save everything in a single file, in a single string is really, really bad. I understand you get no other way in HTML5 (you only can save to cookies there), but other targets (specially Android/iOS/WP8/WinRT) you should be able to save more than just 1 file... |
| ||
Still wondering about this. My current idea is to load new levels from a website as they become available, however if the user is away from Internet access it means they obviously can't play the new levels. Additionally, it also means currently if they do have Internet access I need to load these new files and then save the new content within the SaveState file - which as SLotman mentioned is really, really bad (actually I'd say it's a really ugly/messy way of doing things) |
| ||
To my knowledge filestream works fine on Android (but not on html5 indeed). On Android devices, you can create, read, and write text files in the internal storage (monkey://internal/) as well as the sd card (monkey://external/) when needed. I've been using filestream to save quite large amounts of data inside text files on my old and crappy Archos Tab, without any problem yet. Maybe take a look at this thread : http://monkeycoder.co.nz/Community/posts.php?topic=5898#74806 |
| ||
Thanks very much Pierrou, I will check it out. |