question

operation283 avatar image
operation283 asked

Easiest Way to Find New Items in Inventory?

After matches in my game, players are given items by the server, and I need a way for the players to figure out what new items they have obtained since they last played. I have a few strategies to accomplish this, although they all seem to have issues in specific scenarios.

My two strategies so far were:

1. Save the player's inventory locally before they leave the game and compare the new inventory to the local one when the player rejoins. If someone goes wrong with saving the inventory or a player switches devices, then the player would count all items as "new" and that would be an issue.

2. Store the date of the item's creation in the annotation and use the date to determine whether the item is new or not. I don't think this would work with stackable items, however.

Can anyone suggest which of these solutions would work better or perhaps has another solution?

In-Game EconomyPlayer Inventory
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

Sorry for the delay on this. You're correct that stackable items wouldn't show an updated date unless you specifically used custom data for that. In general, keeping the data locally and comparing it the next time the player logs in is going to be your best bet.

10 |1200

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

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.