Tuesday 27 September 2011

Chance and streaks

When using chance in a game, it is quite easy to be fooled that you can manage it the same way as deterministic mechanics by employing some simple maths.

You may think, when designing a mechanic, an effect working 50% of the time is basically the same as one that works all the time and is half as good. Where this falls down is the chance for streaks.

Tom Lehmann, one of my favourite designers talks about streakiness a great deal. Tom is one of my favourite designers. He can make games with chance feel like deterministic involved Eurogames. He manages chance well, so he still gets all the flavour you get from having lots of randomness. Managing streaks in draws, and accounting for them in his games, is a key part of how he succeeds in doing this.

Streakiness is a clumsy feeling word, so I may stick with other phrases from here.

Streaks of results one way or the other can break a game. If you have a game that breaks with a specific run of cards at the beginning, it may not seem like a big deal. If your game gets played enough, its going to happen in to some game groups, and ruin their experience of your game.

Streaks of results. also has a strong psychological effect. In Path of Exile this has come up with "to hit" chances. Mathematically we want evasion and armour to have similar damage mitigating effects over time. However a low chance to hit feels much worse than an equivalent loss of damage dealing.

Being an action RPG, you hit things a lot. An 80% to hit rate isn't freat, but looks OK on paper. When you have a game session where you might make 3000 to hit attempts. You are highly likely to get a streak of missing 5 times in a row. Missing those five times in a row, that will be the bit you remember. If you drop the to hit chance to 75%, you are quite likely to get a streak of 7 misses in a row. (My maths on this is rough post card stuff, and discussed below.)

Some games actually mess with the odds to get more even feeling chances. In one of the Civilization games, where early game losses are critical, you can't lose two 50% chance battles in a row. Drop rates in World of Warcraft were homogenised, specifically to avoid the negative feelings around streak runs of non-drops of quest items.

In Path of Exile, we have reassessed what sort of to hit rates we want. We still want strong evasion to be a feature of PVP, but have dropped evasion rates of fodder-monsters in PVE play. In PVE you do more hits overall, so a higher hit rate is needed to avoid unpleasant feeling streaks. In PVP, players building specifically for evasion may be hard to hit, but as it was a players choice, it feels less negative than against monsters.

--
The maths bit - The math around streaks is more problematic that you might first expect. My back of the post card guess of how to assess the likely hood of a run of a certain length was something like:

1- ( (1-C^s) ^ (S-s) )

Where C is the chance of the event you want to measure, s is the length of the streak and S is the length of the series.

So for a streak of five misses of 20% chance to occur in a run of five, that gives us (1-.2^5).

In a series of 3000, there are 2996 consecutive runs of five to hit chances, which gives us:

1- ( (1-.2^5) ^ 2996 ) = 0.616675515

A 62% chance of a streak of at least 5 to occur within this series.
However, this doesn’t accurately model the situation as the consecutive series of five aren't independent of each other.
For a better idea this article gives a good look at assessing streaks of coin tosses and shows how to deal with the inter-dependence. As you can see, the maths isn't that easy. It is much easier to work out with recursive programming, but the main lesson I got from it is that an approximation will do for my purposes.

2 comments:

  1. I totally agree with you about streakiness, esp. bad streakiness being something that players remember and often complain about it.

    It is all about player perception. And the players experience the game in real time.

    So, how viable would it be to have some kind of rule that x-numbers of misses per minute of game play were impossible? So once you have missed x times in a minute the next attempt is an auto-hit, with the timer being reset everytime a hit occurs.

    ReplyDelete
  2. It is certainly something that could be done. It is similar to what Blizzard have done with drops in World of Warcraft, where you can't get long runs of quest items not dropping. I think they just set the items to drop on a regular cycle however.

    ReplyDelete