Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Using Artificial Intelligence to Test the Candy Crush Saga Game

1,125 views

Published on

Candy Crush Saga is one of the biggest mobile games today with more than 1000 levels of difficulty—and users continue to ask for more. When building new content, it is extremely important to ensure that the level of difficulty is balanced and that the user does not experience crashes or problems through some unforeseen level of play. Stefan Freyr shows you how King is training artificial intelligence (AI) programs (bots) to test its games by mimicking human interactions. Join Stefan as he discusses how King is taking testing to the next level by employing Monte Carlo Tree Search, automatic heuristic construction, and NeuroEvolution of Augmenting Topologies (NEAT) to train bots to test and evaluate difficulty levels. He discusses ways to extend and use AI bots to predict game success rates and conduct automatic performance testing. Stefan explains how this AI approach can be generalized to test other applications. Learn how AI can help you with testing that's getting very difficult to master with traditional testing techniques.

Published in: Software
  • Be the first to comment

Using Artificial Intelligence to Test the Candy Crush Saga Game

  1. 1. T18 Session - Mobile Testing 4/27/17 3:15 PM Using Artificial Intelligence to Test the Candy Crush Saga Game Presented by: Alexander Andelkovic King/Midasplayer AB Brought to you by: 350 Corporate Way, Suite 400, Orange Park, FL 32073 888---268---8770 ·· 904---278---0524 - info@techwell.com - https://www.techwell.com/
  2. 2. Alexander Andelkovic King/Midasplayer AB Alexander Andelkovic is the agile testing lead for Sweden-based King/Midasplayer AB, developer of the popular mobile game Candy Crush Saga, Alexander Andelkovic has worked on multiple complex test projects ranging from using session-based test management for quality assuring MED-Tech devices for life critical systems to establishing a world class approval process for Spotify apps used by Fortune 500 companies. Now he teams with developers in testing big data, business analytics, and game level regression testing using AI. Alex performs both system testing and exploratory testing with a focus on assisting teams with high-quality deliveries. He is a frequent speaker at international conferences including both STAREAST and STARWEST.
  3. 3. 1/20/17 1 Using Artificial Intelligence to Test the Candy Crush Saga Game © King.com Ltd 2017 About us King/Midasplayer AB •  Founded 2003 •  +200 Games •  2000 employees •  13 Studios(Stockholm, London, Barcelona, Seattle…) •  394 million MAU(Q3 2016) •  Acquired by Activision/Blizzard(2016-02-23) Page 2
  4. 4. 1/20/17 2 © King.com Ltd 2017 Products Franchise Games Page 3 © King.com Ltd 2017 QA at King King QA roles •  ATL – Agile Testing Lead •  Ninja – Exploratory tester •  QRT – Quick Regression Team •  TAE – Test Automation Engineer •  DS – Data Scientist •  Dev – Frontend/Backend Developer Page 4
  5. 5. 1/20/17 3 © King.com Ltd 2017 QA Problem More than 2000 levels in Candy Page 9 © King.com Ltd 2017 Introduction History of AI Page 6
  6. 6. 1/20/17 4 © King.com Ltd 2017 Introduction So, what is a bot exactly? Page 7 © King.com Ltd 2017 Introduction Application that performs an automated task Page 8
  7. 7. 1/20/17 5 © King.com Ltd 2017 Introduction AI-bot – why? Page 9 •  Level designers •  Quality Assistance (QA) •  Game-domain research © King.com Ltd 2017 AI-bot How would an AI-bot actually think(heuristic, simulation)? Page 9
  8. 8. 1/20/17 6 © King.com Ltd 2017 Heuristic Heuristic is good, maintenance is bad! Page 11 •  Having a function that ranks moves – heuristic – could help a lot •  Each simulation much richer •  Has to be generic •  Increasing complexity with more features •  Can we create the heuristic automatically? © King.com Ltd 2017 MCTS Simulation – Monte Carlo Tree Search Page 12
  9. 9. 1/20/17 7 © King.com Ltd 2017 MCTS Page 13 Simulate example © King.com Ltd 2017 MCTS Page 14 Win Loss Win Is this reliable?
  10. 10. 1/20/17 8 © King.com Ltd 2017 MCTS Page 15 36% 28% 19% Repeat simulations – Monte-Carlo simulations © King.com Ltd 2017 MCTS Page 16 36% 28% 19% Gradually we build a tree => Monte-Carlo Tree Search 40% 32%
  11. 11. 1/20/17 9 © King.com Ltd 2017 MCTS Search tree for level 13 in Candy Page 17 © King.com Ltd 2017 MCTS Available actions Page 18
  12. 12. 1/20/17 10 © King.com Ltd 2017 MCTS Future states Page 19 © King.com Ltd 2017 MCTS Page 20 After 299 simulations
  13. 13. 1/20/17 11 © King.com Ltd 2017 MCTS demo Page 21 MCTS demo © King.com Ltd 2017 MCTS - Impact What do we have? Page 22 •  Generic method •  Works for all levels •  Works for other games
  14. 14. 1/20/17 12 © King.com Ltd 2017 MCTS - summary MCTS summary Page 23 •  Closer to human success rate •  Easy to tune with more simulation per decision •  Time consuming, one level takes ~ 5-10 mins •  How can we improve? © King.com Ltd 2017 NEAT NEAT – NeuroEvolution of Augmented Topologies! Page 24 •  Artificial Neural Network(ANN) •  Reinforced learning(action, learn, evolve) •  Guided playout
  15. 15. 1/20/17 13 © King.com Ltd 2017 NEAT Play Candy Crush! Page 25 4 1 0 0 © King.com Ltd 2017 NEAT NEAT – Steps Page 26 •  Get training data - Predict score (hours) •  Create random bots •  Compete (hours) •  Create new bots •  Choose the best bot - ANN •  Play Candy choosing moves in playout with ANN
  16. 16. 1/20/17 14 © King.com Ltd 2017 NEAT The jungle law in Candy Page 27 Focus on blockers! Look at jellies! Special candies are tasty! © King.com Ltd 2017 NEAT Making babies Page 28 Mom Dad
  17. 17. 1/20/17 15 © King.com Ltd 2017 NEAT Page 29 Newborn Mom Dad © King.com Ltd 2017 NEAT Product of evolution Page 30
  18. 18. 1/20/17 16 © King.com Ltd 2017 NEAT demo Page 31 NEAT training •  Red=Fittest Bot •  Yellow=Avg Bot fitness •  Green=# Bot’s •  Blue=Fittest Bot ANN nodes © King.com Ltd 2017 NEAT demo Page 32 NEAT training demo
  19. 19. 1/20/17 17 © King.com Ltd 2017 Results Guiding the playout helps Page 33 © King.com Ltd 2017 NEAT NEAT – Performance Page 34 •  Simulation time, game engine needs to replay each game state •  Traversing time, game engine does not support jump to state •  More GPU’s for bot training(5-6 hours > on commit)
  20. 20. 1/20/17 18 © King.com Ltd 2017 Content QA Content QA – No bot Page 35 © King.com Ltd 2017 Content QA Content QA – With bot Page 36
  21. 21. 1/20/17 19 © King.com Ltd 2017 Benefits Bot benefits Page 37 •  Level development: level difficulty, less tweaks •  Quality assistance: crash testing, performance testing, regression testing •  Data scientists: Game domain knowledge, fun levels, game balancing © King.com Ltd 2017 Challenges Bot challenges Page 38 •  Ownership(Knowledge, Resources, Bot team) •  Integration(Headless mode, C++/Lua/JS, Hackday/Sprint, BotApi) •  Maintenance(Bot Training, Infrastructure, Extend)
  22. 22. 1/20/17 20 © King.com Ltd 2017 Q&A alexander.andelkovic@king.com Page 39 Questions? © King.com Ltd 2017 Thank you! Page 40
  23. 23. 1/20/17 21

×