Download presentation

Presentation is loading. Please wait.

Published byAbigayle Delisle Modified over 2 years ago

1
“Reducing the world to mathematical equations!” Using Randomness: Both Sides of the Coin Dave Mark – Intrinsic Algorithm LLC Brian Schwab – Blizzard

2
“Reducing the world to mathematical equations!” Dave Mark President & Lead Designer of Intrinsic Algorithm LLC President & Lead Designer of Intrinsic Algorithm LLC – Independent Game Studio – AI Consulting Company Author of Behavioral Mathematics for Game AI Author of Behavioral Mathematics for Game AI Contributed to: Contributed to: – AI Game Programming Wisdom 4 – Game Programming Gems 8

3
“Reducing the world to mathematical equations!” Eye of the Beholder 0.4%

4
“Reducing the world to mathematical equations!” Eye of the Beholder 0.4%

5
“Reducing the world to mathematical equations!” Eye of the Beholder

6
“Reducing the world to mathematical equations!” Eye of the Beholder People are conditioned to see patterns People are conditioned to see patterns – Inflate their importance – Easier to recall Chunking Chunking – Packaging info into memorable chunks “The magical number 7, plus or minus 2” “The magical number 7, plus or minus 2” – George A. Miller, Princeton, 1956

7
“Reducing the world to mathematical equations!” Eye of the Beholder People can identify shorter patterns or groupings. People can identify shorter patterns or groupings. Forget to consider the entire context Forget to consider the entire context

8
“Reducing the world to mathematical equations!” Opportunity != Outcome The long-term odds (or % chance) of an event happening can be a poor predictor of short term results. The long-term odds (or % chance) of an event happening can be a poor predictor of short term results. People suck at remembering that. People suck at remembering that. People suck at calculating that. People suck at calculating that. It can be used for good or eeevviiilllll! It can be used for good or eeevviiilllll!

9
“Reducing the world to mathematical equations!” Opportunity != Outcome Sid Meier

10
“Reducing the world to mathematical equations!” Opportunity != Outcome Team A has a 55% chance of winning each game Team B will win series 40% of the time Team A has 66.6% chance of winning each game Team B will still win series 20% of the time 7-game series (e.g. baseball, basketball)

11
“Reducing the world to mathematical equations!” That’s a lot of games… Statistically significant – i.e. weaker team wins < 5% of the time Statistically significant – i.e. weaker team wins < 5% of the time – Stronger team has 66.7% advantage Best 12 out of 23 Best 12 out of 23 – Stronger team has 55% advantage Best of 135 out of 269! Best of 135 out of 269!

12
“Reducing the world to mathematical equations!” Law of Large Numbers As the number of trials increases, the outcome approaches the theoretically expected value.

13
“Reducing the world to mathematical equations!” When Is it “Large Enough”? Statistical SignificanceMinimum Trials ± 5%370 ± 2%1000 To achieve a 90% chance of getting within ± n%. (Think polls)

14
“Reducing the world to mathematical equations!” Law of… small numbers? Kahneman & Tversky Kahneman & Tversky – Judgment and decision-making – Behavioral economy Sarcastic reference to misconception that a small sample accurately reflects underlying probabilities. Sarcastic reference to misconception that a small sample accurately reflects underlying probabilities.

15
“Reducing the world to mathematical equations!” Gambler’s Fallacy Idea that the odds of an independent event with fixed probability changing based on recent occurrences. Idea that the odds of an independent event with fixed probability changing based on recent occurrences. – “Catching up.” – “His luck will run out sooner or later.” – “He’s due!”

16
“Reducing the world to mathematical equations!” We all do it… 22 14 20 35 30 4 11 24 6 19 22 13 8 17 31 10 4 00 24 31 29 25 17 35

17
“Reducing the world to mathematical equations!” What do People Perceive?

18
“Reducing the world to mathematical equations!” Determinism that Looks Random 3 Sine waves 3 Sine waves – Different frequencies – Different magnitudes For each value of x For each value of x – Sum y values – Normalize Period50133271 Mag.1.01.12.0

