FINAL PROJECT ARTIFICIAL INTELLIGENCE VINDINIUM. Hosam Hakroush and Dmitry Levikov FOUR LEGENDARY HEROES, FIGHTING FOR THE LAND OF VINDINIUM

Size: px
Start display at page:

Download "FINAL PROJECT ARTIFICIAL INTELLIGENCE VINDINIUM. Hosam Hakroush and Dmitry Levikov FOUR LEGENDARY HEROES, FIGHTING FOR THE LAND OF VINDINIUM"

Transcription

1 FINAL PROJECT ARTIFICIAL INTELLIGENCE Hosam Hakroush and Dmitry Levikov VINDINIUM FOUR LEGENDARY HEROES, FIGHTING FOR THE LAND OF VINDINIUM ROAMING IN THE DANGEROUS WOODS SLASHING GOBLINS, STEALING GOLD MINES AND LOOKING FOR A TAVERN TO DRINK AWAY THEIR TIREDNESS

2 TABLE OF CONTENTS Introduction... 3 Background... 3 Heroes... 3 Turns... 3 Mines... 5 How To Run... 6 Implementation... 7 Important Remarks... 7 Added/Changed files... 9 Reflex Agent Wiki Implementation Results MiniMax Agent Wiki Implementation Results Q_Learning Agent Wiki Implementation Results Comparison Combined Agent Wiki Implementation Results Conclusion P a g e

3 INTRODUCTION BACKGROUND Vindinium is a multiplayer turn based game where each player chooses a coding language of his choice and then develops his ultimate legendary hero that can move across a given generated 2D map. The objective is to amass as much gold as you can during a predetermined number of turns. In order to produce gold, players must take control of mines, which are protected by goblins. HEROES Each hero can move by one square each turn, and has the following attributes: Life points: starting at the maximum value of 100. If it drops to 0, the hero dies and immediately respawns on his initial position as given in the map s layout(see below) Gold: starting at 0. Represents the hero s goal in the game, the more the better and the winner at the end of the game is the richest hero. TURNS Each bot must issue an order for his hero at the end of each turn. Possible orders are: Stay, North, South, East or West. Once the order is issued, the hero moves accordingly (see below). 3 P a g e

4 Movement For each step the hero takes, he loses 1 HP. However, the hero s HP never drops below 1 by walking. If the hero: Steps into another hero, he stays in place and nothing happens. They fight when the current turn ends. Tries to step out of the map or over a tree, nothing happens. Steps into a tavern, he stays there, orders a beer and restores 50HP for 2 gold coins, however, HP cannot exceed 100. Has a neighboring hero which is 1 diagonal/vertical square away, he attacks him with his vicious sharp blade, the defending hero loses 20HP, and if he dies the attacker automatically gains control of all his conquered mines. 4 P a g e

5 Maps Maps are generated randomly using a similar layout to pacman s. Here s an example to a simple map: MINES Each mine profits the owner 1 gold coin per turn, however, a mine can be conquered by another hero as detailed above, and then all of the mine s profits go to the new owner. 5 P a g e

6 HOW TO RUN The game didn t offer a quickly compiled game and many configurations had to be made before one can see the work of his bot. Therefore we changed their U.I. in order to play a game please follow these steps: Unzip the code folder Cd to that location Run the following command: python client.py [mode] [agent] [depth] 1. where mode is one of the following: arena you play online but you have to wait for other players to join your game training you play offline against supplied bots 2. agent is one of the following: reflex use our reflex agent qlearning use our qlearning agent combined use our Combined agent MiniMax must have depth after it. click 1 in order to play the game After running, if you chose arena you re ought to wait a bit until some players join. Then, after the game starts, you get at the log a link to the online game, even if its against random given agents, you browse to that link and then you re *Note that the game requires python 2.7 to run 6 P a g e

7 IMPLEMENTATION Although the challenge offered us a starter kit in Python, it lacked basic clarity and reading the code thoroughly was a difficult task itself. The kit handed a random agent as an example of how to use the supplied functions and variables including a guide to how to move your hero. However, after weeks of sleepless nights, we managed to get four great working agents based on algorithms we learned in class during the semester. Our hard work paid off, greatly. We re now even able to beat worldwide leaders. IMPORTANT REMARKS We immediately figured that we have to use smart, complex agents in order to excel in this game and as stated earlier the kit lacked certain essential components, therefore we defined many new helper files, the most important of them was the state class(defined in state.py), which represents each state in the game. An object of the State class would include the following variables/methods: init (self, game): the State s initializer. generatesuccessor(self, the_hero, new_pos): generates a new State object describing the resulting state upon moving the_hero to position new_pos game : the game itself. An object of the class Game enemy_heroes : all the other heroes in the game where a hero is an object of the inner class Game::Hero enemy_locations : the locations of all the other heroes in the game, a location is a tuple (x,y) nearest_enemy_pos, nearest_mine_pos, nearest_tavern _pos: the locations of the nearest enemy, not owned mine, tavern found by an search algorithm defined in path_tools.py. 7 P a g e

8 actions : is a list of Action objects, Action is a simple parent class (defined in actions.py) that contains the name of the action, where the action is located and the path to that location (The path to the location was calculated using an algorithm we defined in path_tools.py, given an initial position, uses a chosen heuristic to find the desired node fast, we re using the Manhattan distance as a default heuristic). An action can be one of the following o Tavern(Action) : the closest tavern to us, where we can refill our HP by 50 for 2 gold coins. o Nothing(Action) : do nothing. o Mine(Action) : only if we don t own all mines, a Mine object is appended to the actions list containing the closest unoccupied mine s details. o Fight(Action) : for each other hero in the game, we add a Fight object containing details on how to reach him and fight him. After defining the important State Class and all the Action classes, we noticed that we can t use gold as our score/goal in the game because it lacks many other aspects of what a good state and what s not, for example it s better for us to be close to a tavern when our HP isn t full, and it s better for us that our foes are doing worse than us. Therefore we then defined a state evaluating function(evaluate_state which is defined in heuristics.py); given a state, the function evaluates it using many aspects including the ones in the examples above, returns a score that s used by our agents, also, the supplied files do not contain any way to run more than 1 game in fast session(to teach our learning agent) so he had to develop a smart emulator that fights 1 learning agent vs. 3 reflex agents (defined in emulator.py) 8 P a g e

