Presentation is loading. Please wait.

Presentation is loading. Please wait.

Game AI versus AI: An Introduction to AI Game Programming Héctor Muñoz-Avila.

Similar presentations


Presentation on theme: "Game AI versus AI: An Introduction to AI Game Programming Héctor Muñoz-Avila."— Presentation transcript:

1 Game AI versus AI: An Introduction to AI Game Programming Héctor Muñoz-Avila

2 Some Interesting Facts About the Game Industry As of 2004, the game industry is at least as large (measured in terms of revenue) as the movie (Hollywood) industry As of 2007, the video game sector remains one of the above-average growth segments of the U.S. and global entertainment industries Video game sales remains strong today. As an example, sales of the latest World of Warcraft expansion (November/2010) outpaced previous expansions

3 AI vs Game AI We need to understand the connections and the misconceptions from both sides AI research A C B ABC AC B C B A B A C B A C BC A C A B A C B B C A AB C A B C A B C Game AI as game practitioners implemented it

4 Game AI Do you know what is attack Kung-Fu style? http://www.youtube.com/watch?v=q1yId7Ug2Mg

5 Half-Life: Gordon Freeman’s First Encounter with the Marines Do they attack Kung-Fu style?

6 Half-Life Kung-Fu Attack http://www.youtube.com/watch?v=dKNGRuXVa4U http://www.youtube.com/watch?v=dKNGRuXVa4U Actually no more than 2 marines are attacking at any time The other marines take cover, move around etc. When one of the attacking marines run out of ammo, is wounded, dies, etc., one of the others take his place Some reactions are hard-coded and scenario-dependent

7 Game AI Term refers to the algorithms controlling: –The computer-controlled units/opponents –Gaming conditions (e.g., weather) –Path finding Attack Kung-Fu style is an example of game AI for the computer opponent Programming intentional mistakes is also part of controlling the computer opponent “AI”

8 Programming “Good” AI Opponent (according to Lars Liden; Ch. 2; AIWS1) Enemies move before firing Make mob/enemy visible Announce enemy presence by sound or other means http://www.youtube.com/watch?v=vL8YfqyU4Fo&feature=related

9 Programming “Good” AI Opponent (II) (according to Lars Liden; Ch. 2) Have horrible aim (rather than doing less damage) Miss the first time Warn the player (e.g., music, sound) Kung-Fu attacks

10 Some AI Topics Search Planning Game theory Machine learning Case-based reasoning Robotics Computer vision Neural networks Some of which have been applied in commercial computer games

11 Using AI in Games (1) Path finding for our units using heuristic search (1)  Deliberative Planning of objectives with automated planning What-if analysis to counter the opponent using game theory (2) Our units avoid repeating mistakes by using machine learning and case- based reasoning (3) (2) (3)

12 Memory Capacity

13 The Power of Game Computing and Its Consequences Every year, computers are made with more and more memory This makes for bigger and bigger maps in games Much effort must be spent on pathfinding which could be better utilized elsewhere The amount of memory gained goes into the bigger maps and unfortunately a lot of it must be spent on navigation

14 Pathfinding Frequently games use a collection of nodes (“waypoints”) and edges connecting those nodes Algorithms are devised that find a path through the waypoints for two given nodes Challenges arise when there are too many waypoints  Divide and Conquer the map

15 Area Based Path Look Up Tables: A Hierarchical Example

16 Game Theory Idea: Build a tree describing all possible gaming moves between two opponents Analyze tree looking ahead N moves into the “horizon” and select best move Well understood: Nash equilibrium Challenge: game tree can be too large  Parallelism & heuristics: Deep Blue  Abstract states: Poki-Poker Restrictions: perfect information and deterministic outcomes

17 Cutting Off Search When to cutoff minimax expansion? Potential problem with cutting off search: Horizon problem Solution:  Fixed depth limit  Iterative deepening until times runs out  Decision made by opponent is damaging but cannot be “seen” because of cutoff  Quiescent: states that are unlikely to exhibit wild swings in the values of the evaluation functions

18 Evaluation Function –Is an estimate of the actual utility –Typically represented as a linear function: EF(state) = w 1 f 1 (state) + w 2 f 2 (state) + … + w n f n (state) –Example: Chess weight: Piece  Number  (w 1 ) Pawn  1  (w 2 ) Knight  3  (w 3 ) Bishop  3  (w 4 ) Rook  5  (w 5 ) Queen  9 Function; state  Number  f 1 = #(pawns,w)  #(pawns,b)  f 2 = #(knight,w)  #(knight,b)  f 3 = #(bishop,w)  #(bishop,b)  f 4 = #(rook,w)  #(rook,b)  f 5 = #(knight,w)  #(knight,b)

19 Example: Horizon Problem “all things been equal” White moves, Who is winning? Is this consistent with Evaluation function? Black No!

20 Machine Learning: An Example A number of fixed domination locations. When a team member steps into one of these locations, the status of the location changes to be under the control of his/her team. The team gets a point for every five seconds that each domination location remains under the control of that team. The game is won by the first team that gets a pre-specified amount of points. We used Unreal Tournament© a team-based FPSUnreal Tournament

21 The RETALIATE Algorithm Uses Reinforcement Learning: Agents learn behavior policies through rewards and punishments Policy - Determines what action to take from a given state Agent’s goal is to maximize some reward Can be shown to converge to optimal policy (sort of equilibrium)

22 Before/After Policies Before After

23 AI in Commercial Games Automated Planning Machine Learning Reasoning with Uncertainty

24 Interested? CSE 348 AI Game Programming CSE 42 Principles of Computer Game Design CSE 327 AI Theory and Practice Research:  Independent Studies (undergraduates): 30+  MS Thesis: 10  PhD Dissertations: 5


Download ppt "Game AI versus AI: An Introduction to AI Game Programming Héctor Muñoz-Avila."

Similar presentations


Ads by Google