question

Matthew Miskiewicz avatar image
Matthew Miskiewicz asked

player data size limit exceeded error not corresponding to usage graph

I've recently integrated PlayFab into my Kongregate game Idle Mage Attack (currently in beta). On the limits for Player data value size, I'm seeing some limit exceeded errors, however I don't see peaks in the usage growth corresponding to these. On my end, it's hard to see how data could be uploaded (by my code) which legitimately exceeds the limit. Could you explain why I am getting these limit errors?

Thanks,

Matt

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Matthew Miskiewicz avatar image
Matthew Miskiewicz answered

Ok, I think I may have determined how it's being caused on my end. Am I correct then, that if the limit is exceeded it won't show up on the Usage graph at all?

8 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

That's correct. When you exceed the burst rate limit, the call is simply rejected. And please note that the burst rate limit is specifically that - the maximum send rate in a short period (1 minute). Over the full session, the average send rate for the player should be much lower - think on the order of a few calls per minute, on average. For example, we have quite a few idle games operating in the service now. The common best practice for those titles is that they only update the player's info in the service when a major change occurs, or every few minutes otherwise.

0 Likes 0 ·
Matthew Miskiewicz avatar image Matthew Miskiewicz commented ·

@Brendan

Aha, ok - now it makes sense! I didn't realize it was a burst rate limit over 1 minute. In that case, it could be getting triggered by a user saving a couple of times in a row (for example, if they make multiple purchases quickly). Right now, I'm sending the player's save data by breaking in into 4 separate key/value pairs, and each pair is about 2-3 kB. If I was to break this down even further into more, smaller pieces, would that allow for greater throughput - or is the limit on the aggregate of the data in one UpdatePlayerData request? I'll look into reducing the overall frequency as well. Thanks!

0 Likes 0 ·
brendan avatar image brendan Matthew Miskiewicz commented ·

No, in fact, many small keys is far less efficient than fewer larger keys. But to be clear, you are sending all those key/value pairs in a single call to update the user data, correct? As long as you're only doing that infrequently (a couple of times a minute, say), that should be fine.

The mistake we sometimes see with folks working on idle games is that they attempt to update the backend data on every click. That's not sustainable, and would be a violation of our fair use policy. As I said, the best practice is to only update when a significant change occurs, or every couple of minutes, otherwise. If you have a requirement for a high level of security, such that you need every transaction with the player to be recorded, you would need to use a custom game server in order to manage the high frequency of calls, and update from it to the service periodically, as per the best practice.

0 Likes 0 ·
Matthew Miskiewicz avatar image Matthew Miskiewicz brendan commented ·

For sure I'm not sending an update every click, so no worries about that! I only save a players game to PlayFab every hour, upon loading the game, and upon any IAP.

That's right, I'm sending 5 key/value pairs in a single API call. I get a string representation of the player's save file, then split it into 4 equal parts (the entire string is about 10 kB). If there is a better way to do this, in your opinion, I'm all ears!

The limits page shows 4 limit exceeded errors in the past 24 hrs, with about 500 logins, which would be a few thousands saves (at least). So the problem isn't serous. Thanks!

0 Likes 0 ·
Show more comments
Matthew Miskiewicz avatar image Matthew Miskiewicz commented ·

The save data is quite long, and nears/exceeds 10,000 characters. In case you are curious how this can be right, there are a hundred entities that have stats tracked, and the save-string has all key+value data. I could reduce the total size by 50% or more by tweaking how things are saved. But, I would need to push an update to reformat all players save files, which has no upside but plenty of downsides!

I need to save after IAP, because the items are consumable and thus not recorded as being in the users Kongregate inventory after being consumed (as far as I know). If a record of consumables (fulfilled and unfulfilled) was accessible from Kongregate, I could keep track of a similar record in local data, then compare the two records on loading the game to see if the user is missing any items. Currently, I just check to see if the user has any unfulfilled items and credit them as needed - but if the user loses their local save right a purchase is fulfilled but before the cloud is updated, there will be no way to recover which consumables have been credited or not (as they will all appear as fulfilled to Kongregate). Cheers!
0 Likes 0 ·
brendan avatar image brendan Matthew Miskiewicz commented ·

Ah, I see - so when you say "purchase", you mean a purchase in the Kongregate system, using Kreds? We do not have a full integration with the Kreds system currently, so I can certainly see needing a workaround for that, as long as the client isn't authoritative at any point in that process.

0 Likes 0 ·
Matthew Miskiewicz avatar image Matthew Miskiewicz brendan commented ·

Yes, I meant Kred purchases - that explains it I think. Thanks for your helpful answers! I'm impressed by PlayFab so far, and already plan to use it in future titles. Cheers!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.