thefacelessj
started a topic on Tue, 16 September 2014 at 3:32 AM
My game has 8 power ups, which can be bought with ingame credits, or earned in game, and then used at will in game.
What is the best way to keep track of these items. I've noticed that buying a consumable puts a new instance of the item in the player's inventory, rather than increasing the amount of that item (i.e increasing uses remaining). Obviously, this means I'd need to keep track of potentially hundreds of instance id's to know if the user has any power ups available. My current approach instead is to maintain a local copy of the items and counts and store that in the player's UserData.
However, this approach means, when purchasing a new power up with ingame credits, I need to call PurchaseItem, ConsumeItem, and UpdateUserData. 3 http requests in a row, to perform a single action, which for slow connections can be a bit of a pain, since I need to wait for success responses to the first two requests.
Is there a better way to handle recharging item counts?
Thanks,
Josh