question

brendan avatar image
brendan asked

How to create a card pack

Question from a developer:

I'm working on making a trading/collectible card game, and need to be able to sell card packs that contain cards of varying rarities. What's the best way to do this?

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

·
brendan avatar image
brendan answered

This is exactly the sort of thing our random result tables ("drop" tables) were designed to do. First, have a look at this tutorial: https://api.playfab.com/docs/tutorials/landing-commerce/droptable.

So, the first thing you would do is build the drop tables - one for all Common cards, one for all Uncommon cards, etc. Since drop tables can contain drop tables, you can build this as a "tree" of tables, where you break down all common items as "common fire", "common earth", etc. (if you have elements), and then below that you could have "common fire weapons", "common fire armor", etc. The idea is that the bottom-most level of your drop tables can then be used in different ways (you could have a drop table that returns a random weapon, for example).

Now, many TCGs/CCGs use a set number of each rarity in card packs - 5 common, 3 uncommon, etc. If that's your design, skip down to the next paragraph, on creating the bundle or container to sell. Otherwise, you'll now want to create drop tables that have your distribution odds for different card types - so, a table that can return any rarity, with the weights set how you want.

Finally, you'll make a bundle or container that has the appropriate number of cards (bundle if you want packs to auto-open when purchased, container if you want players to be able to open them later). An example bundle/container would have 4 draws from the "all common cards" table, 2 draws from a "normal odds of any kind of card" table, and 1 from a "better odds of a rare or legendary card" table.

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.

ebridavid avatar image ebridavid commented ·

Perfect. Thanks.

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