Design of a real time strategy game with a genetic AI By Bharat Ponnaluri.

Slides:



Advertisements
Similar presentations
Genetic Algorithms (Evolutionary Computing) Genetic Algorithms are used to try to “evolve” the solution to a problem Generate prototype solutions called.
Advertisements

1 An Adaptive GA for Multi Objective Flexible Manufacturing Systems A. Younes, H. Ghenniwa, S. Areibi uoguelph.ca.
Using Parallel Genetic Algorithm in a Predictive Job Scheduling
Tetris – Genetic Algorithm Presented by, Jeethan & Jun.
Student : Mateja Saković 3015/2011.  Genetic algorithms are based on evolution and natural selection  Evolution is any change across successive generations.
Tetris and Genetic Algorithms Math Club 5/30/2011.
Case Study: Genetic Algorithms GAs are an area of AI research –used to solve search problems with potentially better performance than traditional search.
Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm
On the Genetic Evolution of a Perfect Tic-Tac-Toe Strategy
Tuesday, May 14 Genetic Algorithms Handouts: Lecture Notes Question: when should there be an additional review session?
Evolutionary Computing A Practical Introduction Presented by Ben Paechter Napier University with thanks to the EvoNet Training Committee and its “Flying.
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.
A new crossover technique in Genetic Programming Janet Clegg Intelligent Systems Group Electronics Department.
Evolutionary Computation Application Peter Andras peter.andras/lectures.
Intro to AI Genetic Algorithm Ruth Bergman Fall 2004.
Chapter 6: Transform and Conquer Genetic Algorithms The Design and Analysis of Algorithms.
Pawel Drozdowski – November Introduction GA basics Solving simple problem GA more advanced topics Solving complex problem Question and Answers.
Prepared by Barış GÖKÇE 1.  Search Methods  Evolutionary Algorithms (EA)  Characteristics of EAs  Genetic Programming (GP)  Evolutionary Programming.
Evolutionary algorithms
Genetic Algorithm.
Cristian Urs and Ben Riveira. Introduction The article we chose focuses on improving the performance of Genetic Algorithms by: Use of predictive models.
SOFT COMPUTING (Optimization Techniques using GA) Dr. N.Uma Maheswari Professor/CSE PSNA CET.
Othello Artificial Intelligence With Machine Learning
Solving the Concave Cost Supply Scheduling Problem Xia Wang, Univ. of Maryland Bruce Golden, Univ. of Maryland Edward Wasil, American Univ. Presented at.
Zorica Stanimirović Faculty of Mathematics, University of Belgrade
Genetic Algorithms Michael J. Watts
Genetic algorithms Charles Darwin "A man who dares to waste an hour of life has not discovered the value of life"
HOW TO MAKE A TIMETABLE USING GENETIC ALGORITHMS Introduction with an example.
Presenter: Chih-Yuan Chou GA-BASED ALGORITHMS FOR FINDING EQUILIBRIUM 1.
More on Heuristics Genetic Algorithms (GA) Terminology Chromosome –candidate solution - {x 1, x 2,...., x n } Gene –variable - x j Allele –numerical.
G ENETIC A LGORITHMS Steve Foster. I NTRODUCTION Genetic Algorithms are based on the principals of evolutionary biology in order to find solutions to.
Fuzzy Genetic Algorithm
Evolving Virtual Creatures & Evolving 3D Morphology and Behavior by Competition Papers by Karl Sims Presented by Sarah Waziruddin.
EE459 I ntroduction to Artificial I ntelligence Genetic Algorithms Kasin Prakobwaitayakit Department of Electrical Engineering Chiangmai University.
GENETIC ALGORITHMS.  Genetic algorithms are a form of local search that use methods based on evolution to make small changes to a popula- tion of chromosomes.
Genetic Programming Lab For Chess Hadar Rottenberg & Nizan Freedman.
Evolutionary Art with Multiple Expression Programming By Quentin Freeman.
© Negnevitsky, Pearson Education, Lecture 9 Evolutionary Computation: Genetic algorithms Introduction, or can evolution be intelligent? Introduction,
2005MEE Software Engineering Lecture 11 – Optimisation Techniques.
Algorithms and their Applications CS2004 ( ) 13.1 Further Evolutionary Computation.
Learning by Simulating Evolution Artificial Intelligence CSMC February 21, 2002.
Evolution Programs (insert catchy subtitle here).
1 Genetic Algorithms K.Ganesh Introduction GAs and Simulated Annealing The Biology of Genetics The Logic of Genetic Programmes Demo Summary.
Genetic Algorithms. 2 Overview Introduction To Genetic Algorithms (GAs) GA Operators and Parameters Genetic Algorithms To Solve The Traveling Salesman.
1. Genetic Algorithms: An Overview  Objectives - Studying basic principle of GA - Understanding applications in prisoner’s dilemma & sorting network.
Pac-Man AI using GA. Why Machine Learning in Video Games? Better player experience Agents can adapt to player Increased variety of agent behaviors Ever-changing.
Optimization Problems
GENETIC ALGORITHM Basic Algorithm begin set time t = 0;
D Nagesh Kumar, IIScOptimization Methods: M8L5 1 Advanced Topics in Optimization Evolutionary Algorithms for Optimization and Search.
Othello Artificial Intelligence With Machine Learning Computer Systems TJHSST Nick Sidawy.
1 Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations Genetic Algorithm (GA)
Design of a real time strategy game with a genetic AI By Bharat Ponnaluri.
Genetic Algorithm Dr. Md. Al-amin Bhuiyan Professor, Dept. of CSE Jahangirnagar University.
Genetic Algorithms. Overview “A genetic algorithm (or GA) is a variant of stochastic beam search in which successor states are generated by combining.
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal Evolutionary Computation.
Understanding AI of 2 Player Games. Motivation Not much experience in AI (first AI project) and no specific interests/passion that I wanted to explore.
Genetic Algorithms An Evolutionary Approach to Problem Solving.
Genetic Algorithm(GA)
George Yauneridge.  Machine learning basics  Types of learning algorithms  Genetic algorithm basics  Applications and the future of genetic algorithms.
Genetic Algorithm. Outline Motivation Genetic algorithms An illustrative example Hypothesis space search.
Genetic Algorithms and Evolutionary Programming A Brief Overview.
 Presented By: Abdul Aziz Ghazi  Roll No:  Presented to: Sir Harris.