19
“Reducing the world to mathematical equations!” Complexity Obscures Patterns People can only keep track of a limited number of factors People can only keep track of a limited number of factors As factors increase, complexity increases As factors increase, complexity increases People can no longer keep track of relationships People can no longer keep track of relationships Deterministic result looks “random” Deterministic result looks “random”

20
“Reducing the world to mathematical equations!” Complexity Obscures Patterns

21
“Reducing the world to mathematical equations!” Complexity Obscures Patterns

22
“Reducing the world to mathematical equations!” Hidden Factors Look Random People can only take into account what they perceive People can only take into account what they perceive If input factors are hidden, people ascribe it to randomness If input factors are hidden, people ascribe it to randomness

23
“Reducing the world to mathematical equations!” Brownian Motion Robert Brown – 1827 Robert Brown – 1827 Under a microscope – pollen grains moved in “jittery” manner Under a microscope – pollen grains moved in “jittery” manner Ascribed it to pollen being alive Ascribed it to pollen being alive Heat-based molecular vibration bumping the grains Heat-based molecular vibration bumping the grains

24
“Reducing the world to mathematical equations!” Brownian Motion ? ? ? ? ? ?

25
“Reducing the world to mathematical equations!” Brownian Motion ? ? ? ? ? ?

26
“Reducing the world to mathematical equations!” Further Reading

27
“Reducing the world to mathematical equations!” So what can we do with this? Random sequences that look rigged… Random sequences that look rigged… Unseen deterministic factors that look random… Unseen deterministic factors that look random… Intentional randomness to fake complex determinism… Intentional randomness to fake complex determinism…

28
“Reducing the world to mathematical equations!” Two Ways to Use It Fuzzying Things Up Fuzzying Things Up Weighted Randoms Weighted Randoms

29
“Reducing the world to mathematical equations!” Fuzzying Things Up

30
“Reducing the world to mathematical equations!” Fuzzying Things Up Start with a defined anchor point Start with a defined anchor point Add “parametric noise” (i.e. ± n) Add “parametric noise” (i.e. ± n)

31
“Reducing the world to mathematical equations!” Fun with Distributions 1 die = flat ± 1 die = flat ± 2 die = triangular distribution 2 die = triangular distribution 3+ die = bell curve 3+ die = bell curve – More die → squished curve Fun tricks Fun tricks – Skewing dist. (e.g. 4 die, drop the lowest) – Combining different types of dice

32
“Reducing the world to mathematical equations!” Single Die Adds variation Adds variation Quick to process Quick to process – Single random call Easy to visualize Easy to visualize Easy to tweak Easy to tweak Anchor range

33
“Reducing the world to mathematical equations!” 2 Dice Triangular distribution Triangular distribution Mostly clustered towards center Mostly clustered towards center Fairly quick to process Fairly quick to process – Two random calls Easy to visualize Easy to visualize Easy to tweak Easy to tweak Anchor range

34
“Reducing the world to mathematical equations!” 1 die vs. 2 dice

35
“Reducing the world to mathematical equations!” 3+ Dice Normal distribution Normal distribution – Gaussian distribution – Bell curve Very clustered towards center Very clustered towards center Very expressive Very expressive Slower to process Slower to process – n random calls Harder to tweak Harder to tweak

36
“Reducing the world to mathematical equations!” 3+ Dice

37
“Reducing the world to mathematical equations!” Increase the Number of Dice

38
“Reducing the world to mathematical equations!” 3 dice vs. 5 dice

39
“Reducing the world to mathematical equations!” 3 dice vs. 5 dice

40
“Reducing the world to mathematical equations!” Where to Use Randomness Perception Perception Decision Decision Action Action

41
“Reducing the world to mathematical equations!” Where to Use Randomness Perception Perception Decision Decision Action Action

42
“Reducing the world to mathematical equations!” Randomizing Perception Range Range – I can see 30’ ± 5’ = [25-35’] Accuracy Accuracy – I have an 80% chance of seeing you ± 10% Frequency Frequency – Check senses every n ticks where n is 500-2000 ms

