Monday, May 13, 2013

Randomness in Card Hunter

There are certain games which would be impossible to play without randomness, for example Poker. And personally I like some degree of randomness in tactical games, because it adds to replayability if for some reason you want or need to do the same combat again or a similar one. Thus I am quite happy with the random card drawing mechanic in Card Hunter. Having said that, randomness is not something binary which you either have or have not. There are varying degrees of randomness, from the minimal variations of the damage your fireball does in World of Warcraft, to games where a random event has a stronger influence on the final win or lose result than any strategy or tactic.

Now Card Hunter in this respect is somewhat weird, because how random the game is depends on your level. As I described earlier, with levels you get new gear slots, and each gear slot comes with a fixed number of cards, even if you don't put anything in. Thus your "deck" gets thicker with level. And that is something that every Magic the Gathering deckbuilder is painfully aware of: The thicker your deck is, the more random it gets.

Imagine a simple deck of 10 cards, 5 red and 5 black. Your chance to draw a red card is 50%. Double the deck to 20 cards, 10 red and 10 black, and obviously your chance to draw a red card is still 50%. But how about the chance that if you draw two cards, you draw exactly one red and one black? Or the chance to draw 3 red cards in a row? I won't do the math here, but it is easy to show that the probabilities for multiple cards depend on the number of cards in the deck. The 10-card deck has a lower chance to draw 3 red cards in a row, because the percentage of black cards remaining in the deck goes up by more after each red card drawn than in a 20-card deck.

Thus at level 10 in Card Hunter I find myself more often with "extreme" results like drawing only movement cards than I did in the first few levels where my deck was much thinner. The other effect is that if you have one specific card in your deck which you would like to draw, the higher you are in level in Card Hunter and thus the thicker your deck is, the lower is your chance to draw that card. To some extent I can counter this increased randomness by adapting my tactics, for example spending a turn running away from the monsters if I drew lots of movement cards but no attacks. But it does happen that I lose a fight and then win it on the next try with the same basic tactics, just because of a better luck of the draw. Well, I guess that is the price you have to pay to get a bit of random variety into your game.

Now Card Hunter in this respect is somewhat weird, because how random the game is depends on your level. As I described earlier, with levels you get new gear slots, and each gear slot comes with a fixed number of cards, even if you don't put anything in. Thus your "deck" gets thicker with level. And that is something that every Magic the Gathering deckbuilder is painfully aware of: The thicker your deck is, the more random it gets.

Imagine a simple deck of 10 cards, 5 red and 5 black. Your chance to draw a red card is 50%. Double the deck to 20 cards, 10 red and 10 black, and obviously your chance to draw a red card is still 50%. But how about the chance that if you draw two cards, you draw exactly one red and one black? Or the chance to draw 3 red cards in a row? I won't do the math here, but it is easy to show that the probabilities for multiple cards depend on the number of cards in the deck. The 10-card deck has a lower chance to draw 3 red cards in a row, because the percentage of black cards remaining in the deck goes up by more after each red card drawn than in a 20-card deck.

Thus at level 10 in Card Hunter I find myself more often with "extreme" results like drawing only movement cards than I did in the first few levels where my deck was much thinner. The other effect is that if you have one specific card in your deck which you would like to draw, the higher you are in level in Card Hunter and thus the thicker your deck is, the lower is your chance to draw that card. To some extent I can counter this increased randomness by adapting my tactics, for example spending a turn running away from the monsters if I drew lots of movement cards but no attacks. But it does happen that I lose a fight and then win it on the next try with the same basic tactics, just because of a better luck of the draw. Well, I guess that is the price you have to pay to get a bit of random variety into your game.

Comments:

With 10 cards: 5/10 * 5/9 ~= 27,8%

With 20 cards: 10/20 * 10/19 ~= 26%

With infinite cards: 1/2 * 1/2 = 25%

With 10 cards: 5/10 * 4/9 * 3/8 = ~8,3%.

With 20 cards: 10/20 * 9/19 * 8/18 =~= 10,53%

With infinite cards: 1/2 * 1/2 * 1/2 = 12,5%

Of course, bigger decks add uncertainty and thus risk. But they do this because they usually consist of more

You are guaranteed one movement card, but otherwise the cards from all gear is shuffled together. So it can happen that you draw only armor, or only movement cards, instead of some mix of cards from different pieces of gear.

Actually if you don't put any boots, you're stuck with the default boots which have 3 Walk cards. Thus upgrading will never dilute your deck, the number of cards in your deck only depends on your level; there is no gear that changes the number of cards in your deck.

<< Home

Newer› ‹Older
> just because of a better luck of the draw

Well, that's what a card game is (almost) all about, I guess!

Well, that's what a card game is (almost) all about, I guess!

Yes, but the additional slots usually come with more powerful options as well.

In a system that isn't governed by something like mana that restricts how many options you can play every turn, having more options isn't necessarily a bad thing.

In a system that isn't governed by something like mana that restricts how many options you can play every turn, having more options isn't necessarily a bad thing.

*Double the deck to 20 cards, 10 red and 10 black, and obviously your chance to draw a red card is still 50%. But how about the chance that if you draw two cards, you draw exactly one red and one black?*

With 10 cards: 5/10 * 5/9 ~= 27,8%

With 20 cards: 10/20 * 10/19 ~= 26%

With infinite cards: 1/2 * 1/2 = 25%

*Or the chance to draw 3 red cards in a row?*

With 10 cards: 5/10 * 4/9 * 3/8 = ~8,3%.

