Successfully reported this slideshow.
Upcoming SlideShare
×

# Analysis for design

1,369 views

Published on

Different examples on how to analyse (board) game systems using probability theory and simulations.

Published in: Data & Analytics
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

### Analysis for design

1. 1. Analysis for Design Evaluating game system behavior Petri Lankoski Södertörn University
2. 2. How Is Your Probability Math? Dice  Probability of 1d6 to get 6?  1/6  Probability of 1d6 to get 6 after previous was 6?  1/6  Probability of 2d6 to get double 6?  1/36  Probability of 2d6 sum is 7?  6/36 (6 cases where the sum is 7 out of 36 possibilities) Cards  Probability to draw an ace?  4/52  Probability to draw second ace after an ace?  3/51  Probability to draw an ace if the first was not an ace?  4/51  Draw a card and put it face down. What is the probability the the second card is an ace?  4/52*3/51 (both aces) + 48/52*4/51 (first not ace, second is ace) Petri Lankoski Södertörn University
3. 3. Sum of Dice, 2d6 1 2 3 4 5 6 1 2 3 4 5 6 7 2 3 4 5 6 7 8 3 4 5 6 7 8 9 4 5 6 7 8 9 10 5 6 7 8 9 10 11 6 7 8 9 10 11 12 Petri Lankoski Södertörn University Sum Prob 2 1/36 3 2/36 4 3/36 5 4/36 6 5/36 7 6/36 8 5/36 9 4/36 10 3/36 11 2/36 12 1/36 3 fours
4. 4. Dice vs Cards  History does not influence probabilities of dice  Drawing a card influence probabilities of next drawn card  Shuffling resets  Very handy to get certain kind of results  Catan: all boards have 4 hex producing wood and 3 producing stone and so on  Both can be simulated using pseudo-random numbers Petri Lankoski Södertörn University
5. 5. More about randomness  Salen & Zimmerman, 2004. Rules of play.  Game as systems of uncertainty, pp.173–188.  Elias, Garfield & Gutschera, 2012. Characteristics of games.  Indeterminacy, pp. 137–166 Petri Lankoski Södertörn University
6. 6. A Skill System skilld10 vs difficulty example Petri Lankoski Södertörn University
7. 7. Skill check using Xd10  Throw skilld10  Success if at least one die over difficulty  If throw is 1 reduce one success  If negative amount of success skill check is fumble  Is this good? Petri Lankoski Södertörn University
8. 8. 10000 20000 30000 40000 50000 2 4 6 8 diff success skill 1 2 3 4 5 6 7 8 9 10 0 10000 20000 30000 2 4 6 8 diff fail skill 1 2 3 4 5 6 7 8 9 10 0 2500 5000 7500 10000 2 4 6 8 diff fumble skill 1 2 3 4 5 6 7 8 9 10 Petri Lankoski Södertörn University
9. 9. What we learned  System works OK in most cases  Skill level 1 and 2 differently to other levels  High difficulties are significantly less likely to fumble with skill level 1 than with high skills; skill level 2 less anomaly, but still very different  Skill levels 1 and 2 are less likely to success in most cases  But behaves differently than other skill levels  One possible fix:  No skill rolls use 1 or 2 dice Petri Lankoski Södertörn University
10. 10. Trouble A simple example Petri Lankoski Södertörn University Image: Wikipedia
11. 11. Trouble  How long (rounds & minutes ) in average game takes?  Ignore returning home by landing on them, on board with with 6 and home with only correct roll Petri Lankoski Södertörn University
12. 12. Answer: Trouble  Expected value: long run average  D6: expected value = 3.5 (1+6/2), but…  However, the Trouble die expected value is 4  Simulated the die 50000 times and calculated average  Track length: 32, 31, 30, 29  Game time estimate (underestimates)  Average rounds to complete  32 / 4 + 31 / 4 + 30 / 4 + 29 / 4 = 30.5 rounds  Turn: 15 sec -> round: 1 min -> game: 30.5 * 1 min ~30 min  But return home rule makes game more unpredictable Petri Lankoski Södertörn University
13. 13. Balance  Is game balanced?  How game is balanced? Petri Lankoski Södertörn University
14. 14. Answer: Balance  Game is symmetrical ⇒balanced  Except:  1st (and so on) player has a small advantage over next ones  However, amount of rounds and return to home mechanism is likely to reduce the advantage Petri Lankoski Södertörn University
15. 15. Assignment Island Tour Petri Lankoski Södertörn University
16. 16. Game Rules  D6 to move  Winner is the one who visit all listed squares first (see the column on the right hand side)  Must stop to a site  All players start at START  In one lands to red place, one looses ones next turn  Board in next slide Goals  Player 1 visits  1, 6, 9, 15, 20, 32  Player 2 visits  4, 10, 13, 18, 27, 30  Player 3 visits  7, 8, 11, 15, 22, 29  Player 4 visits  5, 10, 11, 21, 23, 26 Petri Lankoski Södertörn University Assignment is based on Korkeasaari board game
17. 17. Board Petri Lankoski Södertörn University Letters are marking junctions
18. 18. Island Tour  Estimate how much time game takes  How would you balance the game if it is not balanced?  Do not change core mechanics  Racing with die  Asymmetric Petri Lankoski Södertörn University
19. 19. Answers: Island Tour Length Wait a round squares Obl. wait a round squares Expected time (rounds) Player 1 69 5 1 20.8 Player 2 72 3 0 20.6 Player 3 79 7 0 22.7 Player 4 70 4 0 20.1 Petri Lankoski Södertörn University Estimated time = length / 3.5 + wait a round / length + obl. wait a round Probability to land
20. 20. Answers: Island Tour  Player 3 has longer / harder path  Easy fix: shorten the path  E.g. 7, 8, 15, 22, 28, 31 Petri Lankoski Södertörn University
21. 21. Settlers of Catan
22. 22. Simulation  How the players gain resources  Simplified  Robber vs no robber discard  Only resource amount simulated, not types  Assumptions  Four player game  0-3 resources at hand when ones turn starts  Model for using resources; not able to use all resources  Better robber simulation  One specific board set-up  The results does not vary much board to board  The results can vary with not optimal settlement placements  50 000 iterations used Petri Lankoski Södertörn University
23. 23. Simulation set-up • 2 victory point set-up Petri Lankoski Södertörn University
24. 24. Model #!/usr/bin/python import random from collections import Counter # board model (2 victory points) field1 = { 2: {'white': 0, 'blue':0, 'red': 0, 'orange': 0}, 3: {'white': 0, 'blue':0, 'red': 1, 'orange': 1}, 4: {'white': 1, 'blue':1, 'red': 0, 'orange': 0}, 5: {'white': 0, 'blue':2, 'red': 1, 'orange': 0}, 6: {'white': 1, 'blue':1, 'red': 1, 'orange': 1}, 8: {'white': 1, 'blue':1, 'red': 1, 'orange': 1}, 9: {'white': 1, 'blue':0, 'red': 0, 'orange': 1}, 10: {'white': 1, 'blue':0, 'red': 1, 'orange': 1}, 11: {'white': 0, 'blue':0, 'red': 1, 'orange': 1}, 12: {'white': 0, 'blue':0, 'red': 0, 'orange': 0} }  The above model does not contain handling for robber  The code for simulating this model is bit more complicated Petri Lankoski Södertörn University
25. 25. Startposition comparison Petri Lankoski Södertörn University Dark blue: 50%, light blue: 80% 4 5 5 6 0 0 1 11 2 2 3 3 3 4 5 2.05356 2.60712 3.16662 3.72224 0 2 4 6 0 1 2 3 Turn Resources White 4 5 6 7 0 0 1 11 2 2 3 3 4 4 5 2.08214 2.6593 3.2414 3.81416 0 2 4 6 0 1 2 3 Turn Resources Blue 4 5 5 6 0 0 1 2 1 2 2 3 3 4 4 5 2.08276 2.66588 3.24844 3.83248 0 2 4 6 0 1 2 3 Turn Resources Orange 4 5 5 6 0 0 1 2 1 2 2 3 3 4 4 5 2.07952 2.66072 3.2421 3.82596 0 2 4 6 0 1 2 3 Turn Resources Red
26. 26. What this mean? Petri Lankoski Södertörn University
27. 27. What this mean?  Rather well-balanced starting positions  No advantage/disadvantage for any color  White slightly lower average resource gain  But have a port  Blue slightly have more variation in resource gain (80% area is wider) Petri Lankoski Södertörn University
28. 28. Impactofsetup Petri Lankoski Södertörn University
29. 29. Impactofsetup Petri Lankoski Södertörn University 3 4 5 5 0 0 1 11 1 2 2 3 3 4 4 1.89398 2.28342 2.67204 3.06254 0 2 4 6 0 1 2 3 Turn Resources White, bad 3 4 5 5 0 0 0 0 1 1 1 2 3 3 3 4 1.8087 2.11382 2.42424 2.72642 0 2 4 6 0 1 2 3 Turn Resources White, bad alt 2 4 5 5 6 0 0 1 2 1 2 2 3 3 4 4 5 2.08718 2.67596 3.26016 3.84286 0 2 4 6 0 1 2 3 Turn Resources White, good alt 4 5 5 6 0 0 1 11 2 2 3 3 3 4 5 2.05356 2.60712 3.16662 3.72224 0 2 4 6 0 1 2 3 Turn Resources White
30. 30. What this mean? Petri Lankoski Södertörn University
31. 31. What this mean?  Initial placement of ones settlement is important  Rather big impact on resource gain  Even bigger after upgrading settlements to cities Petri Lankoski Södertörn University
32. 32. Feedback loop & Roll 7 Effect? Petri Lankoski Södertörn University Scenario • Only white simulated • White built cities in all places marked
33. 33. Feedbackloop&roll “7”effect Petri Lankoski Södertörn University 6 11 12 14 1 1 2 3 2 3 4 64 6 8 10 3.28772 5.07054 6.68098 8.11302 0 5 10 15 0 1 2 3 Turn Resources Robber=Default 6 11 13 15 1 1 2 3 2 3 4 64 6 8 11 3.2899 5.0725 6.85024 8.62992 0 5 10 15 0 1 2 3 Turn Resources Robber=No 6 11 12 14 1 1 2 22 3 4 5 4 6 8 10 3.27528 5.04646 6.527 7.68936 0 5 10 15 0 1 2 3 Turn Resources Robber=To zero 6 11 12 14 1 1 2 3 2 3 4 5 4 6 8 10 3.29602 5.0909 6.50472 7.7635 0 5 10 15 0 1 2 3 Turn Resources Robber=Limit 4 & half
34. 34. What this mean?  Feedback loop is weakened by the board design  There is no equally good places to build after initial setup  Robber (rolling 7) makes lucky streaks rarer  Not big effect on positive feedback look on average  What if scenarios  Robber -> discard all  Discard if more than four resources Petri Lankoski Södertörn University
35. 35. Monopoly Petri Lankoski Södertörn University
36. 36. Board & Movement Chance to end Up In a square 1/40 = 2,50%? 3 doubles in a row 1/16 Card takes to Jail A player can increase probability to land to These squares (out with doubles)
37. 37. Chance to Land at a Square Petri Lankoski Södertörn University
38. 38. Break Even Times Petri Lankoski Södertörn University
39. 39. What we learned  Staying in prison strategy alters changes to land other squares  Long prison stay good at the end game  Break even time downward trend is good  Breakeven times are long  Slow start  Note that one cannot build before owning all squares with that color Petri Lankoski Södertörn University
40. 40. Forbidden Island Petri Lankoski Södertörn University
41. 41. Rules in brief  Randomly generated boar,  Treasure deck (28 cards)  4 treasure cards are needed to collect a certain (1/4) treasure from specific tile  Water rise! (3) cards increase speed which the island is going under water  Flood cards  Tells which tile will be flooded or sink  Players has three actions  Support a tile  Move  Give a treasure card  Capture a treasure  Win by collecting all four treasures and escape by helicopter  Loose by  Water level raises too high (with Water Rise! Cards)  Cannot collect the treasures because of sunken tile  Cannot escape because of the exit tile is sunken Petri Lankoski Södertörn University
42. 42. Game length (loose with water level)  3 water raises cards in treasure cards deck (28 cards) Petri Lankoski Södertörn University
43. 43. Game length (loose with water level) Petri Lankoski Södertörn University Loose cond.: N water rise! Deck exhausted N times Ends with Nth water rise! card Novice 9 2 3 Normal 8 2 2 Elite 7 2 1 Legendary 6 1 3 Rough estimate about play time in terms of water rise! cards
44. 44. 2 players, normal Petri Lankoski Södertörn University Water Level Min turn Max turn Mean turn # act. / support Actions - # actions 1 1 10 2.7 2 2 2 1 11 4.8 2 2 3 1 11 7.3 3 1 4 2 19 11.4 3 1 5 13 20 15.5 3 1 6 13 20 17.4 4 0 7 14 28 21.0 4 0 8 22 29 24.5 5 -1 9 22 29 26.4 5 -1
45. 45. Prevent island sinking  Water levels 1 & 2: possible to support squares most of the time  Water levels 3–5: possible to support nearby squares if actions are focused to that  Spending max 1 point to movement  Water levels 6-7: Not possible to support all squares except with luck  No movement possible if supporting four squares  Water level 8: island is sinking no matter what  Note: Digging up a treasure requires an action and moving to the correct square  To keep the island in stable state would require more actions Petri Lankoski Södertörn University
46. 46. Treasure cards Petri Lankoski Södertörn University  4 same treasure card is needed to dig up a treasure  5 same treasure cards in deck  Discarding correct cards is critical (max hand size: 5 cards)  Treasure card scuffle is needed if discarding 2 same resources before the set can be completed
47. 47. Summary Petri Lankoski Södertörn University
48. 48. Balance  Symmetry typically leads to balance  Note: turn order / some typically start in board games  Creates imbalance  Catan solution to balance set-up  turn order in setup: 1-2-3-4-4-3-2-1  Symmetry can be also in form of rock-paper-scissors  Balancing weapons & troops  non-symmetrical things are harder to balance  Difficulty in co-op games:  resources needed to keep status quo or  to progress vs resources available Petri Lankoski Södertörn University
49. 49. Simulations  Game systems with random component are complex to predict  Card-based are even history-dependent  How many / what cards are played influence probabilities  Simulations can help to understand how a part of the system behaves  One does not need ready game for simulation  But one needs to understand what to simulate  Does not replace playtesting  But simulation can show the features work in the long run Petri Lankoski Södertörn University
50. 50. Assignment Petri Lankoski Södertörn University
51. 51. Assignment  Use relevant presented approaches to analyze your game design and  Balance it / set difficulty  Fine-tune play time  Combine with play-testing  Return  Documentation of your process (steps, calculations)  Around 1-2 pages Petri Lankoski Södertörn University
52. 52. That’s all folks Petri Lankoski Södertörn University