question

Steffan avatar image
Steffan asked

How to deal with the Economy v2 request limit?

Players in my game have 2 inventories, a small item pouch on their character and an item box with unlimited space. Players can retrieve/deposit items from either inventory whenever they want, but they reach the request limit very easily by doing this and as a result, their actions don't get saved to playfab.

So I thought I would just batch all operations and only send to playfab when the batch becomes full, but unfortunately I can't seem to do that. Operations take place on both inventories all the time so I can't use ExecuteInventoryOperationsAsync as the ExecuteInventoryOperationsRequest only takes one CollectionId. I can't keep 2 ExecuteInventoryOperationsAsync either because the transactions rely on the other inventory to be up to date, if I fire one ExecuteInventoryOperationsAsync for the Item Pouch while the Item Box isn't up to date yet I will just get a Items not found in collection error.

what do?

In-Game Economy
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

·
Neils Shi avatar image
Neils Shi answered

As the document of API ExecuteInventoryOperations mentioned that “All operations must be done within a single inventory collection”, so, if you want to transfer items between “item pouch” and “item box”, so, you may use the API TransferInventoryItems directly. You can use Azure Function with title level entity token to implement it, because title level token allows more requests to be sent than player token and is more secure.

2 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.

Steffan avatar image Steffan commented ·

I've implemented your suggestions but I am still hitting the request limit sometimes. My game server does all the inventory handling, so I'm already using the title entity to do it. My game doesn't have a lot of players yet, so I'm worried this is going to be an even bigger problem in the future when my game grows. Will the request limit increase if I upgrade my playfab plan? My title id is 770E4.

0 Likes 0 ·
kylemc@microsoft.com avatar image kylemc@microsoft.com Steffan commented ·

The request limit is applied per-player based on the value in the Entity parameter in your requests. If you're hitting the (per-player) limit sometimes now, you'll continue to hit that limit. You should not need to worry about the per-title limit in most Inventory scenarios so things should not get worse as your game grows.

1 Like 1 ·

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.