With 20 cards: 10/20 * 9/19 * 8/18 =~= 10,53%

With infinite cards: 1/2 * 1/2 * 1/2 = 12,5%

Of course, bigger decks add uncertainty and thus risk. But they do this because they usually consist of more

**different**cards, I think. Just increasing the number of cards, but keeping the number of different cards in the same relation, doesn't change all that much, I think.

There is a reason why there is minimum of 60 cards in magic the gathering deck and that very few decks don't try to reach it.

The newer incarnations of Tetris have a "pseudorandom-ness" in which you are guaranteed to see one of every piece before a new set of random pieces is generated.

See more: http://tetris.wikia.com/wiki/Random_Generator

This could be translated in a random generator for a deck. The "shuffling" would have to ensure at least 1 attack card every X cards drawn (or whatever is best for the game) just making sure you actually have attack cards remaining in the deck. (in other words it wouldn't fix a bad deck.)

I definitely believe pseudorandom is better for most games. For example in Tetris, a master player can start to get a feel for the next few pieces coming without actually seeing them. It adds a little more player skill growth to the game.

See more: http://tetris.wikia.com/wiki/Random_Generator

This could be translated in a random generator for a deck. The "shuffling" would have to ensure at least 1 attack card every X cards drawn (or whatever is best for the game) just making sure you actually have attack cards remaining in the deck. (in other words it wouldn't fix a bad deck.)

I definitely believe pseudorandom is better for most games. For example in Tetris, a master player can start to get a feel for the next few pieces coming without actually seeing them. It adds a little more player skill growth to the game.

Nils numbers are for the odds of drawing specifically red and then black (or black and then red) but not for both at once. The actual odds are:

With 10 cards: 1 * 5/9 = 55.6%

With 20 cards: 1 * 10/19 = 52.6%

With 'infinite' cards: 1 * 1/2 = 50%

With 10 cards: 1 * 5/9 = 55.6%

With 20 cards: 1 * 10/19 = 52.6%

With 'infinite' cards: 1 * 1/2 = 50%

*I thought you draw from each gears "deck" all the time?*

You are guaranteed one movement card, but otherwise the cards from all gear is shuffled together. So it can happen that you draw only armor, or only movement cards, instead of some mix of cards from different pieces of gear.

It helps add more tactical gearing choices. Do you really want to upgrade your boots when it only gives you more and stronger running cards, but also dilutes the chance that you'll draw your best attacks.

I can imagine a BiS item that provides just one or two cards that are very strong.

I can imagine a BiS item that provides just one or two cards that are very strong.

*Do you really want to upgrade your boots when it only gives you more and stronger running cards, but also dilutes the chance that you'll draw your best attacks.*

Actually if you don't put any boots, you're stuck with the default boots which have 3 Walk cards. Thus upgrading will never dilute your deck, the number of cards in your deck only depends on your level; there is no gear that changes the number of cards in your deck.

Ok. I see. I was imagining that items provide more than just the card. I had a mental image of items that provided more or less cards than the standard amount (to squew the type mix) or others that provided passive abilities at the cost of supplying weaker cards.

This reminds me of the ever ongoing topic in MTG Online forums: is the shuffler truly random?

The irony is that the computerized shuffler is quite random but new players coming from the paper environment are used to their own "shuffling" which is more like weaving in the mana with the rest of the deck.

So they are used to getting a nice consistent draw of mana. But when they hit a real random shuffler with all of its clumps etc., they are getting initial draws with no mana or all mana and are claiming the shuffler is not random. The truth hurts.

The irony is that the computerized shuffler is quite random but new players coming from the paper environment are used to their own "shuffling" which is more like weaving in the mana with the rest of the deck.

So they are used to getting a nice consistent draw of mana. But when they hit a real random shuffler with all of its clumps etc., they are getting initial draws with no mana or all mana and are claiming the shuffler is not random. The truth hurts.

pk, of course computerized shuffler is not truly random, as computer has no way to generate random events.

Typical computerized random number generator takes a number (called seed) and generates pseudorandom number sequence based on it.

The most often used seed is current system time. Most high-level programming languages also have an instruction to seed random number generator with whichever number the programmer wants.

Typical computerized random number generator takes a number (called seed) and generates pseudorandom number sequence based on it.

The most often used seed is current system time. Most high-level programming languages also have an instruction to seed random number generator with whichever number the programmer wants.

@souldrinker: actually, most RNG do a much better work than a pseudorandom sequence, using either an entropy pool from system events, or, as it's available on some platforms, using an hardware RNG in the motherboard chipset which is based on the fluctuation-dissipation theorem.

Shuffling can do an excellent job if you shuffle right, which usually involves splitting the deck into a prime number of separate piles, repeating the process a second time with another prime number and then shuffling "the usual way".

Shuffling can do an excellent job if you shuffle right, which usually involves splitting the deck into a prime number of separate piles, repeating the process a second time with another prime number and then shuffling "the usual way".

I agree. Computer random number generators aren't mathematically speaking "perfect", but they generally produce much better random numbers than shuffling a deck, or even rolling dice!

Physical RNGs like dice inevitably have physical imperfections which make the distribution of results nonuniform. However, their results still are random (albeit with different distribution).

Pseudorandom sequences, on the other hand, emulate uniform distribution very well precisely because they are not random.

Didn't know they put physical RNGs in motherboards these days.

Post a Comment
Pseudorandom sequences, on the other hand, emulate uniform distribution very well precisely because they are not random.

Didn't know they put physical RNGs in motherboards these days.

#### Links to this post:

<< Home