43
“Reducing the world to mathematical equations!” Where to Use Randomness Perception Perception Decision Decision Action Action

44
“Reducing the world to mathematical equations!” Where to Use Randomness Perception Perception Decision Decision Action Action

45
“Reducing the world to mathematical equations!” Randomizing Actions Delay before acting Delay before acting Speed of acting Speed of acting Acceleration into act Acceleration into act

46
“Reducing the world to mathematical equations!” Clap when you see the light…

47
“Reducing the world to mathematical equations!” Human Response Times Average is ≈250ms Average is ≈250ms Not everyone clapped at 250ms Not everyone clapped at 250ms Distributed over a range Distributed over a range Everyone clapping at 250ms would be odd Everyone clapping at 250ms would be odd

48
“Reducing the world to mathematical equations!” Human Response Times

49
“Reducing the world to mathematical equations!” Deliberative Decisions Take Time

50
“Reducing the world to mathematical equations!” Deliberative Decisions Take Time Action Deliberation

51
“Reducing the world to mathematical equations!” Action Parameters Reaction Time Reaction Time – Initial (startle) – With decision Movement Movement – Max speed – Acceleration – Turn rate Combat Combat – Acquisition time – Fire rate – Accuracy – Reload speed [Whatever] [Whatever]

52
“Reducing the world to mathematical equations!” What is different? Each person is different Each person is different – People have different reflexes and reaction times – Why I can’t play twitch games very well Each action is different Each action is different – Every time you clap after the light, it will be different

53
“Reducing the world to mathematical equations!” Instantiation vs. Action Individual People Parameter’s base value for all people Parameter’s base value for all people Fuzzy it up a bit Fuzzy it up a bit New base value for this one person New base value for this one person Isolated Events Take base value for this person Take base value for this person Fuzzy it up a bit Fuzzy it up a bit New value for this event New value for this event

54
“Reducing the world to mathematical equations!” Instantiation vs. Action 250 ±50 200 300 200 300 230 ±25 205 255 205 255 237 220 248 General Param. This Agent This Action

55
“Reducing the world to mathematical equations!” Instantiation vs. Action 250 ±50 200 300 200 300 262 ±25 237 287 237 287 269 252 280 General Param. This Agent This Action

56
“Reducing the world to mathematical equations!” Where to Use Randomness Perception Perception Decision Decision Action Action

57
“Reducing the world to mathematical equations!” What is your reaction? Want to pet Want to pet Want to meet Want to meet Just curious Just curious Annoyed Annoyed Want to kick Want to kick Want to run screaming Want to run screaming

58
“Reducing the world to mathematical equations!” Want to pet Want to meet Just curious Annoyed Want to kick Want to run screaming Now what is your reaction?

59
“Reducing the world to mathematical equations!” Varieties of Reactions

60
“Reducing the world to mathematical equations!” Same Model for All Agents Extreme Reactions

61
“Reducing the world to mathematical equations!” Varieties of Reactions Differences exist Differences exist Don’t need to know why Don’t need to know why Simulate that differences do exist Simulate that differences do exist – Not completely random selection – Must be reasonable – Can be simulated with weighted randoms

62
“Reducing the world to mathematical equations!” Brownian Motion ? ? ? ? ? ?

63
“Reducing the world to mathematical equations!” Multiple Agents – Multiple Reactions Straight Deterministic Method Same inputs Same inputs Same decision algorithms Same decision algorithms Arrive at a decision Arrive at a decision Same results Same results Random Noise Method Same inputs Same inputs Same decision algorithms Same decision algorithms Randomized selection Randomized selection Varied results Varied results

64
“Reducing the world to mathematical equations!” Weighted Randoms

65
“Reducing the world to mathematical equations!” Weighted Randoms Score all the possible actions Score all the possible actions – Pre-set % – Contextual % – Dynamic % Calculate a weight Calculate a weight – Normalized or not Line them up end-to-end Line them up end-to-end – Covert weights into edges – Creates “buckets” sized based on weights Throw a random at it Throw a random at it – Which bucket does it land in?

66
“Reducing the world to mathematical equations!” Throw a Dart at It

