question

Kain avatar image
Kain asked

Recommended pattern for handling items picked up during gameplay?

Hello,

I wanted to make sure I have my head wrapped around this properly before beginning. We have certain items in the game that will probably never be sold through virtual currency. This would be something like ammo or a collectable that the player finds through exploration. Using API calls like "PurchaseItem" for a 0 value item seems like overkill. Is the preferred method for non-store items to just treat it as data as opposed to inventory?

Character Data
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

·
brendan avatar image
brendan answered

Well, you definitely don't want to define items in the catalog with a price of 0, since that gives hackers an easy way to get as much of those items as they want. So either they have a price, or you only give them to players via the Grant... API calls (in Cloud Script or a dedicated server), or you just trust the client to be authoritative about when the player gets them. The questions to answer are, how often can players get them, how many can they get, and how often are they used? If you're talking about continually giving them to players such that it would be many times a minute, I'd say that it's best to track them as data or even statistics. Otherwise, an item that has no price (so that it cannot be purchased, but only granted) would probably be the way to go.

1 comment
10 |1200

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

Kain avatar image Kain commented ·

Thank you. It looks like data is the way to go, then. This would be for things like ammo pickups found in the world, so it might happen many times per minute

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.