Android Android ds_map / save issues

siread

Member
I have an game on the iOS and Android stores called Retro Bowl and I have a small number of Android users experiencing a problem which looks like some team data has corrupted.

upload_2020-2-11_11-53-40.png

All the teams in the game are ds_maps and they are stored in an ini file:

Code:
    // Store team data
    var size = ds_list_size(teamlist);
    ini_write_real("savegame", "teamlist", size);

    for (var m = 0; m < size; m++)
    {
        var str = ds_map_write(ds_list_find_value(teamlist, m));
        ini_write_string("savegame", "teamlist_"+string(m), str);
    }
Code:
    // Read team data
    size = ini_read_real("savegame", "teamlist", 0);
    slog("teamlist size="+string(size));

    for (var m = 0; m < size; m++)
    {
        var map = ds_map_create();
        ds_map_read(map, ini_read_string("savegame", "teamlist_"+string(m), ""));
        ds_list_add(teamlist, map);
    }
This works fine but a handful of players have suffered issues where team data has gone missing...

I don't think it is necessarily the save/load system at fault, the only reason I'm am looking at that is because I'm wondering if it can be flakey on some Android devices (file size is about 500kb). It would be more likely that somewhere along the line the ds_map for a particular team is getting lost, but I cannot fathom why it would only affect Android users (30k installs compared to 180k on iOS). There are some sorting functions that rearrange team map order, but I never mess with the master list, merely newly created lists that reference the original "teamlist" maps. And again, why would this only occur on Android?

Any ideas will be greatly appreciated!

Also, is there any way to get access to a users save file? Would they need to have a rooted device?
 

Attachments

Last edited:

FrostyCat

Member
It's probably an issue with either the INI functions mishandling certain "taboo" characters in the output of ds_map_write() (example), or ds_map_write() and ds_map_read() not lining up on the Android export only. The flakiness of INI functions and the opaqueness of data structure read/write functions have turned me off both, and I now use JSON exclusively.

If you have physical access to the device, you can check your app's files using ADB as described on this StackOverflow topic. If you don't, you have to set up an upload service to receive the file online over HTTPS.
 

siread

Member
The team data itself doesn't contain any unusual characters (it's just city names and numbers) but it's a lead at least, thanks.
 
Top