67
“Reducing the world to mathematical equations!” Let the bouncing ball choose!

68
“Reducing the world to mathematical equations!” The Payoff of Weighted Randoms People aren’t all the same People aren’t all the same There are reasonable options There are reasonable options Simulate how reasonable people may differ Simulate how reasonable people may differ Utilize the scoring of actions that we already do Utilize the scoring of actions that we already do Just do more than simply choose the “best” Just do more than simply choose the “best”

69
“Reducing the world to mathematical equations!” We Aren’t Solving an Equation Computers are good at finding “the best” Computers are good at finding “the best” People suck at it People suck at it Pollen grains aren’t alive Pollen grains aren’t alive – They shouldn’t move – But they do (randomly?) People are alive People are alive – They should be different – List the likely decisions and pick (randomly)

70
Randomness in AI Brian Schwab

71
Humans + Random = DERP Statistics: we cool Probability: say wuh?

72
The Lottery California alone: over a billion a year. It’s like a 2.5% income tax subsidy.

73
Streaks Sports. Gambling. Stock Prediction.

74
Danger Rare events are grossly overestimated. Common events are largely ignored.

75
Skill + Chance = Outcome What is important to your target audience?

76
Who are you working for? Skill/fiero Oriented Twitch skills Planning Optimization Fighting, RTS, FPS Steep learning curve Higher skill wins Randomness BAD

77
Who are you working for? Distraction/play oriented Exploration Easy access to positive reinforcement Intuitive play Puzzle, Social MMOs Anybody can win Randomness OK, not necessarily GOOD

78
…Or somewhere in between? Skill Chance Chess, Fighters FPS Zelda Tetris Poker RPGDoomCSRoulette Yahtzee RTS Diablo MtG

79
Interaction + Outcome = Feel How does playing the game feel?

80
Problem: Game feels overly random, or “streaky”

81
Adjusting Randomness Feel Altered Randomness Filters can mellow Law of Small Numbers effects Rule based, Gaussian

82
Problem: Randomness is ruining game pacing

83
Adjusting Randomness Feel Dynamic Response Allows game to hover around a particular emotional feel

84
Problem: Game needs randomness, but players are feeling cheated

85
Adjusting Randomness Feel Fudged Numbers Real probabilities fall more in line with expectation

86
Problem: Random chance occasionally ruining the game

87
Adjusting Randomness Feel Randomness Elimination Some things can’t be left to chance

88
Adjusting Randomness Feel Altered Randomness Filters can mellow Law of Small Numbers effects Rule based, Gaussian Fudged Numbers Real probabilities fall more in line with expectation Dynamic Response Allows game to hover around a particular emotional feel Randomness Elimination Some things can’t be left to chance

89
Random Developments Things to consider

90
Development Concerns Networked Games Deterministic requirements

91
Development Concerns Networked Games Deterministic requirements Debugging Bug reporting and reproducing

92
Development Concerns Networked Games Deterministic requirements Difficulty Ratings Dynamic settings Last minute changes Debugging Replays Bug reporting and reproducing

93
Development Concerns Networked Games Deterministic requirements Difficulty Ratings Dynamic settings Last minute changes Debugging Replays Bug reporting and reproducing System Visibility Tournament Play Editors

94
Remember Humans suck at probability Adjust level of usage for specific audience Watch out for unintuitive biases Thank You! brian_schwab@yahoo.com

Similar presentations

OK

Binomial Distributions Chapter 5.3 – Probability Distributions and Predictions Mathematics of Data Management (Nelson) MDM 4U Authors: Gary Greer (with.

Binomial Distributions Chapter 5.3 – Probability Distributions and Predictions Mathematics of Data Management (Nelson) MDM 4U Authors: Gary Greer (with.

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Ppt on importance of drinking water Ppt on recycling of waste fabric Ppt on surface water definition Ppt on computer graphics notes Ppt on dynamic resource allocation in cloud computing Ppt on artificial intelligence techniques Ppt on 2nd world war year Ppt on special types of chromosomes defects Ppt on biodegradable and non biodegradable example Ppt on transportation in human beings higher