March 1, 2016Introduction to Artificial Intelligence Lecture 11: Machine Evolution 1 Let’s look at… Machine Evolution.
Design of a real time strategy game with a genetic AI By Bharat Ponnaluri.
Genetic Algorithm (Knapsack Problem)
Power Magnetic Devices: A Multi-Objective Design Approach
Using GA’s to Solve Problems
Selected Topics in CI I Genetic Programming Dr. Widodo Budiharto 2014.
GA.
Presentation transcript:

Design of a real time strategy game with a genetic AI By Bharat Ponnaluri

Abstract Current strategy game AI Involved combinations of heuristics and constants. The combinations need to be optimized for the AI to be effective Too many possible constants&combinations-->difficult optimization Chess heuristic evaluations Moves available Is the king safe Pawn structure Material balance Genetic AI Can produce constants and combinations of heuristic algorithms quickly by eliminating suboptimal combinations.

Introduction Design of a simple real time strategy game –Build troops and try to take over cities –Like Risk in real time –Goal is to have an intelligent AI optimized with a Genetic Algorithm(GA). AI design –Coding of simple building block heuristic evaluation functions –Addition of constants(Agressiveness,stinginess) that determine behaviour –Chromosomes will be random combinations of Heuristic evalution functions –Used to evaluate the quality of a possible course of action based on game data

Personality Traits Goal: To make the AI more interesting and humanlike Traits –Agressiveness –Paranoia –Stinginess –Vengence –Trustworthiness