9 ADDED/CHANGED FILES File ai.py actions.py combined_agent.py config.py emulator.py heuristics.py minimax_agent.py path_tools.py q_learning_agent.py reflex_agent.py state.py util.py What it contains/what was changed Changed it so that after executing config.py one of our agents will be chosen. The action object Our Combined Agent By using this file, one can choose which agent he wants to play our defined emulator Two functions; evaluate_action and evaluate_state, defined to evaluate a given state/action Our MiniMax Agent Path finding functions 1. Our Learning Agent. 2. SimpleExtractor - returns all the features in a given game object. 3. IdentityExtractor same but returns a specific feature. Our Reflex Agent The State Class Contains Counter, PriorityQueue classes (as defined in pacman exercises) 9 P a g e

10 REFLEX AGENT WIKI Reflex agents act only on the basis of the current percept, ignoring the rest of the percept history. This agent succeeds only if the environment is fully observable. When an agent faces a partially observable environment infinite loops are often unavoidable. IMPLEMENTATION We worked very hard on our reflex agent, the agent as expected excelled in collecting gold, defending his mines and conquering other mines, it was based on calculating certain scores using personally defined functions and then choosing the action that yields us the best score. We faced difficulties because the game contains many aspects a person has to take care of. Our reflex agent does the following: 1. Gets all the legal moves using get_moves(defined in path_tools.py). 2. Calculates the maximum value we can achieve by following any of the actions in state.actions using our implemented evaluate_action function 3. Choose a random action from all of the actions that can achieve the previously calculated maximum value. 4. Returns a tuple containing the optimal path, the optimal action, and the decision. 10 P a g e

