Saving Player Data for Mobile Games

Hi all,

I would consider myself a beginner when it comes to this topic, so if anything I say is not quite right or if you have a simple answer I’m not seeing, please don’t hold back.

I’m working on a mobile game for Android and am looking for a way to handle save data that can be put online using either Google Play’s saved games service or simply saving something like a JSON file to Firebase’s cloud storage (using the free plan). I’m already authenticating/making accounts for users through Firebase, but I’m willing to switch it to authenticate through Google Play so that we can use Firebase’s database and Google Play’s saved games service.

I was hoping to get some expertise and opinions on the matter. It seems like a generally good quality of life feature for the players to be able to have their save data online so they can retrieve it and play on any device so long as they have their account, but the implementation of it feels like it could go through Firebase Cloud Storage or Google Play’s saved games.

With Firebase Cloud Storage, I’d handle save data like normal, saving as custom binary files. These files would be stored to Firebase, under folders associated with each user and with rules to grant access to only said user. It doesn’t sound very good, especially with Firebase’s strict limits on uploading (20k uploads a day) and storage size (5GB). But I still bring it up because there might be something I’m not understanding that could make it worthwhile. The biggest reason Firebase is used in the project right now even though Google Play can do authentication is for the real-time database, where we store results of surveys asked in-game into the Real-Time Database.

With Google Play, I’d have sign-in through google play and then authenticate Firebase (in order to continue using the Real-Time Database) with that. Since I’ve already done login with Firebase I’d have to change to signing in with Google Play, but that’s beginning to seem like a better alternative. The actual implementation of saving games would be pretty cookie-cutter: just follow the Google Play documentation, which seems detailed. I also haven’t found anything regarding a limit of upload operations like Firebase does, just size limits on the binary file you upload. So that makes me think it would be okay to have save/upload operations occur often, such as when a quest is progressed (the game is generally always going to be played somewhere with wifi).

So I guess a tl;dr for my questions would be:

  1. How should I save player data from my mobile game online? To a Firebase Cloud Database, or to a Google Play Games account?
  2. How often is it okay to save the data (and from that upload to the internet)? Maybe save locally often and upload to the internet as the app is closing?

Mobile apps typically have something called ‘Local storage’ although this is fairly small in comparison to an online db - well very small actually.

Inside ‘Flutter’ this is accomplished via ‘shared Preferences’

Which creates persistent data - or rather an access point to it easily.

Obviously, with online storage you will need proper authentication and support http requests to submit and save to the db. Firebase should have a robust API you can follow, though personally, never used it myself. It seems more of the ‘go to’ than google play.

Thanks for the reply! Having used Firebase, I can say that it does make putting data to their database very easy. The issue is that there’s a limit on uploads and downloads of 20k operations a day. Though I don’t think it’s going to be an issue any time, if at all, it’s still a limit that can turn into an expense and I’d like to see if there are better options.