ai week 8 2 player games l.
Skip this Video
Loading SlideShow in 5 Seconds..
AI – Week 8 2 Player Games PowerPoint Presentation
Download Presentation
AI – Week 8 2 Player Games

Loading in 2 Seconds...

play fullscreen
1 / 12

AI – Week 8 2 Player Games - PowerPoint PPT Presentation

  • Uploaded on

AI – Week 8 2 Player Games. Lee McCluskey, room 2/09 Email Games and Leisure applications. Computer games and virtual worlds tend to be more appealing if

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'AI – Week 8 2 Player Games' - Sharon_Dale

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
ai week 8 2 player games

AI – Week 82 Player Games

Lee McCluskey, room 2/09


games and leisure applications
Games and Leisure applications

Computer games and virtual worlds tend to be more appealing if

  • they are realistic: their virtual world appears to embody the physical laws of the natural world, eg gravity, lighting.
    • achieved by good graphics
  • they are believable: human characters’ behaviour resemble human behaviour, NPC’s are rational
    • achieved by good AI

Eg South Park, Wallace and Grommet, Donald Duck are “believable” animations but not very realistic! People recognise and empathise with characters through the narrative … rather than through their physical characteristics

AI techniques can be embedded in opponents, other characters, or the environment to make the game more believable.

reactive intelligence
Reactive “intelligence”

Most current games with virtual environments use programmed behaviour via reactive condition-action rules to mimic intelligence











(eg real world)

reactive intelligence4
Reactive “intelligence”

Representation of NPCs tends to be done using FSM

More sophisticated (eg SIMS) – each character represented as a Frame (object) with qualities, needs, etc

Transitions choice random to give the appearance of unexpected behaviour


Detect enemy

Low energy


Detect enemy

Search for food


ai predictive deliberative goal directed
AI – predictive, deliberative, goal directed
  • We could automated planning to help characters in virtual environments. They could be given goals, and it would be up to them to plan to meet them.

However, if the game is adversarial and tightly coupled, planning on its own would be useless!

  • In adversarial, tightly coupled, turn-based games (chess, draughts, connect-4, card games, strategy games..) AI techniques have been well- developed to enable computer move generation.
ai in turn based 2 player games
AI in Turn-Based, 2-player Games


  • Take one turn each
  • World state is knowable / calculable
  • Players will always try the ‘best’ move
  • A world state can be evaluated to decide if it is better than another

World state = game state (eg board situation)

Action = move pieces

Goal = win game, or maximise gains

AI move generating program = search tree of possible

future board situations and look for the most

Promising move

search in 2 player games game tree
Search in 2-player games: Game Tree

A “game tree” is a tree where

  • nodes are “boards” (game situations)
  • uni-directional arcs are “moves” connecting one board to another, and alternative arc layers of the tree represent alternative player’s moves
  • the route node is the initial board
  • Each node can be given a value with respect to one of the players, depending how good the board situation is for that player
  • depth of the tree is sometimes called its “ply”.
search in 2 player games minimax
Search in 2-player games: Minimax


  • Using breadth first search create a “game tree” to a certain depth n (n-ply)
  • Start at the leaves and evaluate each board.
  • Find the min or max of each board set depending on who is making the move, and attach this value to the node directly about the leaves.
  • Continue till the root is reached
  • Make the move which maximises the values of the nodes connecting the root
minimax with alpha beta pruning
Minimax with alpha/beta pruning

Minimax + alpha/beta pruning is an admissible heuristic:

it SAVES RESOURCE but always gives the SAME, optimal answer as mini-max

Minimax with alpha/beta

Change STEP 3:

  • Find the min or max of each board set depending on who is making the move, and attach this value to the node directly about the leaves.

IF continuing to evaluate nodes is useless, then stop. This happens if

  • AT A MAX layer: we find a node with higher value than one already found in the layer above
  • AT A MIN layer: we find a node with a lower value than one already found in the layer above
other heuristics
Other Heuristics
  • The minimax has problems if the search is stopped when “there is a lot going on”. If the evaluation function only evaluates piece values, then the minimax can suffer from the Horizon effect: a board is evaluated to be good when in fact the next move proves disasterous.

Heuristic: grow the tree when boards are in a state of “flux”. Do not grow boards that are “quiet”.

  • Minimax with alpha-beta pruning is still very resource hungry for games like chess.

Heuristic: at each ply, evaluate the boards FIRST, sort them into order, and search only the ones that are the highest/lowest value (depending on whether it is a max or min ply)

other types of games
Other types of Games
  • N-Player: There are N-player versions of minimax, but these have to have assumptions about the other player built in (eg that the other players do not ‘gang-up’ on one). These can be used in Poker etc
  • Imperfect Information: Some Games (esp card games) players have imperfect world knowledge. In these cases the player/computer can use n-person minimax but has the added complication of using probabilities / constraints to evaluate opposing player’s ‘hands’
  • Games that Learn – using AI Games techniques the “deliberation” aspect can be used to support learning by experience.
  • AI Gaming is characterized by goal directed behaviour, deliberation and reasoning. Search and state evaluation are used to implement these.