Psychochild's Blog

A developer's musings on game development and writing.

14 April, 2006

Weekend Design Challenge: Random Numbers
Filed under: — Psychochild @ 10:55 PM

A bit late today, due to some other deadlines in my life.

This challenge deals with random numbers, something I’ve talked about before. Here’s the challenge: Give specific examples of mechanics where it is better to use rolling with replacement or rolling without replacement. How can you use random numbers (with or without replacement) to avoid making the game feel arbitrary?

Read the more for definitions of rolling with/without replacement and my thoughts.

Rolling with replacement is like rolling a typical 6-sided die. In theory, any of the sides could face up, so any number could be chosen. This is the most random, but it has one flaw: It is entirely possible (but increasingly improbable) to get a string of numbers. The person that rolls the same number in a roll either feels very lucky, or very unlucky.

Rolling without replacement is like drawing cards from a deck, then discarding the card. So to simulate a die you could have a deck of six cards, each card having the number of a face of the die. The cards are shuffled and you pick one card to get a random result. When all cards have been chosen, you shuffle them and pick again from the deck. The advantage is that you don’t get the improbable, but possible, string of a single number as described above. On the other hand the rolls can get somewhat predictable, particularly if you have a small range of results.

Let me start with the second question first, how can you make the numbers feel more fair? If you are using rolling with replacement, you can use a non-linear random function. A physical example of this is to use the sum of multiple dice. For example, in some games you use 3d6 to roll a result. The results for this roll are actually a bell curve, so that the extreme results (3 and 18) are relatively rare, but the middle results (10-11) are very common.

For rolling without replacement, you can use multiple sets of cards shuffled together. So, in the example above we might have four sets of cards each simulating a 6-sided die, for a total of 24 cards. The rules are the same: shuffle the cards and discard them when chosen, reshuffling the deck when all cards are chosen. This gives you a bit less predictability, while still eliminating the “long sequence of a single number” problem. (Of course, in the example above you could still get a sequence of 4 of the same number.)

What mechanics are suitable for each type? As an example, I think any advancement mechanics, if they have a random component, should have rolling without replacement. This makes advancement more uniform, so that players will not advance too fast or to slow. Quest drops are another good example, so that a player does not get too frustrated at the lack of drops, and get even more frustrated when other players get all their drops quickly.

On the other hand I think skill use should use rolling with replacement. Why? Because a player could learn to game the system, particularly in PvP. Just use the skill until you are sure that you have made several “low” rolls, then go attack a player and you have several high rolls. This may sound laughable, but experience shows that some people will do this. You could do things to obfuscate the rolls in a rolling without replacement situation, but that would add complexity and start to eliminate some of the benefit of that method.

What do you think? What mechanics should use which method?







