Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Not Alone Board Game Simulations

Fd56417e322b4c8b67d5c058d4004eae?s=47 Yi Sheng
February 28, 2018

Not Alone Board Game Simulations

On the programming of board game simulations, the journey and challenges.

Fd56417e322b4c8b67d5c058d4004eae?s=128

Yi Sheng

February 28, 2018
Tweet

Transcript

  1. Board Game Simulations - Not Alone - Yi Sheng Siow

  2. Me 1. Interests include board games and game design 2.

    Python projects/interests include 1. Dataviz - bokeh 2. Webdev - django 3. GUI app dev – PyQt / Tkinter 4. Webscraping – Scrapy 5. Image recognition – pytesseract 6. Machine Learning – scikit-learn 3. ~2 years working with python
  3. Content 1. Motivation for project 2. Not Alone primer 3.

    Separation of game rules and decision making 4. Logging handlers 5. Identifying and fixing bugs 6. Counting game stats 7. Impact of various strategies on win % 8. Code Walkthrough 9. Questions
  4. Motivation for project 1. Win rate balance? 2. Gain experience

    with python. 3. I am a sore loser.
  5. Not Alone - The Game 1. 2 – 7 players,

    1 Creature, the others are Hunted 2. Each team tries to reach a set point on the scoreboard 3. Basic game flow 1. Hunted plays Place cards face down 2. Creature targets one or two of the Place cards 3. Hunted reveal Place cards 4. Getting by the Creature advances the Creature’s score 5. Those not caught get to activate the Place’s effect 6. Repeat until one side wins
  6. Separation of game rules and decision making 1. The game(object)

    has players(objects) and a scripted flow which gives each player windows for performing their actions 2. Player objects have mind objects, which make decisions on each action 3. The mind makes decisions by accessing game variables via the player.game 4. Analysis of different strategies
  7. Logging handlers 1. logging module 2. One stream handler for

    showing me errors, warnings 3. One file handler for saving full game logs, which help in debugging
  8. Identifying and fixing bugs 1. Need game IDs to find

    games in thousands of game logs 2. subprocess.check_output() to check last row of csv, in order to give IDs to new games 3. Include game ID in the error log
  9. Counting game stats 1. collections.Counter and a csv.DictWriter to write

    the results to csv
  10. Impact of various strategies on win % 1. Different mind

    objects on different players 2. BetterMind inherits from RandomMind and overrides methods for certain decisions to make better(?) choices
  11. WIP / Directions 1. Simulation of player sentiments 1. Players

    would have variables representing game satisfaction, excitement, tension, boredom 2. Data visualisation of results
  12. Code Walkthrough

  13. Questions