laurentiumarianivan avatar image
laurentiumarianivan asked

Rotating shop items

Hello everyone!

I need some help regarding my game's shop functionality. I have some in-game tokens which I know how to implement with PlayFab.
What I am not sure how to implement is drop tables with a timer. What I mean more exactly:
I have 4 item rarities: common, rare, epic and legendary.
I have 3 item slots which spawn items every 24 hours (for testing purposes I will set this, in the beginning, to 5 minutes).

Each of these 3 item slots spawn an item, and each item slot has different rarity chances for rarities, following these rules:

1st slot - 75% chance of spawning a common item, 15% chance of spawning a rare item, 10% chance of spawning an epic item, 5% chance of spawning a legendary item
2nd slot - 50% chance rare, 50% chance epic
3rd slot - 33% chance rare, 33% chance epic, 33% chance legendary

After the user buys an item, he doesn't get a new one spawned in the store until the timer restarts.

My question is, how do I implement this system more exactly? Do I create 3 drop tables, one for each item slot and in the catalog I set the rarity for each item?
And the second question is, how do I implement the timer?

CloudScriptIn-Game Economygame manager
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

Seth Du avatar image
Seth Du answered
  • To implement the respawn items slot:, You will need to define several drop tables:

    Items of different rarity should have been defined.

    Define 3 helper drop table, which is on the basis of rarity. According to your description, there should be 3 and for example, I create a drop table named “drop_common” and add all the common item into it. Each item inside share the same drop rate (the weights are all 1). the creation process is the same for “drop_epic” and “drop_legend”

    Create the drop table for each slot. For example, for the slot1, you may add the three helper drop table into it and change the weights for “drop_common”, “drop_epic” and “drop_legend” with 75, 15 and 10 separately.

      • The rest of the design can be various. You may also create containers and add those slots into it separately so that players can manually open them.
      • To set up timer, there are many workarounds. We will recommend using Scheduled Task, and please understand that the item slot is player-specific data, hence you may use Scheduled Task with Cloud Script/Azure Function to modify the purchase counts at places like Player Read-Only 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.

      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.

      Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]