Machine Learning in Computer Games Marc Ponsen 11/29/04.

Slides:



Advertisements
Similar presentations
Exploring Machine Learning in Computer Games Presented by: Matthew Hayden Thurs, 25 th March 2010.
Advertisements

Reinforcement Learning
Tetris – Genetic Algorithm Presented by, Jeethan & Jun.
Constructing Complex NPC Behavior via Multi- Objective Neuroevolution Jacob Schrum – Risto Miikkulainen –
Machine Learning in Computer Games Learning in Computer Games By: Marc Ponsen.
On the Genetic Evolution of a Perfect Tic-Tac-Toe Strategy
DARPA Mobile Autonomous Robot SoftwareMay Adaptive Intelligent Mobile Robotics William D. Smart, Presenter Leslie Pack Kaelbling, PI Artificial.
Bio-Inspired Optimization. Our Journey – For the remainder of the course A brief review of classical optimization methods The basics of several stochastic.
Artificial Intelligence in Game Design Introduction to Learning.
Biologically Inspired AI (mostly GAs). Some Examples of Biologically Inspired Computation Neural networks Evolutionary computation (e.g., genetic algorithms)
Institute of Intelligent Power Electronics – IPE Page1 Introduction to Basics of Genetic Algorithms Docent Xiao-Zhi Gao Department of Electrical Engineering.
Neuro-Evolution of Augmenting Topologies Ben Trewhella.
Genetic Algorithms. Some Examples of Biologically Inspired AI Neural networks Evolutionary computation (e.g., genetic algorithms) Immune-system-inspired.
Non-Linear Problems General approach. Non-linear Optimization Many objective functions, tend to be non-linear. Design problems for which the objective.
Using a GA to Create Prey Tactics Presented by Tony Morelli on 11/29/04.
An EA for Box Pushing with a LEGO Mindstorms Robot By Sara L. Skroh December 5, 2003.
Evolutionary Algorithms Simon M. Lucas. The basic idea Initialise a random population of individuals repeat { evaluate select vary (e.g. mutate or crossover)
1 Hybrid Agent-Based Modeling: Architectures,Analyses and Applications (Stage One) Li, Hailin.
Genetic Algorithms Learning Machines for knowledge discovery.
Intro to AI Genetic Algorithm Ruth Bergman Fall 2002.
Evolutionary Computation Application Peter Andras peter.andras/lectures.
Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions.
Intro to AI Genetic Algorithm Ruth Bergman Fall 2004.
CS Reinforcement Learning1 Reinforcement Learning Variation on Supervised Learning Exact target outputs are not given Some variation of reward is.
Image Registration of Very Large Images via Genetic Programming Sarit Chicotay Omid E. David Nathan S. Netanyahu CVPR ‘14 Workshop on Registration of Very.
Genetic Algorithms: A Tutorial
Evolving Multi-modal Behavior in NPCs Jacob Schrum – Risto Miikkulainen –
Genetic Algorithm.
An Approach of Artificial Intelligence Application for Laboratory Tests Evaluation Ş.l.univ.dr.ing. Corina SĂVULESCU University of Piteşti.
Other Potential Machine Learning Uses
More precisely called Branch of AI behind it.
Evolutionary Computing Systems Lab (ECSL), University of Nevada, Reno 1 Authors : Christopher Ballinger, Sushil Louis
Introduction to Genetic Algorithms and Evolutionary Computation
A Comparison of Nature Inspired Intelligent Optimization Methods in Aerial Spray Deposition Management Lei Wu Master’s Thesis Artificial Intelligence Center.
Four Types of Decisions (p p.130) Structured vs. Nonstructured(Examples?) –Structured: Follow rules and criteria. The right answer exists. No “feel”
Knowledge acquisition for adative game AI Marc Ponsen et al. Science of Computer programming vol. 67, pp , 2007 장수형.
Othello Artificial Intelligence With Machine Learning
Study on Genetic Network Programming (GNP) with Learning and Evolution Hirasawa laboratory, Artificial Intelligence section Information architecture field.
Lecture 8: 24/5/1435 Genetic Algorithms Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
Presenter: Chih-Yuan Chou GA-BASED ALGORITHMS FOR FINDING EQUILIBRIUM 1.
StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel.
Simulation of Plant Growth using Genetic Algorithms Peter Barber Westminster College.
Machine Learning in Computer Games Automated GenerationTactics for Strategy Games Original: Marc Ponsen Update: H. Munoz-Avila.
Genetic Algorithms K.Ganesh Reasearch Scholar, Ph.D., Industrial Management Division, Humanities and Social Sciences Department, Indian Institute of Technology.
1 “Genetic Algorithms are good at taking large, potentially huge search spaces and navigating them, looking for optimal combinations of things, solutions.
Bi-directional incremental evolution Dr Tatiana Kalganova Electronic and Computer Engineering Dept. Bio-Inspired Intelligent Systems Group Brunel University.
Genetic Algorithms. Evolutionary Methods Methods inspired by the process of biological evolution. Main ideas: Population of solutions Assign a score or.
ELeaRNT: Evolutionary Learning of Rich Neural Network Topologies Authors: Slobodan Miletic 3078/2010 Nikola Jovanovic 3077/2010
1 Introduction to Reinforcement Learning Freek Stulp.
Intelligent Database Systems Lab 國立雲林科技大學 National Yunlin University of Science and Technology 1 Evolving Reactive NPCs for the Real-Time Simulation Game.
Biologically inspired algorithms BY: Andy Garrett YE Ziyu.
Course Overview  What is AI?  What are the Major Challenges?  What are the Main Techniques?  Where are we failing, and why?  Step back and look at.
Innovative and Unconventional Approach Toward Analytical Cadastre – based on Genetic Algorithms Anna Shnaidman Mapping and Geo-Information Engineering.
Sporadic model building for efficiency enhancement of the hierarchical BOA Genetic Programming and Evolvable Machines (2008) 9: Martin Pelikan, Kumara.
Othello Artificial Intelligence With Machine Learning Computer Systems TJHSST Nick Sidawy.
A field of study that encompasses computational techniques for performing tasks that require intelligence when performed by humans. Simulation of human.
Artificial Intelligence in Game Design Lecture 20: Hill Climbing and N-Grams.
Robot Intelligence Technology Lab. 10. Complex Hardware Morphologies: Walking Machines Presented by In-Won Park
Genetic Algorithms. Solution Search in Problem Space.
Evolutionary Computing Systems Lab (ECSL), University of Nevada, Reno 1 Authors : Siming Liu, Christopher Ballinger, Sushil Louis
Genetic Algorithms An Evolutionary Approach to Problem Solving.
An Evolutionary Algorithm for Neural Network Learning using Direct Encoding Paul Batchis Department of Computer Science Rutgers University.
Evolving robot brains using vision Lisa Meeden Computer Science Department Swarthmore College.
Genetic Algorithm(GA)
March 1, 2016Introduction to Artificial Intelligence Lecture 11: Machine Evolution 1 Let’s look at… Machine Evolution.
Done Done Course Overview What is AI? What are the Major Challenges?
Reinforcement learning (Chapter 21)
Machine Learning in Computer Games
Traveling Salesman Problem by Genetic Algorithm
Coevolutionary Automated Software Correction
Presentation transcript:

Machine Learning in Computer Games Marc Ponsen 11/29/04

2 Game AI: The Last Frontier “Progress in graphics and sound has slowed in recent years… Now, more than ever, good game play is at the forefront and AI is one of the most critical components (Rabin 2004).” “… Interactive computer games provide a rich environment for incremental research on human- level AI… Populating games with realistic, human- level characters will lead to fun, challenging games with great game play (Laird 2000).”

3 Why Learning of Game AI? The process of learning in games generally implies the adaptation of behavior for opponent players in order to improve performance Self-correction  Automatically fixing exploits Creativity  Responding intelligently to new situations Scalability  Better entertainment for strong players  Better entertainment for weak players

4 Online – during gameplay  Adapt to player tactics  Avoid repetition of mistakes  Requirements: computationally cheap, effective, robust, fast learning (Spronck 2004) Offline - before the game is released  Devise new tactics  Discover exploits Offline vs. Online Learning

5 Machine Learning Techniques

6 Overview Reinforcement Learning (RL)  Introduction to RL  RL application: Dynamic Scripting  Demo NeverWinter Nights © Evolutionary Algorithms (EA)  Introduction to EA  EA application: EA in Stratagus/Wargus  Demo Wargus

7 Introduction to Reinforcement Learning Techniques Framework based on punishments and rewards Maximize the frequency of rewards Minimize the frequency of punishments RL is popular research area because:  RL can solve wide variety of complex problems  RL will find close to optimal solution  RL learns as it interacts with the environment

8 How to provide Punishments & Rewards Weight adaptation function based on fitness score(s) Lookup tables Neural networks

9 When to provide Punishments & Rewards Reward when AI achieves objective or the opponent finds itself in a state where it can’t achieve its objective Reward when AI does something to increase the chance of achieving objective (guided rewards) Punish when opponent has reached objective Punish when AI does something to decrease the chance of achieving objective (guided negative rewards) Using both overall and guided (negative) rewards, speeds up the learning process

10 RL application: Dynamic Scripting Dynamic Scripting (DS) is an online learning technique inspired by RL Original implementation of DS (Spronck 2004) in the Computer RolePlaying Game NeverWinter Nights ©

11 Dynamic Scripting Rulebase A Rulebase B Script A Script B Combat generate script scripted control human control human control weight updates team controlled by human player team controlled by computer A B

12 Dynamic Scripting and Requirements Computationally Cheap - Script generation and weight updates once per encounter Effective - Rules are manually designed Robust - Reward/penalty system Fast Learning – Experiments showed that DS is able to adapt fast to an unchanging tactic

13 NeverWinter Nights © Demo

14 Dynamic Scripting in Wargus Different rulebases for different game states State transition on constructing a building that allows new units or new research

15 Rules in Rulebases 12 Build rules 9 Research rules 4 Economy rules 25 Combat rules AiNeed(AiBarracks) AiResearch(AiUpgradeArmor1) AiNeed(AiWorker) AiForce(1, {AiSoldier, 9}) AiWaitForce(1) AiAttackWithForce(1)

16 Script Generation State 1 Rulebase State n Rulebase Start Rule 1.1 Build Rule 1.x Rule n.1 State 20 Rulebase Rule Attack Loop Rule 20.19

17 Tactics Two `balanced’ tactics  Small Balanced Land Attack (SBLA)  Large Balanced Land Attack (LBLA) Two `rush’ tactics  Soldier Rush (SR)  Knight Rush (KR)

18 Dynamic Scripting Test Dynamic player (using dynamic scripting) plays 100 consecutive games against static player Randomisation Turning Point (RTP): First game that dynamic player outperforms static player with 90% probability according to a randomisation test (Cohen, 1995)

19 Dynamic Scripting RTP Results TacticTestsLowHighAvg.Med.>100Won SBLA LBLA SR KR Dynamic Scripting WORKS! It adapts efficiently against SBLA and LBLA Dynamic Scripting is unable to adapt to the optimized tactics SR and KR

20 Improve Domain-Knowledge Reliability Successful adaptive game AI is based invariably on domain knowledge of the game it is used in Step 1: Use EA to evolve new tactics to deal with problematic static opponents Step 2: Translate evolved tactics to improved domain knowledge (rulebase revision)

21 Introduction to Evolutionary Algorithms Idea: Biological analogy on how populations of species evolve over generations Step 1: start with a population (each member is a candidate solution) … Step 2: Create the next generation by considering evolutionary operations on the population from the previous generation (genetic operators such as mutation or crossover) and a fitness function (only the more fit get to contribute to the next generation) … Continue the process until a certain condition is reached

22 Chromosome AiForce(2, {AiSoldier, 5}) AiForceRole(“defend”)

23 Genetic Operators State Crossover Rule Replace Mutation Rule Biased Mutation Randomization

24 Wargus Demo

25 Evolution Results TacticTestsLowHighAvg. SR KR EA was successful in rapidly discovering tactics able to defeat both rush tactics

26 Analysis of Counter-Tactics Counter `soldier rush’ with (enhanced) `soldier rush’ Against `knight’s rush’  Expand territory when defendable  Quickly develop strong units  Use catapults

27 Rulebase Improvement New rules  Anti-SR: create strong soldiers and attack  Anti-KR: if a `knights’ state can be reached, do so and start building knights  Defendable expansion: build defensive force then expand Changes  Adjustment of parameters of several combat rules

28 Improved Rulebase Results TacticTestsLowHighAvg.Med.>100Won SBLA LBLA SR KR Enhanced performance against ALL tactics!

29 Conclusions Dynamic scripting can be successfully implemented in (commercial) CRPG & RTS games Offline evolutionary learning can design counter-tactics for RTS games Evolved counter-tactics can be used to improve domain knowledge used by adaptive game AI

30 References Spronck, P., I. Sprinkhuizen-Kuyper, and E. Postma. 2004a. “Online Adaptation of Game Opponent AI with Dynamic Scripting.” Sweetser, P. (2002). Current AI in Games: A review Manslow. “Learning and Adaptation” & “Using reinforcement learning to Solve AI Control Problems” Laird, J.E “Human-Level AI's Killer Application: Computer Game AI.” Ponsen, M. Spronck. P “Improving Adaptive AI with Evolutionary Learning”