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?
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?
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.
2 People are following this question.