10 Comments »

  1. Random thought: for binary decisions (e.g. does my attack hit the enemy or miss) you can do something simpler and more flexible than rolling without replacement. Just shape the probability based on past results. E.g. each time you get a hit, the probability of a hit is reset to P. Each time you get a miss, you could set P=1-K*(1-P) for some value of K like 0.80. As long as you keep missing, a hit becomes more and more likely until you get one. You can even shape the probability curve in arbitrary ways (i.e. have an array of probabilities with your arbitrary curve, and advance the index into the array by one each time you miss and reset it to 0 when you hit).

    Comment by moo — 16 April, 2006 @ 5:14 PM

  2. One thing that should definately use without-replacement is random drops, particularly quest drops. Given enough time, a player should be able to accumulate enough Rat Spleens for his or her quest, even if they drop less than 1% of the time.

    I really can’t think of any way this could be gamed, like your combat example, because the whole intent of the system is to ensure a rare drop.

    Comment by Slyfeind — 16 April, 2006 @ 6:13 PM

  3. This isn’t answering the question, but I figured I’d share it just the same.

    I like the idea of combining random number with and without replacement. For example, make a roll of 3d6. Use this result to look into a table. On a 3, you know the player is about to get a string of bad luck. Let’s say 1 out of the next 8 swings will hit. For a 10 or 11, the player would go 4 out of 8, and an 18 would get 7 out of 8. You could still get really unlucky, but this way, you could always guarantee that the player gets some hits in.

    Comment by Notin — 16 April, 2006 @ 6:52 PM

  4. The primary characteristic for when which system is preferable is sample size. If I’m killing frobozz knights to get the widget of dancing +4, whether I care about the type of RNG is going to be determined by how many drops I really want. If the drop rate is 1/100 and I kill one million of them, I’ll be pretty well assured to have somewhere around 10k widgets [bell curves, standard deviation, etc]. I really don’t much care if there were long dry spells in there or really hot streaks. With replacement works just fine for me here. Everything changes, though, if I don’t want a huge supply of dancing enhancers and just want one. Now the difference between a hot streak and a cold streak has enormous implications for me and I would very much like to know that there is a guaranteed end to the madness at some point. Bottom line: If an action is repeated enough that I care more about the long term averages than the result of a single action, with replacement is good, and likewise, when I care about a single action or small set of actions more than the long term, without replacement becomes preferable.

    Without replacement has a pretty serious implication in that it requires that whatever decision is based on the result now has a state which must be maintained. That opens up a whole new can of worms. Maintained for how long? What happens when the another action is taken which is incompatible with the previous state but relies on the same mechanic? For example, to-hit combat mechanics. I miss 3x and by [magical mojo] am now due a hit; however, I stop fighting for an hour and now go attack something entirely different. Am I still due to hit? Reset to base random? These are are answerable questions in the design, of course, but that’s not the problem. The problem is that they are questions which need to be answered. The servers already have enough on their plate without being asked to store more information and make yet more decisions for what is a pretty common mechanic.

    Putting things together, we have two basic criteria for when we want to use a RNG without replacement: when short-term results trump long term averages and when tracking the state of the RNG doesn’t add unnecessary complexity. Thankfully, these two often go hand in hand. For example, from a loot perspective, the amount of cash a mob drops can easilly be determined by a with-replacement system. Rare item drops, especially quest drops, on the other hand, are better handled without replacement. The quest system already is tracking state for the quest, so this is just one additional piece of info and is tracked in-sync with the rest of the quest.

    Comment by ReptileHouse — 17 April, 2006 @ 9:09 AM

  5. I really like the random number normalization algorithm you’re proposing, but I’m somewhat concerned about persistence. After all, there’s a lot of random numbers in a MMO. Ex. loot drops, different weapon hitting/damage, or maybe stat determination during a level gain. Arguably, you don’t have to persist all of these random number sequences.

    On the other hand, for quests, it’s probably important to maintain the random normalization state. Without discussing an exact nature of how to efficiently store the state of this random number normalization algorithm, I’m guessing it’s going to take quite a bit more time and space. Perhaps this is why most MMOs just leave things to chance.

    Comment by Bobby Thurman — 17 April, 2006 @ 11:27 AM

  6. moo wrote:
    Random thought

    Actually, that’s how Meridian 59 handles skill advances. Each time you succeed with a skill you get an advancement check. If the check fails, it records the success and gives you a slightly better chance to succeed next time. You are guaranteed to succeed within a (large) number of attempts. So, this method does work very nicely in some games.

    Comment by Psychochild — 17 April, 2006 @ 3:54 PM

  7. An interesting thing to keep in mind when deciding between these options is that rolling with replacement might not seem as random to your players as it really is. I remember hearing about an experiment in which subjects were repeatedly asked to judge which set of coinflips looked more “random”, and were presented with a truly random* set as well as a set that was biased to have fewer consecutive strings of HHHH or TTTT. Subjects always thought the biased set seemed more random. Likewise, when asked to come up with strings of “random” numbers themselves, subjects’ strings consistently have fewer strings of the same number than truly random strings. Something to keep in mind…

    *(probably technically created with a pseudorandom number generator, but quite close to random comparatively.)

    Comment by Dr. Gold — 17 April, 2006 @ 9:35 PM

  8. It’s a question of philosophy I think. For example, Dark Age of Camelot uses a loot distribution system that I’m pretty sure is a simple replacement system. Going through a dungeon I might wind up with more than my fair share of drops, or less. Over the life of a character I’m sure it averages out. But for more instant-gratification a non-replacement system might work better–or not. :) If there are 8 party members, then you get a drop only every 8th time. This has its own problems of course, and perhaps a weighted system could even be thrown in based on the value of the loot being dropped. I.e., if the average drop is worth 50g, and I just got a ring worth 25g, maybe my “card” gets replaced this time around.

    Using a sufficiently robust skill system, the concept of luck could be introduced by injecting a period of non-replacement into a system that is otherwise a replacement system. Perhaps a “Good Luck” skill on a timer could be implemented by making all low-rolls non-replacement, while all high rolls are replaced. Over the course of a battle the player would notice their hit rate (or whatever you are good-lucking) gradually increasing. When the timer expires, the system is reset.

    The obvious (to me) place to use a general non-replacement system is in situations where you eventually want the player to succeed at something. If a quest depends on a player locating a secret door, you probably want them to eventually succeed even if their “Detect Secret Door” skill is very low.

    Comment by Amber — 18 April, 2006 @ 5:10 PM

  9. Notes toward systematizing a combat design

    [...] Integrate Psychochild’s Random Number challenge, particularly rolling without replacement. [...]

    Pingback by Mischiefblog — 30 March, 2007 @ 3:31 PM

  10. Weekend Design Challenge: Paper RPG dice

    [...] easiest way to resolve this is to use random numbers without replacement instead of simple dice. The problem is that this can lead to a certain amount of predictability. If [...]

    Pingback by Psychochild's Blog — 5 January, 2012 @ 12:31 AM

Leave a comment

I value your comment and think the discussions are the best part of this blog. However, there's this scourge called comment spam, so I choose to moderate comments rather than giving filthy spammers any advantage.

If this is your first comment, it will be held for moderation and therefore will not show up immediately. I will approve your comment when I can, usually within a day. Comments should eventually be approved if not spam. If your comment doesn't show up and it wasn't spam, send me an email as the spam catchers might have caught it by accident.

Line and paragraph breaks automatic, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Email Subscription

Get posts by email:


Recent Comments

Categories

Search the Blog

Calendar

March 2019
S M T W T F S
« Nov    
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Meta

Archives

Standard Disclaimer

I speak only for myself, not for any company.

My Book





Information

Around the Internet

Game and Online Developers

Game News Sites

Game Ranters and Discussion

Help for Businesses

Other Fun Stuff

Quiet (aka Dead) Sites

Posts Copyright Brian Green, aka Psychochild. Comments belong to their authors.

Support me and my work on