2
\$\begingroup\$

I was wondering how I would add the option for players to sign into their Facebook profiles on my mobile game and then have Facebook store their game save data, so they can recover it on any device when they sign into Facebook. Other Facebook features would include seeing their friends on the Facebook leaderboards, inviting their friends to the game and challenging their friends to beat their scores. I would hate for the Player's data to be lost, so the Facebook data save part is very important. A good reference to this feature is the Hungry Shark mobile game.

I wasn't sure how this works. My programming friend and I are creating the game together, but he doesn't know how to do this and I don't know how to program. Once I figure out exactly what has to be done, I would like to hire a programmer who knows how to add this feature.

Thank you!

\$\endgroup\$
  • \$\begingroup\$ Are you sure that Facebook will be saving the data? Most games I'm aware of that use Facebook for the login have to handle persisting game progress using the game's own servers or another third party solution. \$\endgroup\$ – Sean Middleditch Dec 20 '16 at 7:47
  • \$\begingroup\$ Oh okay, yeah I wasn't sure. That was another thing I was wondering. Would Google Cloud Save be a good option for both iOS and Android? \$\endgroup\$ – Eric David Tippett Dec 21 '16 at 6:07
2
\$\begingroup\$

Facebook does not provide storage for saved games. Facebook's OAuth API can be used to login with Facebook and obtain a Facebook-specific user ID (and other data like name, email, friends, etc.) but that only solves a part of the problem.

Games will typically then use their own database solution (either on their own servers or a hosted cloud solution) to make things like Facebook IDs to their game-specific accounts. This mapping can be used to associate multiple authentication services to the same account, allowing a user to login with Facebook, Google, Twitter, Microsoft, or so on. That also illustrates why it's a bad idea to use the authentication provider's user id as the account id, because the same user will have completely different user ids across the various authentication providers.

The database solution used to store account metadata can also be used to store all saved game information, or a different storage service could provide that feature. It will be typical to wrap the various backend services (accounts, saved games, leaderboards, etc.) behind a single game-specific gateway API service so that the game clients only need to interact with one external platform (and don't need things like secret access keys to databases distributed with the clients!).

Note that there are also all-in-one "platforms" that provide the entirety of these services plus many others that a shipping game needs (telemetry, monetization, etc.). Larger game studios may build their own platform, like Battle.net or Steam, while smaller indie games might use something like PlayFab or GameSparks.

I would note that building out the platform for a game is a very large and serious undertaking; the effort to build out a scalable platform for a successful game can take far more time, money, and effort than building most games themselves. I'd recommend using an existing service like PlayFab, especially if you have limited experience building online games or a very small dev team (e.g. one person).

\$\endgroup\$
  • \$\begingroup\$ Hi Sean, thanks for the informative reply! What about using Google cloud for data storage? I read it allows players to transfer their game data from iOS to Android. Would GameSparks still be a better option for a 2 man team? I wasn't sure how much work this would be for the programmer. \$\endgroup\$ – Eric David Tippett Dec 22 '16 at 9:40
  • \$\begingroup\$ @EricDavidTippett: I'm afraid I don't much about Google's services. If it can handle linking the Facebook login to the game data reliably and lets you do all the other queries/manipulation your game might need then I don't see why it wouldn't work, but I can't say for sure. \$\endgroup\$ – Sean Middleditch Dec 22 '16 at 19:03
  • \$\begingroup\$ I took a look at both of those and GameSparks looks great. My friend who is programming the game had admob ads and google achievements/leaderboards already put in though. Would GameSparks overwrite those? Also, he is more of a front end programmer who knows how to program single player games in Unity. Do you think GameSparks would be easy enough for him to implement it? If not, would you be up for implementing it in the game and I could pay you a flat rate for your help? Thanks for all your help so far! \$\endgroup\$ – Eric David Tippett Dec 23 '16 at 7:35
  • \$\begingroup\$ @EricDavidTippett I'm again the wrong person to ask. :) I've never used GameSparks - my company has its own complete proprietary platform so I'm not intimately familiar with the publicly available ones. Generally: you certainly can mix services and there's likely many good reasons to do so, but I personally would prefer using as much of the platform's provided mechanisms so that you can get more accurate and complete reporting. \$\endgroup\$ – Sean Middleditch Dec 23 '16 at 22:38
  • \$\begingroup\$ Okay great thanks! Well since we have ads already with admob, we could just keep those. Our Achievements, Leaderboards and analytics is all on Google Play which Android only right? So iOS would need something different. Do you think it would be smart to just redo everything with GameSparks? \$\endgroup\$ – Eric David Tippett Dec 24 '16 at 4:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.