1

I'm using the Parse framework to create player account functionality in an iOS game so that data is accessible at any device. However, I'm not sure what the best approach to 'sync' this data would be in order to minimise the api request count yet make it appear as everything is always synced. I'm currently refreshing data at startup, coming from background and after each game. However, that is already creating a lot of requests! I was thinking of placing a 'sync' button in the menu so that only then data is synced and normally saved only locally but it's the last resort really.

Game Outline:

  • The players sign up or login using their account or Facebook details
  • Player chooses avatar
  • Choice is stored to their account
  • They play a 'game' and eventually they lose
  • The summary screen is shown and points are added, new player level is calculated and stored
  • Player can buy hints and helpers via in app purchase (consumable)
  • The number of hints and helpers is stored to their account
  • Game is universal so must be in sync with devices

What is the best practice for use of Parse in an online GAME with many players?

Edit:

I solved the problem by creating a NSCoding compliant NSObject that I then archive and save to Parse. This means all data is saved and loaded at once and I only need to update it at startup and after important events.

1 Answer 1

1

As you wrote best approach will be place an 'sync' button to minimize number of request which will be sent to the Parse, because your game can be interrupted at any by incoming call or something else.

You can reorganize your database for example: You have two object User and Image user have a one to many relation to image, when you fetches a User data to retrieve image you need fetch all images related to this user, this will produce a lot of request to Parse, another way is storing in Image an objectId of the User object and fetch Images for that User by objectId and not storing any relations to Image in User object, that way will drastically reduce the number of request to Parse

Sign up to request clarification or add additional context in comments.

4 Comments

Is it a common approach to place a 'sync' button in a game though?
for MMO games - NO, but for your case it can be a solution for your problem with a lot of the request sent to the server. To provide better solution we need more info, what users can do in your game and game type(Action, RPG, RTS, etc).
I've added more detail to the way the game works, thanks for solutions so far.
That's a good tip. I will update this question with the final method. Thanks for help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.