Observation AI will take advantage of other players' behavior Examples –Assertivness The AI will keep track of when a player retreats The AI will attack a player which retreats a lot –Attacking game leader One player is threatening to win AI will track who tries to stop that player Then the AI will let that player do the work

Game Theory Advantages –Not very complicated –Easily understandable by AI –Good model of human behavior

Game Theory: War of attrition Two players fighting over city Backing down=loss in percieved assertiveness Fighting=massive loss in strength t=time that conflict lasts Don't FightFight Don't Fight(0,0,0)(-t+1,-t,0) Fight(t,-t+1,0)(-t,-t,2*t)

Sample chromosome Chromosome enemyStrength()/2*myStrength()-3*fooA()/ power() Possible genes public int fooA().... public int enemyStrength().... public int myStrength()

Heuristic evaluation functions –Used to evaluate the quality of a possible course of action based on game data Example: –Public int getTrafficJamFactor() Return ( 1.001^(number of cars))/roadSize

How do GAs work Replicate evolution Steps 1.Determine random combinations of heuristics and constants(chromosomes) 2.Test chromosomes 3.Remove suboptimal chromosomes 4.Mutate surviving chromosomes 5.Swap data between surviving chromosomes 6.If chromosomes are optimal,end algorithm 7.Otherwise, repeat steps 1-7

Advantages and Disadvantages Advantages o Can function without user input o Can optimize a large number of constants o Usually is very good at optimizing stuff o Can determine unknown solutions Possible disadvantages o GAs are complicated o Take a significant amount of computing power o Networking will increase complexity

Evolutionary Stable Strategies(ESS) Gene pool of defectors means cooperating players will lose Advantages –Diverse AI personalities Disadvantages –May lead to suboptimal/boring AI's CooperateDefect Cooperate1,1-10,3 Defect3,-10-5,-5

ESS: Example Population of turtling AI's AI's only counterattack or attack weak players A more balanced AI will lose Playing against a group of turtling AI's is boring

New Heurstics Find Targets() –Average proximity –Income power factor –Troop power factor –Potential borders

Testing results Numbers greater than 1 are not good From last working version(before new heurstics) Number of Troops On Map Rendering Time Update Time AI

Generating a target number using a mathematical expression –Combination of numbers(1-9) and mathematical operators(-,+,*,/) adding up to a target number –Each number=4 bits –Chromosome *4.8568/ –Fitness value is the absolute value of (targetNumber)/(expressionValue-targetNumber) –Can be scaled for large numbers &decimals –No attempting to use brute force to test out random combinations.

Important Classes Classes –FormualaGenerator: Driver Program –GraphPanel: Draws the graph of the average fitness and maximum fitness. Makes the GA run periodically in synchornization with the graph. –Chromosome: Represents the chromosomes/expressions.

Static Mutation

Dynamic Mutation

Sample Expressions for 150 Static Mutation – (( / ) * * ) - (( ) / ) + ( * * ) = Dynamic Mutation – (( / ) * * ) - (( ) / ) + ( * * ) =

Analysis of results The dynamic mutation did not help because the standard deviations were 0 The GA generally works but occasionally crashes due to a bug which deletes all the chromosomes The graphs show rapid spikes in fitness followed by a rapid decline –Shows that the GA does not get stuck on local exterma. There are long period of nearly static fitness levels.

Important Methods RemoveFailures: –Finds all the chromosomes in the population with a fitness that is below average and removes them Crossover: –Picks random chromosomes to mate and produce children. –Once enough children are produced, the children are saved and the parents are deleted Mutations –Generates a mutation rate based on the standard deviation of the fitness values and average change of them –Calls the mutate method and gives it the mutation rate DrawGraph: Takes the saved data for the highest fitness rate, average fitness rate, standard deviation, and change of population and outputs the data visually.

Future Plan Debug implementation of dynamic mutation Make genetic algoritm generate formuals for input-output pairs based on common functions Create scenarios for my game with obvious good/bad choices for each player Run GA for game –Fitness rates will be based on how well the AI's evaluates the scenarios. –Running a full version of my game will take too much time.