Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Random Vs Pseudorandom

Discussion in 'Game Design' started by absolute_disgrace, Oct 6, 2016.

  1. absolute_disgrace

    absolute_disgrace

    Joined:
    Aug 28, 2016
    Posts:
    253
    I recall Apple talking about their Ipods and how through testing they found that if they shuffled songs in a truely random way, users felt it was less random. Pseudorandom was therefore added to Ipods to ensure particular scenarios were avoided and overall this appeared to satisfy customers. This could be something as simple as 'Never play a song from the same album twice in a row'.

    In your opinion, how can this lesson be best applied to games and can you think of any games that are a prime example of this idea being used?
     
    Mycroft likes this.
  2. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,739
    It's all about feel and what users perceive. We have all played games where we felt we have unfairly lost due to a bad roll of rng.
     
    Martin_H likes this.
  3. Mycroft

    Mycroft

    Joined:
    Aug 29, 2012
    Posts:
    160
    not quite pseudo-random but in the same vein;

    X-COM lies to its users about hit percentages.

    People absolutely hate to see a 95% shot miss; drives them bonkers, but in true random it happens all the time. They've actually implemented a system where if the user sees "50%" the reality is probably closer to 70%. If they see 75%, then it's probably 95 %.

    People really don't like 'true' random. It has spikes and troughs that people think are an indication that the random is broken. People are terrible at statistics and their implications.
     
  4. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,433
  5. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    Chances are you never want completely random results... like ever. Do you want someone to grind ten thousand monsters to get a one in a thousand drop? In all likelihood you want to reward people for their work instead of keeping them on the slot machine, so a benevolent solution is capping how long you can go without getting the drop.

    Even developers, otherwise balancing wouldn't be such a hard issue.
     
    Mycroft, Kiwasi and Martin_H like this.
  6. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    So does the Civ series. Sid did a talk about the whole issue that was quite good. One of the issues was players expected a second random event to follow on from the first. So loosing two 50:50 battles in a row was considered unfair, even though it has a pretty good chance of happening in real life. So the random number generator in Civ has memory built in.

    I think this is the talk. If it's not then listen to it anyway, Sid is a genius when it comes to game design.

     
    Ryiah, MV10, Martin_H and 1 other person like this.
  7. Mycroft

    Mycroft

    Joined:
    Aug 29, 2012
    Posts:
    160
    WoW does something similar with drop rates; it keeps a memory.

    If your success rate drops 'too low' compared to the expected rate, the system actually starts raising your success chance until your success rate gets 'close enough' to the expected rate at which point your success chance goes back to the expected rate.
     
    Ryiah and Martin_H like this.
  8. Mycroft

    Mycroft

    Joined:
    Aug 29, 2012
    Posts:
    160

    I should note that I've implemented a system like this for randomizing a set of test questions with True/False answers.

    They wanted it random, but not so random that it would get long series of true or false questions.

    Worked very well.
     
  9. Devastadus

    Devastadus

    Joined:
    Jan 27, 2015
    Posts:
    73
    I don't think true random is bad or unwanted. If you play board games with dice, for example eldritch horror, it is super fun although the dice be against you at times, you just need to play the most optimal route. I honestly think randomness can make games super fun.
     
  10. BeefSupreme

    BeefSupreme

    Joined:
    Aug 11, 2014
    Posts:
    279
    I remember both the Blood Bowl and Shadow Run Returns forums on Steam being littered with accusations of the AI cheating because probabilities weren't working out like people expected ("I missed two attacks with 90% hit rate in a row, something's wrong with this game!").

    Maybe the lesson is that truly random outcomes aren't very fun, at least in games where the player is making a concerted effort to win. I mean, games that aren't like Dwarf Fortress where the mayhem of epic failure is entertainment on its own.

    One of my favorite things about Invisible, Inc. is that all player actions are deterministic, and randomness is introduced through the way each level is built, enemy placement, etc.

    I like how it places more emphasis on making the right strategic decision rather than on the computer rolling some numbers that you have no control over.

    I also had a terrible time playing Warhammer Quest. That game is so random that it actively undoes any attempt to form a coherent strategy. Moving around the map at snail's pace because you're trying to keep up a formation with your wizard at the back so they don't get murdered instantly? Well that's too bad, because the game's going to spawn enemies wherever it wants, and probably while you're already in the middle of battle.

    I think the board game version is still pretty fun, but the computer just can't replicate the tactile nature of drunken dice rolling. Even though the probabilities are the same, the feel of each version is very different.

    In the game I'm working on, I decided to use weighted lot tables, because if you kill 100 flatulating bovines, one of them better damn well drop the staff of undulating milk sacks.
     
    Dave-Carlile and Martin_H like this.
  11. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    It's not that randomness is bad. It's that unfiltered randomness is bullshit. Take roguelikes where the difficulty of a run is entirely dependent by random item spawns and monster spawns. It's completely possible for a situation to be created that you have absolutely no way of dealing with.
     
    Martin_H, Mycroft and BeefSupreme like this.
  12. BeefSupreme

    BeefSupreme

    Joined:
    Aug 11, 2014
    Posts:
    279
    Thought this Gamasutra blog post talking about using randomness to reduce complexity of choice was interesting.
     
  13. Teravisor

    Teravisor

    Joined:
    Dec 29, 2014
    Posts:
    654
    Pseudo-random all the way:
    1. If you generate something, you can send only seed over network. Other PC can generate exactly same thing too. Also helps to replicate bugs in several rare cases.
    2. You control output how you want. Rerolling complete random or manipulating it to have non-linear statistical distribution to get result we'll be happy with is pseudo-random, right? Example is in OP, also things like "bullet more often hits near crosshair than far from it".

    We only need full random in security, for true unpredictability so that no other person can control/predict input/output. Otherwise, it's always better to control what'll happen than not to.

    This raises another issue: in general, people hate when something depends on random. Just because
    and because our world is survival of mostly not fittest, but luckiest. No matter how good you are, a random car and it's over.
    However, that only goes so far because without random we lose options of simplifying things.
    Do you want to model how galaxy* was created? No? Use random to help generate it.
    * - insert anything you want.
    Do you want to model how character targets, what he thinks while targetting, what condition he's in? No? Use random to calculate hit chances.
    Can you predict what user wants to hear from his music list right now? No? Use random.

    It's good to move some things you can move in reasonable time from random to player's skills. Like minigames to see if it was fail or success. There is, however a pitfall: players would get bored playing same minigame 100+ times in row. And by making it more diverse, you lose development time and resources.
    Would you better to use a day of your life to make a minigame for X-COM shooting and hear "This minigame is so repetitive that it's epically bad" or use a minute to use random and hear "I missed 2 times with 95% chance, random is unfair"?
     
    Martin_H likes this.
  14. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    I hate to spoil the the pre conceived opinions on Random vs Pseudo Random people. I have 30 years experience in the gambling/gaming industry and the player can never tell the difference between the 2 types of random number generation tequniqes. All random numbers usually get boiled down from a huge seed to a number in a small range like 0-1, 0-36, 0-100 etc, for use in any actual game and the player will never be able to tell whats going on under the hood and moreover the a pseudo random number is no more likely to make patterns than a truely random system.

    Like I said 30 years of analysing players perceptions to any particular outcome lead us as a company to some rather annoying conclusions. A true 50/50 is never perceived as such by the player and you need to go to about 65% in the players favour before he thinks it's 50/50. A high low gamble with the numbers 1-12 you need to go to 99% on 11's and 2's before the player thinks it's fair.

    So my 2p's worth, don't fret about it and just use the bog standard RNG built into the OS. If your RNG has to pass some regulatory test then you will have to write your own RNG.
     
    Martin_H and absolute_disgrace like this.
  15. MV10

    MV10

    Joined:
    Nov 6, 2015
    Posts:
    1,889
    That's a great video. Though I'm not sure I necessarily agree that a "2:1" battle must have the same outcome as a "20:10" battle. I think in the player's mind -- because probably this applies to real-life conflict -- the events which would unfold in a "20:10" scenario are probably more complex than "2:1"... (and if you haven't watched the video yet, go watch it, overall it's more complicated and interesting than the point I've chosen to single out).
     
  16. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,141
    Roguelikes may not be the best example though because the audience actually expects to be abused by the randomness. :p
     
    BeefSupreme and MV10 like this.
  17. absolute_disgrace

    absolute_disgrace

    Joined:
    Aug 28, 2016
    Posts:
    253
    Masochism through randomness.
     
    BeefSupreme, MV10 and Martin_H like this.
  18. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    There's a pretty big difference between picking any given thing at random (which can potentially produce what appears to be some 'clumping' or 'repeating' or a sense of similarity, just randomly), versus making sure that each thing only gets picked once until all things have had a chance to be picked.

    Please bear in mind though that there's a) no such thing as totally random anything, b) all so-called random numbers are based on some kind of algorithm which makes it psuedorandom, or its based on data recorded from a seemingly 'random' natural source. But either way, randomness is relative.

    Even when you generate a lot of random numbers there are some `non-random` characteristics that emerge, like numbers being close together, sometimes the same number repeating, sometimes numbers occurring in a short sequence, etc. That's the nature of randomness. It doesn't mean every number is equidistant or vastly different from every other number. Equidistant numbers are orderly and not random. So that means the random number has to sometimes be close to equidistant, making it appear not entirely random. This is why forcing certain numbers to be now allowed to show up 'too close' to each other as to avert the appearance of repetition or trends, produces a different kind of experience.

    If you do any procedural content generation based on scripting and randomness you'll run into this stuff.
     
    Billy4184 likes this.
  19. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,984
    @imaginaryhuman that's a great point, in game development I think very rarely is a designed implementation a bad idea. Besides the fact that a lot of people say 'random' but think 'spontaneous awesomeness' as in No Mans Sky, it's also the case that, being psychologically more attentive to negative feedback, humans will see a 50/50 of good/bad as being much worse than even. Players want to see, in the limited time that they play a game, only the best of what randomness has to offer.

    A good example of where I've found randomness to be non-useful is random spawning of enemies or rewards, it inevitably leads to a clump situation and even I as the developer question whether or not I did something wrong. And in a game, the moment that a user sees something that doesn't match their expectations, the whole game is brought into doubt and immersion is broken.
     
    Mycroft likes this.
  20. LMan

    LMan

    Joined:
    Jun 1, 2013
    Posts:
    493
    Randomness can be fun- but it's the mystery of it that makes it that way.

    Take the card game "Killer Bunnies"- Picture two identical decks, one of small cards, one of large cards, shuffled independently. The card on the bottom of the small deck is the winning card. Players obtain cards from the big deck through playing the game, and the game ends when there are no cards left in the big deck. That's when the cards from the small deck are revealed, and the player in possession of the card corresponding to the last small card is the winner.

    Thus, it becomes a game of "controlled risk" where the central mechanic is that players play around a value that they have no control over.

    playing cards come from a community deck which is also shuffled, and when that is depleted, the discard pile of used cards is shuffled and becomes the deck again. The wide variation in card type, power and ability makes the randomness of the deck a benefit- as there are few "junk cards" and making trades and deals is encouraged. Whatever temporary setbacks are caused by the randomness, players are rarely in a position where they have no recourse.

    I believe the biggest problems with randomness occur when a player is "punished" with a bad roll despite good play. A good way to alleviate this problem is to never leave the player helpless after a bad roll. Sun Tzu has a famous quote: "To a surrounded enemy, you must leave a way of escape." You can use a bad roll to set up a more interesting problem for the player- to encourage him to rely on a different set of tools.

    For the player, defeat is when they reload and try again- which isn't on its own a bad thing, but it can be when the player feels they could have a better experience by reloading than by continuing the game. When the game wrecks the player's plan, there should be a bait in there to entice the player to take the temporary loss and play for a more interesting win.
     
    MV10 likes this.