11 Results Unsurprisingly, our Reflex Agent worked perfectly and won the game against offline bots almost every time: However, in the arena, where we fought other developed bots, things got a bit harder, although we collected a very nice amount of gold and most of the time we finished 1 st or 2 nd, upon facing zuborg or Mini-Me, the worldwide leaders (#1 and #2 respectfully), we encountered some embarrassing moments, including results like these: 11 P a g e

12 Nevertheless, we accomplished what many couldn t and we beat zuborg not once but twice : MINIMAX AGENT WIKI Minimax (sometimes MinMax or MM) is a decision rule used in decision theory, game theory, statistics and philosophy for minimizing the possible loss for a worst case (maximum loss) scenario. Originally formulated for two-player zero-sum game theory, covering both the cases where players take alternate moves and those where they make simultaneous moves, it has also been extended to more complex games and to general decision-making in the presence of uncertainty. IMPLEMENTATION Our Minimax agent does the following: 1. Uses generateenemymovepermutations(defined in MiniMax class in ai.py) to generate all of the 12 P a g e

13 enemies possible moves (5- moves for each hero totaling 15- total permutations). 2. Uses get_moves(defined in path_tools.py) to get all of our hero s possible moves. 3. Uses recursion with a given depth to get the possible outcome for the next (depth) moves using the MiniMax algorithm, meaning, when it s the enemies turn to play, they ll do their best to minimize the score, and when it s my hero s time to play. Where the score is evaluated using evaluate_action(defined in heuristics.py) 4. Returns a tuple containing the optimal path, the optimal action, and the decision. Results Unfortunately, after full implementation and reaching a fully active MiniMax agent, the agent failed in achieving a higher score than the reflex agent which was developed perfectly, the processors in the computer labs were not good enough to go past a depth of 2, depth 3 was very slow and rarely finished the game. depth 4 even got us the following error: 13 P a g e

14 Q_LEARNING AGENT WIKI Q-learning is a model-free reinforcement learning technique. Specifically, Q-learning can be used to find an optimal action-selection policy for any given (finite) Markov decision process (MDP). It works by learning an action-value function that ultimately gives the expected utility of taking a given action in a given state and following the optimal policy thereafter. A policy is a rule that the agent follows in selecting actions, given the state it is in. When such an actionvalue function is learned, the optimal policy can be constructed by simply selecting the action with the highest value in each state. One of the strengths of Q- learning is that it is able to compare the expected utility of the available actions without requiring a model of the environment. IMPLEMENTATION Our Q_Learning agent does the following: 1. Get all the possible legal actions using self.getlegalactions 2. On probability epsilon choose a random move, otherwise, choose the best move using self.getpolicy which uses the q_learning mechanism to choose the action yielding us the highest QValue where QValue is calculated using previously calculated features and values. 3. Returns a tuple containing the optimal path, the optimal action, and the decision. 14 P a g e

15 RESULTS Since the learning algorithm requires previous game spectating and it learns from previous actions/moves, the Q_Learning agent wasn t applicable in the online game, as the online game requires fast responds when calling getmove, although we won against offline heroes, The agent failed online where people mainly used heuristics and search algorithms, approaches that use far less memory/time. The Q_learning agent wasn t created in order to be run on the online arena, it was mainly developed to be used by the amazing combined agent. COMPARISON We were almost certain that the Q_Learning agent is no match to our ferocious reflex agent, however we wanted to be sure, so after implementing the emulator(emulator.py) we compiled it and had 3 reflex agents fight 1 Q_Learning agent multiple games. Here are some of the results: 15 P a g e

16 COMBINED AGENT WIKI The combined agent uses a combination of our two best agents; the reflex agent and the q learning agent to implement a learning agent which is applicable in the real online contest, since obviously, we can t stop the online game in order to learn what to do and what not to do, we simply learn on the run. IMPLEMENTATION RESULTS Our combined agent does the following whenever getmove is called: 1. Initially, the powerful reflex agent is used. 2. While playing the game and moving, have our agent learn and study the behavior of other heroes. 3. When completing the learning process, start using the Q_Learning agent(other heroes are bots as well so the learning process is ought to end) Since the combined agent uses a reflex agent and learns by the Q_Learning agent on the run, we received a much similar agent to the Reflex Agent. We beat every offline hero and we won 60% of the times online, the combined agent mainly used the reflex agent since the learning process took a lot of time, we rarely got to the learning agent s part, but when we did. Our enemies dug their graves themselves. 16 P a g e

17 17 P a g e We even won in a game where zuborg played with 2 bots, and the 4 th hero was Mini-Me!:

18 CONCLUSION Although all of our agents work theoretically perfect, MiniMax and QLearning failed to achieve high scores due to the game s complex and difficult rules. MiniMax failed in achieving any depth greater than 2, which makes it a very lousy agent given the fact that the average map in this game has a size of 12X12. The game has 4 heroes. With 5 possible moves for each, To all that add the fact that we used an average computer (8gb ram) any depth less than 4 wouldn t be very helpful, thus proving that MiniMax isn t quite helpful when we re playing high level complex games ( it would be helpful only when using super computers, even then, we doubt it will be better than our Combined Agent). As for the QLearning agent, as I mentioned earlier, this agent wasn t meant to be tried out for combat in the arena, but a smart tweak to the already amazing reflex agent. Our ace, the Combined agent, beat up a lot of enemies and amazed us in his runs, if we keep the bot running we re certain in reaching worldwide rankings. 18 P a g e

COMP3211 Project. Artificial Intelligence for Tron game. Group 7. Chiu Ka Wa ( ) Chun Wai Wong ( ) Ku Chun Kit ( )

COMP3211 Project. Artificial Intelligence for Tron game. Group 7. Chiu Ka Wa ( ) Chun Wai Wong ( ) Ku Chun Kit ( ) COMP3211 Project Artificial Intelligence for Tron game Group 7 Chiu Ka Wa (20369737) Chun Wai Wong (20265022) Ku Chun Kit (20123470) Abstract Tron is an old and popular game based on a movie of the same

More information

HUJI AI Course 2012/2013. Bomberman. Eli Karasik, Arthur Hemed

HUJI AI Course 2012/2013. Bomberman. Eli Karasik, Arthur Hemed HUJI AI Course 2012/2013 Bomberman Eli Karasik, Arthur Hemed Table of Contents Game Description...3 The Original Game...3 Our version of Bomberman...5 Game Settings screen...5 The Game Screen...6 The Progress

More information

2048: An Autonomous Solver

2048: An Autonomous Solver 2048: An Autonomous Solver Final Project in Introduction to Artificial Intelligence ABSTRACT. Our goal in this project was to create an automatic solver for the wellknown game 2048 and to analyze how different

More information

Announcements. Homework 1. Project 1. Due tonight at 11:59pm. Due Friday 2/8 at 4:00pm. Electronic HW1 Written HW1

Announcements. Homework 1. Project 1. Due tonight at 11:59pm. Due Friday 2/8 at 4:00pm. Electronic HW1 Written HW1 Announcements Homework 1 Due tonight at 11:59pm Project 1 Electronic HW1 Written HW1 Due Friday 2/8 at 4:00pm CS 188: Artificial Intelligence Adversarial Search and Game Trees Instructors: Sergey Levine

More information

Artificial Intelligence. Minimax and alpha-beta pruning

Artificial Intelligence. Minimax and alpha-beta pruning Artificial Intelligence Minimax and alpha-beta pruning In which we examine the problems that arise when we try to plan ahead to get the best result in a world that includes a hostile agent (other agent

More information

Where's the Treasure?

Where's the Treasure? Where's the Treasure? Introduction: In this project you will use the joystick and LED Matrix on the Sense HAT to play a memory game. The Sense HAT will show a gold coin and you have to remember where it

More information

Game Playing for a Variant of Mancala Board Game (Pallanguzhi)

Game Playing for a Variant of Mancala Board Game (Pallanguzhi) Game Playing for a Variant of Mancala Board Game (Pallanguzhi) Varsha Sankar (SUNet ID: svarsha) 1. INTRODUCTION Game playing is a very interesting area in the field of Artificial Intelligence presently.

More information

Using Artificial intelligent to solve the game of 2048

Using Artificial intelligent to solve the game of 2048 Using Artificial intelligent to solve the game of 2048 Ho Shing Hin (20343288) WONG, Ngo Yin (20355097) Lam Ka Wing (20280151) Abstract The report presents the solver of the game 2048 base on artificial

More information

CS 188: Artificial Intelligence Spring Announcements

CS 188: Artificial Intelligence Spring Announcements CS 188: Artificial Intelligence Spring 2011 Lecture 7: Minimax and Alpha-Beta Search 2/9/2011 Pieter Abbeel UC Berkeley Many slides adapted from Dan Klein 1 Announcements W1 out and due Monday 4:59pm P2

More information

CMSC 671 Project Report- Google AI Challenge: Planet Wars

CMSC 671 Project Report- Google AI Challenge: Planet Wars 1. Introduction Purpose The purpose of the project is to apply relevant AI techniques learned during the course with a view to develop an intelligent game playing bot for the game of Planet Wars. Planet

More information

Documentation and Discussion

Documentation and Discussion 1 of 9 11/7/2007 1:21 AM ASSIGNMENT 2 SUBJECT CODE: CS 6300 SUBJECT: ARTIFICIAL INTELLIGENCE LEENA KORA EMAIL:leenak@cs.utah.edu Unid: u0527667 TEEKO GAME IMPLEMENTATION Documentation and Discussion 1.

More information

Practice Session 2. HW 1 Review

Practice Session 2. HW 1 Review Practice Session 2 HW 1 Review Chapter 1 1.4 Suppose we extend Evans s Analogy program so that it can score 200 on a standard IQ test. Would we then have a program more intelligent than a human? Explain.

More information

Learning from Hints: AI for Playing Threes

Learning from Hints: AI for Playing Threes Learning from Hints: AI for Playing Threes Hao Sheng (haosheng), Chen Guo (cguo2) December 17, 2016 1 Introduction The highly addictive stochastic puzzle game Threes by Sirvo LLC. is Apple Game of the

More information

Project 1. Out of 20 points. Only 30% of final grade 5-6 projects in total. Extra day: 10%

Project 1. Out of 20 points. Only 30% of final grade 5-6 projects in total. Extra day: 10% Project 1 Out of 20 points Only 30% of final grade 5-6 projects in total Extra day: 10% 1. DFS (2) 2. BFS (1) 3. UCS (2) 4. A* (3) 5. Corners (2) 6. Corners Heuristic (3) 7. foodheuristic (5) 8. Suboptimal

More information

Reinforcement Learning in Games Autonomous Learning Systems Seminar

Reinforcement Learning in Games Autonomous Learning Systems Seminar Reinforcement Learning in Games Autonomous Learning Systems Seminar Matthias Zöllner Intelligent Autonomous Systems TU-Darmstadt zoellner@rbg.informatik.tu-darmstadt.de Betreuer: Gerhard Neumann Abstract

More information

CS188: Artificial Intelligence, Fall 2011 Written 2: Games and MDP s

CS188: Artificial Intelligence, Fall 2011 Written 2: Games and MDP s CS88: Artificial Intelligence, Fall 20 Written 2: Games and MDP s Due: 0/5 submitted electronically by :59pm (no slip days) Policy: Can be solved in groups (acknowledge collaborators) but must be written

More information

Announcements. CS 188: Artificial Intelligence Spring Game Playing State-of-the-Art. Overview. Game Playing. GamesCrafters

Announcements. CS 188: Artificial Intelligence Spring Game Playing State-of-the-Art. Overview. Game Playing. GamesCrafters CS 188: Artificial Intelligence Spring 2011 Announcements W1 out and due Monday 4:59pm P2 out and due next week Friday 4:59pm Lecture 7: Mini and Alpha-Beta Search 2/9/2011 Pieter Abbeel UC Berkeley Many

More information

CPS331 Lecture: Search in Games last revised 2/16/10

CPS331 Lecture: Search in Games last revised 2/16/10 CPS331 Lecture: Search in Games last revised 2/16/10 Objectives: 1. To introduce mini-max search 2. To introduce the use of static evaluation functions 3. To introduce alpha-beta pruning Materials: 1.

More information

CS 188: Artificial Intelligence. Overview

CS 188: Artificial Intelligence. Overview CS 188: Artificial Intelligence Lecture 6 and 7: Search for Games Pieter Abbeel UC Berkeley Many slides adapted from Dan Klein 1 Overview Deterministic zero-sum games Minimax Limited depth and evaluation

More information

Interactive 1 Player Checkers. Harrison Okun December 9, 2015

Interactive 1 Player Checkers. Harrison Okun December 9, 2015 Interactive 1 Player Checkers Harrison Okun December 9, 2015 1 Introduction The goal of our project was to allow a human player to move physical checkers pieces on a board, and play against a computer's

More information

CMSC 372: Artificial Intelligence Lab#1: Designing Pac-Man Agents

CMSC 372: Artificial Intelligence Lab#1: Designing Pac-Man Agents CMSC 372: Artificial Intelligence Lab#1: Designing Pac-Man Agents Figure 1: The Pac-Man World Introduction In this project, you will familiarize yourself with the Pac-Man World. Over the next few assignments

More information

game tree complete all possible moves

game tree complete all possible moves Game Trees Game Tree A game tree is a tree the nodes of which are positions in a game and edges are moves. The complete game tree for a game is the game tree starting at the initial position and containing

More information

Adversarial Search and Game- Playing C H A P T E R 6 C M P T : S P R I N G H A S S A N K H O S R A V I

Adversarial Search and Game- Playing C H A P T E R 6 C M P T : S P R I N G H A S S A N K H O S R A V I Adversarial Search and Game- Playing C H A P T E R 6 C M P T 3 1 0 : S P R I N G 2 0 1 1 H A S S A N K H O S R A V I Adversarial Search Examine the problems that arise when we try to plan ahead in a world

More information

Game-playing: DeepBlue and AlphaGo

Game-playing: DeepBlue and AlphaGo Game-playing: DeepBlue and AlphaGo Brief history of gameplaying frontiers 1990s: Othello world champions refuse to play computers 1994: Chinook defeats Checkers world champion 1997: DeepBlue defeats world

More information

COMP219: COMP219: Artificial Intelligence Artificial Intelligence Dr. Annabel Latham Lecture 12: Game Playing Overview Games and Search

COMP219: COMP219: Artificial Intelligence Artificial Intelligence Dr. Annabel Latham Lecture 12: Game Playing Overview Games and Search COMP19: Artificial Intelligence COMP19: Artificial Intelligence Dr. Annabel Latham Room.05 Ashton Building Department of Computer Science University of Liverpool Lecture 1: Game Playing 1 Overview Last

More information

Optimal Yahtzee performance in multi-player games

Optimal Yahtzee performance in multi-player games Optimal Yahtzee performance in multi-player games Andreas Serra aserra@kth.se Kai Widell Niigata kaiwn@kth.se April 12, 2013 Abstract Yahtzee is a game with a moderately large search space, dependent on

More information

Dota2 is a very popular video game currently.

Dota2 is a very popular video game currently. Dota2 Outcome Prediction Zhengyao Li 1, Dingyue Cui 2 and Chen Li 3 1 ID: A53210709, Email: zhl380@eng.ucsd.edu 2 ID: A53211051, Email: dicui@eng.ucsd.edu 3 ID: A53218665, Email: lic055@eng.ucsd.edu March

More information

Rock, Paper, Scissors

Rock, Paper, Scissors Projects Rock, Paper, Scissors Create your own 'Rock, Paper Scissors' game. Python Step 1 Introduction In this project you will make a Rock, Paper, Scissors game and play against the computer. Rules: You

More information

Mittwoch, 14. September The Pelita contest (a brief introduction)

Mittwoch, 14. September The Pelita contest (a brief introduction) The Pelita contest (a brief introduction) Overview Overview Each Team owns two Bots Bots for team 0 Bots for team 1 Overview Each Team owns two Bots Each Bot is controlled by a Player Bots for team 0 Player

More information

Game Artificial Intelligence ( CS 4731/7632 )

Game Artificial Intelligence ( CS 4731/7632 ) Game Artificial Intelligence ( CS 4731/7632 ) Instructor: Stephen Lee-Urban http://www.cc.gatech.edu/~surban6/2018-gameai/ (soon) Piazza T-square What s this all about? Industry standard approaches to

More information

Anavilhanas Natural Reserve (about 4000 Km 2 )

Anavilhanas Natural Reserve (about 4000 Km 2 ) Anavilhanas Natural Reserve (about 4000 Km 2 ) A control room receives this alarm signal: what to do? adversarial patrolling with spatially uncertain alarm signals Nicola Basilico, Giuseppe De Nittis,

More information

COMP219: Artificial Intelligence. Lecture 13: Game Playing

COMP219: Artificial Intelligence. Lecture 13: Game Playing CMP219: Artificial Intelligence Lecture 13: Game Playing 1 verview Last time Search with partial/no observations Belief states Incremental belief state search Determinism vs non-determinism Today We will

More information

Artificial Intelligence 1: game playing

Artificial Intelligence 1: game playing Artificial Intelligence 1: game playing Lecturer: Tom Lenaerts Institut de Recherches Interdisciplinaires et de Développements en Intelligence Artificielle (IRIDIA) Université Libre de Bruxelles Outline

More information

CandyCrush.ai: An AI Agent for Candy Crush

CandyCrush.ai: An AI Agent for Candy Crush CandyCrush.ai: An AI Agent for Candy Crush Jiwoo Lee, Niranjan Balachandar, Karan Singhal December 16, 2016 1 Introduction Candy Crush, a mobile puzzle game, has become very popular in the past few years.

More information

Adversarial Search Lecture 7

Adversarial Search Lecture 7 Lecture 7 How can we use search to plan ahead when other agents are planning against us? 1 Agenda Games: context, history Searching via Minimax Scaling α β pruning Depth-limiting Evaluation functions Handling

More information

PROFILE. Jonathan Sherer 9/30/15 1

PROFILE. Jonathan Sherer 9/30/15 1 Jonathan Sherer 9/30/15 1 PROFILE Each model in the game is represented by a profile. The profile is essentially a breakdown of the model s abilities and defines how the model functions in the game. The

More information

Programming an Othello AI Michael An (man4), Evan Liang (liange)

Programming an Othello AI Michael An (man4), Evan Liang (liange) Programming an Othello AI Michael An (man4), Evan Liang (liange) 1 Introduction Othello is a two player board game played on an 8 8 grid. Players take turns placing stones with their assigned color (black

More information

CS 188: Artificial Intelligence

CS 188: Artificial Intelligence CS 188: Artificial Intelligence Adversarial Search Instructor: Stuart Russell University of California, Berkeley Game Playing State-of-the-Art Checkers: 1950: First computer player. 1959: Samuel s self-taught

More information

CS 229 Final Project: Using Reinforcement Learning to Play Othello

CS 229 Final Project: Using Reinforcement Learning to Play Othello CS 229 Final Project: Using Reinforcement Learning to Play Othello Kevin Fry Frank Zheng Xianming Li ID: kfry ID: fzheng ID: xmli 16 December 2016 Abstract We built an AI that learned to play Othello.

More information

A Quoridor-playing Agent

A Quoridor-playing Agent A Quoridor-playing Agent P.J.C. Mertens June 21, 2006 Abstract This paper deals with the construction of a Quoridor-playing software agent. Because Quoridor is a rather new game, research about the game

More information

Monte Carlo Tree Search

Monte Carlo Tree Search Monte Carlo Tree Search 1 By the end, you will know Why we use Monte Carlo Search Trees The pros and cons of MCTS How it is applied to Super Mario Brothers and Alpha Go 2 Outline I. Pre-MCTS Algorithms

More information

Module 3. Problem Solving using Search- (Two agent) Version 2 CSE IIT, Kharagpur

Module 3. Problem Solving using Search- (Two agent) Version 2 CSE IIT, Kharagpur Module 3 Problem Solving using Search- (Two agent) 3.1 Instructional Objective The students should understand the formulation of multi-agent search and in detail two-agent search. Students should b familiar

More information

Towards Strategic Kriegspiel Play with Opponent Modeling

Towards Strategic Kriegspiel Play with Opponent Modeling Towards Strategic Kriegspiel Play with Opponent Modeling Antonio Del Giudice and Piotr Gmytrasiewicz Department of Computer Science, University of Illinois at Chicago Chicago, IL, 60607-7053, USA E-mail:

More information

CSC 380 Final Presentation. Connect 4 David Alligood, Scott Swiger, Jo Van Voorhis

CSC 380 Final Presentation. Connect 4 David Alligood, Scott Swiger, Jo Van Voorhis CSC 380 Final Presentation Connect 4 David Alligood, Scott Swiger, Jo Van Voorhis Intro Connect 4 is a zero-sum game, which means one party wins everything or both parties win nothing; there is no mutual

More information

Make Your Own Game Tutorial VII: Creating Encounters Part 2

Make Your Own Game Tutorial VII: Creating Encounters Part 2 Aspects of Encounter Balance Despite what you might think, Encounter Balance is not all about difficulty. Difficulty is a portion, but there are many moving parts that you want to take into account when

More information

FOR THE CROWN Sample Play

FOR THE CROWN Sample Play FOR THE CROWN Sample Play v1.0 1 Turn 1 Yellow player FOR THE CROWN Sample Play To begin the game, Yellow player Draws 2 Peons and 3 Guards into his Hand. Order Phase: For his first Order Phase, he cannot

More information

CSE 332: Data Structures and Parallelism Games, Minimax, and Alpha-Beta Pruning. Playing Games. X s Turn. O s Turn. X s Turn.

CSE 332: Data Structures and Parallelism Games, Minimax, and Alpha-Beta Pruning. Playing Games. X s Turn. O s Turn. X s Turn. CSE 332: ata Structures and Parallelism Games, Minimax, and Alpha-Beta Pruning This handout describes the most essential algorithms for game-playing computers. NOTE: These are only partial algorithms:

More information

Monte Carlo based battleship agent

Monte Carlo based battleship agent Monte Carlo based battleship agent Written by: Omer Haber, 313302010; Dror Sharf, 315357319 Introduction The game of battleship is a guessing game for two players which has been around for almost a century.

More information

PROFILE. Jonathan Sherer 9/10/2015 1

PROFILE. Jonathan Sherer 9/10/2015 1 Jonathan Sherer 9/10/2015 1 PROFILE Each model in the game is represented by a profile. The profile is essentially a breakdown of the model s abilities and defines how the model functions in the game.

More information

AI Approaches to Ultimate Tic-Tac-Toe

AI Approaches to Ultimate Tic-Tac-Toe AI Approaches to Ultimate Tic-Tac-Toe Eytan Lifshitz CS Department Hebrew University of Jerusalem, Israel David Tsurel CS Department Hebrew University of Jerusalem, Israel I. INTRODUCTION This report is

More information

CMPUT 396 Tic-Tac-Toe Game

CMPUT 396 Tic-Tac-Toe Game CMPUT 396 Tic-Tac-Toe Game Recall minimax: - For a game tree, we find the root minimax from leaf values - With minimax we can always determine the score and can use a bottom-up approach Why use minimax?

More information

Adversarial Search. Hal Daumé III. Computer Science University of Maryland CS 421: Introduction to Artificial Intelligence 9 Feb 2012

Adversarial Search. Hal Daumé III. Computer Science University of Maryland CS 421: Introduction to Artificial Intelligence 9 Feb 2012 1 Hal Daumé III (me@hal3.name) Adversarial Search Hal Daumé III Computer Science University of Maryland me@hal3.name CS 421: Introduction to Artificial Intelligence 9 Feb 2012 Many slides courtesy of Dan

More information

Heuristics, and what to do if you don t know what to do. Carl Hultquist

Heuristics, and what to do if you don t know what to do. Carl Hultquist Heuristics, and what to do if you don t know what to do Carl Hultquist What is a heuristic? Relating to or using a problem-solving technique in which the most appropriate solution of several found by alternative

More information

Today. Types of Game. Games and Search 1/18/2010. COMP210: Artificial Intelligence. Lecture 10. Game playing

Today. Types of Game. Games and Search 1/18/2010. COMP210: Artificial Intelligence. Lecture 10. Game playing COMP10: Artificial Intelligence Lecture 10. Game playing Trevor Bench-Capon Room 15, Ashton Building Today We will look at how search can be applied to playing games Types of Games Perfect play minimax

More information

CS151 - Assignment 2 Mancala Due: Tuesday March 5 at the beginning of class

CS151 - Assignment 2 Mancala Due: Tuesday March 5 at the beginning of class CS151 - Assignment 2 Mancala Due: Tuesday March 5 at the beginning of class http://www.clubpenguinsaraapril.com/2009/07/mancala-game-in-club-penguin.html The purpose of this assignment is to program some

More information

Local Search. Hill Climbing. Hill Climbing Diagram. Simulated Annealing. Simulated Annealing. Introduction to Artificial Intelligence

Local Search. Hill Climbing. Hill Climbing Diagram. Simulated Annealing. Simulated Annealing. Introduction to Artificial Intelligence Introduction to Artificial Intelligence V22.0472-001 Fall 2009 Lecture 6: Adversarial Search Local Search Queue-based algorithms keep fallback options (backtracking) Local search: improve what you have

More information

5.4 Imperfect, Real-Time Decisions

5.4 Imperfect, Real-Time Decisions 5.4 Imperfect, Real-Time Decisions Searching through the whole (pruned) game tree is too inefficient for any realistic game Moves must be made in a reasonable amount of time One has to cut off the generation

More information

CS221 Project: Final Report Raiden AI Agent

CS221 Project: Final Report Raiden AI Agent CS221 Project: Final Report Raiden AI Agent Lu Bian lbian@stanford.edu Yiran Deng yrdeng@stanford.edu Xuandong Lei xuandong@stanford.edu 1 Introduction Raiden is a classic shooting game where the player

More information

Game Mechanics Minesweeper is a game in which the player must correctly deduce the positions of

Game Mechanics Minesweeper is a game in which the player must correctly deduce the positions of Table of Contents Game Mechanics...2 Game Play...3 Game Strategy...4 Truth...4 Contrapositive... 5 Exhaustion...6 Burnout...8 Game Difficulty... 10 Experiment One... 12 Experiment Two...14 Experiment Three...16

More information

CS 188: Artificial Intelligence Spring 2007

CS 188: Artificial Intelligence Spring 2007 CS 188: Artificial Intelligence Spring 2007 Lecture 7: CSP-II and Adversarial Search 2/6/2007 Srini Narayanan ICSI and UC Berkeley Many slides over the course adapted from Dan Klein, Stuart Russell or

More information

Adversarial Search. Read AIMA Chapter CIS 421/521 - Intro to AI 1

Adversarial Search. Read AIMA Chapter CIS 421/521 - Intro to AI 1 Adversarial Search Read AIMA Chapter 5.2-5.5 CIS 421/521 - Intro to AI 1 Adversarial Search Instructors: Dan Klein and Pieter Abbeel University of California, Berkeley [These slides were created by Dan

More information

Announcements. CS 188: Artificial Intelligence Fall Local Search. Hill Climbing. Simulated Annealing. Hill Climbing Diagram

Announcements. CS 188: Artificial Intelligence Fall Local Search. Hill Climbing. Simulated Annealing. Hill Climbing Diagram CS 188: Artificial Intelligence Fall 2008 Lecture 6: Adversarial Search 9/16/2008 Dan Klein UC Berkeley Many slides over the course adapted from either Stuart Russell or Andrew Moore 1 Announcements Project

More information

CS325 Artificial Intelligence Ch. 5, Games!

CS325 Artificial Intelligence Ch. 5, Games! CS325 Artificial Intelligence Ch. 5, Games! Cengiz Günay, Emory Univ. vs. Spring 2013 Günay Ch. 5, Games! Spring 2013 1 / 19 AI in Games A lot of work is done on it. Why? Günay Ch. 5, Games! Spring 2013

More information

ARTIFICIAL INTELLIGENCE (CS 370D)

ARTIFICIAL INTELLIGENCE (CS 370D) Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) (CHAPTER-5) ADVERSARIAL SEARCH ADVERSARIAL SEARCH Optimal decisions Min algorithm α-β pruning Imperfect,

More information

Reinforcement Learning Agent for Scrolling Shooter Game

Reinforcement Learning Agent for Scrolling Shooter Game Reinforcement Learning Agent for Scrolling Shooter Game Peng Yuan (pengy@stanford.edu) Yangxin Zhong (yangxin@stanford.edu) Zibo Gong (zibo@stanford.edu) 1 Introduction and Task Definition 1.1 Game Agent

More information

Game Tree Search. CSC384: Introduction to Artificial Intelligence. Generalizing Search Problem. General Games. What makes something a game?

Game Tree Search. CSC384: Introduction to Artificial Intelligence. Generalizing Search Problem. General Games. What makes something a game? CSC384: Introduction to Artificial Intelligence Generalizing Search Problem Game Tree Search Chapter 5.1, 5.2, 5.3, 5.6 cover some of the material we cover here. Section 5.6 has an interesting overview

More information

Ar#ficial)Intelligence!!

Ar#ficial)Intelligence!! Introduc*on! Ar#ficial)Intelligence!! Roman Barták Department of Theoretical Computer Science and Mathematical Logic So far we assumed a single-agent environment, but what if there are more agents and

More information

The game of Reversi was invented around 1880 by two. Englishmen, Lewis Waterman and John W. Mollett. It later became

The game of Reversi was invented around 1880 by two. Englishmen, Lewis Waterman and John W. Mollett. It later became Reversi Meng Tran tranm@seas.upenn.edu Faculty Advisor: Dr. Barry Silverman Abstract: The game of Reversi was invented around 1880 by two Englishmen, Lewis Waterman and John W. Mollett. It later became

More information

Adversarial Search: Game Playing. Reading: Chapter

Adversarial Search: Game Playing. Reading: Chapter Adversarial Search: Game Playing Reading: Chapter 6.5-6.8 1 Games and AI Easy to represent, abstract, precise rules One of the first tasks undertaken by AI (since 1950) Better than humans in Othello and

More information

CS 188: Artificial Intelligence

CS 188: Artificial Intelligence CS 188: Artificial Intelligence Adversarial Search Prof. Scott Niekum The University of Texas at Austin [These slides are based on those of Dan Klein and Pieter Abbeel for CS188 Intro to AI at UC Berkeley.

More information

For 2 to 6 players / Ages 10 to adult

For 2 to 6 players / Ages 10 to adult For 2 to 6 players / Ages 10 to adult Rules 1959,1963,1975,1980,1990,1993 Parker Brothers, Division of Tonka Corporation, Beverly, MA 01915. Printed in U.S.A TABLE OF CONTENTS Introduction & Strategy Hints...

More information

Artificial Intelligence Adversarial Search

Artificial Intelligence Adversarial Search Artificial Intelligence Adversarial Search Adversarial Search Adversarial search problems games They occur in multiagent competitive environments There is an opponent we can t control planning again us!

More information

Waiting Times. Lesson1. Unit UNIT 7 PATTERNS IN CHANCE

Waiting Times. Lesson1. Unit UNIT 7 PATTERNS IN CHANCE Lesson1 Waiting Times Monopoly is a board game that can be played by several players. Movement around the board is determined by rolling a pair of dice. Winning is based on a combination of chance and

More information

PVSplit: Parallelizing a Minimax Chess Solver. Adam Kavka. 11 May

PVSplit: Parallelizing a Minimax Chess Solver. Adam Kavka. 11 May PVSplit: Parallelizing a Minimax Chess Solver Adam Kavka 11 May 2015 15-618 Summary In this project I wrote a parallel implementation of the chess minimax search algorithm for multicore systems. I utilized

More information

CSE 573: Artificial Intelligence Autumn 2010

CSE 573: Artificial Intelligence Autumn 2010 CSE 573: Artificial Intelligence Autumn 2010 Lecture 4: Adversarial Search 10/12/2009 Luke Zettlemoyer Based on slides from Dan Klein Many slides over the course adapted from either Stuart Russell or Andrew

More information

Artificial Intelligence for Games

Artificial Intelligence for Games Artificial Intelligence for Games CSC404: Video Game Design Elias Adum Let s talk about AI Artificial Intelligence AI is the field of creating intelligent behaviour in machines. Intelligence understood

More information

MFF UK Prague

MFF UK Prague MFF UK Prague 25.10.2018 Source: https://wall.alphacoders.com/big.php?i=324425 Adapted from: https://wall.alphacoders.com/big.php?i=324425 1996, Deep Blue, IBM AlphaGo, Google, 2015 Source: istan HONDA/AFP/GETTY

More information

For slightly more detailed instructions on how to play, visit:

For slightly more detailed instructions on how to play, visit: Introduction to Artificial Intelligence CS 151 Programming Assignment 2 Mancala!! The purpose of this assignment is to program some of the search algorithms and game playing strategies that we have learned

More information

Introduction to Artificial Intelligence CS 151 Programming Assignment 2 Mancala!! Due (in dropbox) Tuesday, September 23, 9:34am

Introduction to Artificial Intelligence CS 151 Programming Assignment 2 Mancala!! Due (in dropbox) Tuesday, September 23, 9:34am Introduction to Artificial Intelligence CS 151 Programming Assignment 2 Mancala!! Due (in dropbox) Tuesday, September 23, 9:34am The purpose of this assignment is to program some of the search algorithms

More information

CS 440 / ECE 448 Introduction to Artificial Intelligence Spring 2010 Lecture #5

CS 440 / ECE 448 Introduction to Artificial Intelligence Spring 2010 Lecture #5 CS 440 / ECE 448 Introduction to Artificial Intelligence Spring 2010 Lecture #5 Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri Topics Game playing Game trees

More information

CS 188: Artificial Intelligence Fall AI Applications

CS 188: Artificial Intelligence Fall AI Applications CS 188: Artificial Intelligence Fall 2009 Lecture 27: Conclusion 12/3/2009 Dan Klein UC Berkeley AI Applications 2 1 Pacman Contest Challenges: Long term strategy Multiple agents Adversarial utilities

More information

CS 5522: Artificial Intelligence II

CS 5522: Artificial Intelligence II CS 5522: Artificial Intelligence II Adversarial Search Instructor: Alan Ritter Ohio State University [These slides were adapted from CS188 Intro to AI at UC Berkeley. All materials available at http://ai.berkeley.edu.]

More information

Texas hold em Poker AI implementation:

Texas hold em Poker AI implementation: Texas hold em Poker AI implementation: Ander Guerrero Digipen Institute of technology Europe-Bilbao Virgen del Puerto 34, Edificio A 48508 Zierbena, Bizkaia ander.guerrero@digipen.edu This article describes

More information

CS 354R: Computer Game Technology

CS 354R: Computer Game Technology CS 354R: Computer Game Technology Introduction to Game AI Fall 2018 What does the A stand for? 2 What is AI? AI is the control of every non-human entity in a game The other cars in a car game The opponents

More information

AI Agent for Ants vs. SomeBees: Final Report

AI Agent for Ants vs. SomeBees: Final Report CS 221: ARTIFICIAL INTELLIGENCE: PRINCIPLES AND TECHNIQUES 1 AI Agent for Ants vs. SomeBees: Final Report Wanyi Qian, Yundong Zhang, Xiaotong Duan Abstract This project aims to build a real-time game playing

More information

Game Theory. Vincent Kubala

Game Theory. Vincent Kubala Game Theory Vincent Kubala Goals Define game Link games to AI Introduce basic terminology of game theory Overall: give you a new way to think about some problems What Is Game Theory? Field of work involving

More information

WARHAMMER LEGENDARY BATTLES

WARHAMMER LEGENDARY BATTLES WARHAMMER LEGENDARY BATTLES Welcome Most games of Warhammer are two player games between armies with equal points values of anywhere from 500 to 3000 points. However, while games like these are great fun,

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Adversarial Search Instructors: David Suter and Qince Li Course Delivered @ Harbin Institute of Technology [Many slides adapted from those created by Dan Klein and Pieter Abbeel

More information

Buck Rogers Battle For The 25 th Century 1. 4 Turn Phases Complete each phase in order Definitions

Buck Rogers Battle For The 25 th Century 1. 4 Turn Phases Complete each phase in order Definitions Buck Rogers Battle For The 25 th Century 1 OBJECT 1) Control 15 Territorial Zones at the end of any turn 2) Control the last Leader on the board at any time 3) Convince everyone else to surrender 4) Control

More information

Explanation of terms. BRITANNIA II SOLITAIRE RULES by Moritz Eggert Version 1.1, March 15,

Explanation of terms. BRITANNIA II SOLITAIRE RULES by Moritz Eggert Version 1.1, March 15, Britannia II Solitaire Rules page 1 of 12 BRITANNIA II SOLITAIRE RULES by Moritz Eggert Version 1.1, March 15, 2006-03-15 The following rules should enable you to replace any nation on the board by an

More information

Games (adversarial search problems)

Games (adversarial search problems) Mustafa Jarrar: Lecture Notes on Games, Birzeit University, Palestine Fall Semester, 204 Artificial Intelligence Chapter 6 Games (adversarial search problems) Dr. Mustafa Jarrar Sina Institute, University

More information

Making Simple Decisions CS3523 AI for Computer Games The University of Aberdeen

Making Simple Decisions CS3523 AI for Computer Games The University of Aberdeen Making Simple Decisions CS3523 AI for Computer Games The University of Aberdeen Contents Decision making Search and Optimization Decision Trees State Machines Motivating Question How can we program rules

More information

Five-In-Row with Local Evaluation and Beam Search

Five-In-Row with Local Evaluation and Beam Search Five-In-Row with Local Evaluation and Beam Search Jiun-Hung Chen and Adrienne X. Wang jhchen@cs axwang@cs Abstract This report provides a brief overview of the game of five-in-row, also known as Go-Moku,

More information

Comp th February Due: 11:59pm, 25th February 2014

Comp th February Due: 11:59pm, 25th February 2014 HomeWork Assignment 2 Comp 590.133 4th February 2014 Due: 11:59pm, 25th February 2014 Getting Started What to submit: Written parts of assignment and descriptions of the programming part of the assignment

More information

Administrivia. CS 188: Artificial Intelligence Spring Agents and Environments. Today. Vacuum-Cleaner World. A Reflex Vacuum-Cleaner

Administrivia. CS 188: Artificial Intelligence Spring Agents and Environments. Today. Vacuum-Cleaner World. A Reflex Vacuum-Cleaner CS 188: Artificial Intelligence Spring 2006 Lecture 2: Agents 1/19/2006 Administrivia Reminder: Drop-in Python/Unix lab Friday 1-4pm, 275 Soda Hall Optional, but recommended Accommodation issues Project

More information

Game Theory. Vincent Kubala

Game Theory. Vincent Kubala Game Theory Vincent Kubala vkubala@cs.brown.edu Goals efine game Link games to AI Introduce basic terminology of game theory Overall: give you a new way to think about some problems What Is Game Theory?

More information

SUPPOSE that we are planning to send a convoy through

SUPPOSE that we are planning to send a convoy through IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS PART B: CYBERNETICS, VOL. 40, NO. 3, JUNE 2010 623 The Environment Value of an Opponent Model Brett J. Borghetti Abstract We develop an upper bound for

More information

Algorithms for Data Structures: Search for Games. Phillip Smith 27/11/13

Algorithms for Data Structures: Search for Games. Phillip Smith 27/11/13 Algorithms for Data Structures: Search for Games Phillip Smith 27/11/13 Search for Games Following this lecture you should be able to: Understand the search process in games How an AI decides on the best

More information

Creating a Poker Playing Program Using Evolutionary Computation

Creating a Poker Playing Program Using Evolutionary Computation Creating a Poker Playing Program Using Evolutionary Computation Simon Olsen and Rob LeGrand, Ph.D. Abstract Artificial intelligence is a rapidly expanding technology. We are surrounded by technology that

More information

Chapter 7: DESIGN PATTERNS. Hamzah Asyrani Sulaiman

Chapter 7: DESIGN PATTERNS. Hamzah Asyrani Sulaiman Chapter 7: DESIGN PATTERNS Hamzah Asyrani Sulaiman You might have noticed that some diagrams look remarkably similar. For example, we used Figure 7.1 to illustrate a feedback loop in Monopoly, and Figure

More information