0
\$\begingroup\$

Im designing a game with both digital currency and player progression, but have hit a confusing snag, where I possibly can't be the first to come to a decent solution.

To keep it simple, it's a mobile game, where the player is identified by his Device ID in the beginning. He is encuraged to connect with facebook, and if he does so, will be identified by his Facebook User ID (FBID) instead. For security reasons (and because its core to the game) you can only play online, and progression and resources are maintained by the server.

So far, the flow is simple:

  • If the server has no FBID on the user, an account is created based on his DeviceID, and he plays on that.
  • If the user connects to facebook, the account is updated with the new FBID, and all resources are carried over.
  • If the player deletes the app, and redownloads it, we still identify him based on device id, and he gets his old account back.

But here are the area that I'm concerned:

If the same player has a second device, he would like to play from instead/also.

It's a fair scenario that if the player requires an tablet next to his phone, and he wants to play with the same account.

So my play so far, is to wipe the "temporary account" from the server, find the account with the matching FBID, and add this new device to an array of devices on the original account.

I have session based control, so they can't be playing on the same time. The old device will simply be logged out if the same user appears on the new one.

But I have a feeling this is not the best way of doing things. What if the "temporary" game is played by someone else, and that person will technicly get his account wiped and device "taken over" by the logged in user ? Im especially concerned about family-type scenarios, where devices are shared.

Does anyone have any good suggestions on structure on this ? Maybe I'm completely in the woods with my method here, and doing it all wrong.

My priorities are :

  • Duplication of ingame resources must not occur
  • A player should never be "punished" by starting over, if he signs in using facebook.
  • A player should be able to maintain and restore his progress in the game, even if he logs out.
\$\endgroup\$
0
\$\begingroup\$

I would have a table with three important fields: PlayerId, FacebookId, EmailAddress

If they don't want to connect with Facebook, you use email address as your unique identifier for a player. If they eventually "migrate" to Facebook, you shove the FBID in that record.

Devices are in a separate table with two important columns: PlayerId, DeviceId.

This way, it doesn't matter how many devices they have; you can always get back to a unique PlayerId.

\$\endgroup\$

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.