Presentation is loading. Please wait.

Presentation is loading. Please wait.

Existing and Possible Applications of Artificial Intelligence in Computer Games Ori Liel.

Similar presentations


Presentation on theme: "Existing and Possible Applications of Artificial Intelligence in Computer Games Ori Liel."— Presentation transcript:

1 Existing and Possible Applications of Artificial Intelligence in Computer Games Ori Liel

2 In this lecture A few words about the industry A few words about the industry Current AI technologies applied in games Current AI technologies applied in games “Fuzzy logic” “Fuzzy logic” Soar Quake-bot Soar Quake-bot Interesting projects and possible future applications Interesting projects and possible future applications

3 The computer (and console) game industry Multi-Billion $ industry Multi-Billion $ industry Growing fast Growing fast Main trends: Main trends: –Increasing # of games with multi-player options –Movement towards console games –Emerging trend - increasing investment in AI Graphics and sound can’t make ground-breaking leaps Graphics and sound can’t make ground-breaking leaps More CPU power available: More CPU power available: –Hardware improvements –Graphics cards carry the burden

4 Need for AI – different game geners Action Action  Quake  IGI Covert Strike –Need Formidable opponents –Need good Support characters Adventure & RPG Adventure & RPG  Mist  NeverWinter Nights –Need Believable NPC’s Have beliefs, desires and intentions Have beliefs, desires and intentions Are able to formulate and carry out plans Are able to formulate and carry out plans –New notion: plot management

5 Need for AI – cont’d Strategy Strategy  Civilization 3  WarCraft 3 –Need enemies with ability to plan, react and learn “God-games” “God-games”  SimCity  Populous –Need Believable environments

6 Need for AI – cont’d Why are agents suitable? Why are agents suitable? For all the reasons which were mentioned before: For all the reasons which were mentioned before: –First of all: agents as a natural metaphor –Modularity –Decentralization –Changeability –Open environments

7 Current State of AI in games AI is not taken very seriously (yet…) AI is not taken very seriously (yet…) –Budget goes to graphics –Usually put off until late in development –Not enough expertise in the industry From an industrial point of view AI is a means, not an end. From an industrial point of view AI is a means, not an end.

8 Current AI technologies applied in games

9 Current technology - FSM Finite State Machines: Finite State Machines: –States & transformation rules –Agent behavior: deterministic deterministic reactive reactive –Can be improved by adding intelligent-looking scripted behavior

10 Current technology – Flocking Flocking algorithms Flocking algorithms –Simulate realistic movement in a group –Based on studies of flocks of birds, and schools of fish –Essence of algorithms: Maintain a minimum distance from other agents Maintain a minimum distance from other agents Move towards center of mass Move towards center of mass Keep your alignment similar to other agents’ Keep your alignment similar to other agents’ “follow the leader” flocking

11 Current technology – others Pursuit-evasion algorithms Pursuit-evasion algorithms –AI character in pursuit –AI character escaping Path-finding - A* algorithm Path-finding - A* algorithm –Used by units to find their way around in the environment

12 “Fuzzy” logic (And it’s application in game AI)

13 Fuzzy logic Development of fuzzy logic: Development of fuzzy logic: –Plato said it first: there is something between ‘true’ and ‘false’ –Since then Three-valued logic [-1, 0, 1] Three-valued logic [-1, 0, 1] N-valued logic N-valued logic Finally, infinite-valued logic Finally, infinite-valued logic

14 Fuzzy logic – cont’d The idea: The idea: –the universe is made of fuzzy sets. “The fuzzy set of old people” “The fuzzy set of old people” “The fuzzy set of red objects” “The fuzzy set of red objects” –and a membership function ‘m’ m: STATEMENT  VALUE

15 Fuzzy logic – cont’d An example: An example: –Jane is 70 years old. Is Jane old? Depends on who you’re asking. –Assume that membership in ‘old’ is defined as follows: mOLD(x) = {1 (if age(x)>100) } mOLD(x) = {1 (if age(x)>100) } {0.01*age(x) otherwise) } {0.01*age(x) otherwise) }

16 Fuzzy logic – cont’d According to this definition: According to this definition: mOLD(Jane) = 0.7 mOLD(Jane) = 0.7 –Question: What does this mean? What does this mean? –Answer: Jane’s degree of membership within the set of old people is 0.7 Jane’s degree of membership within the set of old people is 0.7 –Not to be confused with probabilistic approach

17 Fuzzy logic – cont’d Basic definitions (A and B are sets): Basic definitions (A and B are sets):  A is EMPTY  for all x, mA(x) = 0.0  A = B  for all x: mA(x) = mB(x)  A’ : for all x: m(x)A' = 1 – m(x)A  A is CONTAINED in B  for all x: mA(x) <= mB(x)  C = A ۷ B  mC(x) = MAX(mA(x), mB(x))  C = A ۸ B  mC(x) = MIN(mA(x), mB(x))

18 Fuzzy logic – cont’d Examples of last two definitions: Examples of last two definitions: –mOLD(Jane) = 0.7 –mSMART(Jane) = 0.6 –What is the degree of membership of Jane in the ‘old- or-smart’ set? m[OLD ۷ SMART](Jane) = 0.7 m[OLD ۷ SMART](Jane) = 0.7 –What is the degree of membership of Jane in the ‘old- and-smart’ set? m[OLD ۸ SMART](Jane) = 0.6 m[OLD ۸ SMART](Jane) = 0.6

19 Fuzzy logic – applications Fuzzy-logic introduces a random element into decision-making Fuzzy-logic introduces a random element into decision-making –Opponent’s personalities in Civilization 3 are defined in this way: m[aggressive] (Japan) = 0.7 m[aggressive] (Japan) = 0.7 m[scientific](Japan) = 0.4 m[scientific](Japan) = 0.4 m[expansionistic](Japan) = 0.6 m[expansionistic](Japan) = 0.6 –A probabilistic function uses these values (among others) to determine Japan’s next move, depending on Japan’s present state.

20 ALLIED treaty = 0.8 assist = 0.8 COOPERATIVE treaty = 0.4 assist = 0.2 Neutral treaty = 0.1 attack = 0.1 assist = 0.05 AGGRESIVE attack = 0.6 ceasefire = 0.3 peace = 0.8 HOSTILE attack = 0.95 ceasefire = 0.05 goodwill > 30 or gain > -50 gain >10 goodwill > < goodwill < 45 or gain > 60 goodwill 90 goodwill < 85 goodwill < 65 goodwill > 65 goodwill < 65 goodwill > 85 Probabilistic Fuzzy-State machine

21 The ‘Soar’ Quake-bot

22 Quake II Quake II – a first person shooter Quake II – a first person shooter –The Quake II environment Levels: sets of rooms and passages Levels: sets of rooms and passages Weapons: from knife to RPG Weapons: from knife to RPG Power-ups Power-ups –Quake II Death-Match

23 Quake II - mods ‘mods’ are modified versions of existing games ‘mods’ are modified versions of existing games New game-play features New game-play features Altered laws of physics, changes to environment Altered laws of physics, changes to environment Improved (or at least different) AI Improved (or at least different) AI –Can be created by company or by players. –In Quake II, id software released some source code, and mods were created by players –Favorite use of code: The creation of “Quake-bots” for death-matches.

24 Quake II - Quake-bots Status of the targets: targetIn rangevisibleIn front AYesNoYes B No CYes DNoN/A EYesNo Bots simulate human perception

25 The ‘Soar’ Quake-Bot The Soar bot’s decision cycle: The Soar bot’s decision cycle:

26 ‘Soar’ Quake-Bot – cont’d Evaluation, proposal and operator selection take into account: Evaluation, proposal and operator selection take into account: Internal state Internal state –Health level –Current weapon –Knowledge of map Some pre-defined ordering among operators, which is unique to the version of the robot. Some pre-defined ordering among operators, which is unique to the version of the robot.

27 ‘Soar’ Quake-Bot – cont’d Operator application Operator application –Operators can be: primitive actions (move, shoot) primitive actions (move, shoot) internal actions (remember location) internal actions (remember location) abstract actions (collect power-ups) abstract actions (collect power-ups) –If an abstract operator has been selected, it is immediately regarded as a goal

28 Get item Goto next room Get item in room Detect item missing Face itemMove to item Stop moving to item Go through door Go to door Align with door Face door Move to door Record at door Slide to door Stop move to door Stop slide to door Collect-Powerups Choose-best-item

29 Get item Goto next room Get item in room Detect item missing Face itemMove to item Stop moving to item Go through door Go to door Align with door Face door Move to door Record at door Slide to door Stop move to door Stop slide to door Collect-Powerups Choose-best-item

30 Get item Goto next room Get item in room Detect item missing Face itemMove to item Stop moving to item Go through door Go to door Align with door Face door Move to door Record at door Slide to door Stop move to door Stop slide to door Collect-Powerups Choose-best-item

31 Get item Goto next room Get item in room Detect item missing Face itemMove to item Stop moving to item Go through door Go to door Align with door Face door Move to door Record at door Slide to door Stop move to door Stop slide to door Collect-Powerups Choose-best-item

32 Get item Goto next room Get item in room Detect item missing Face itemMove to item Stop moving to item Go through door Go to door Align with door Face door Move to door Record at door Slide to door Stop move to door Stop slide to door Collect-Powerups Choose-best-item

33 Get item Goto next room Get item in room Detect item missing Face itemMove to item Stop moving to item Go through door Go to door Align with door Face door Move to door Record at door Slide to door Stop move to door Stop slide to door Collect-Powerups Choose-best-item

34 Get item Goto next room Get item in room Detect item missing Face itemMove to item Stop moving to item Go through door Go to door Align with door Face door Move to door Record at door Slide to door Stop move to door Stop slide to door Collect-Powerups Choose-best-item

35 Get item Goto next room Get item in room Detect item missing Face itemMove to item Stop moving to item Go through door Go to door Align with door Face door Move to door Record at door Slide to door Stop move to door Stop slide to door Collect-Powerups Choose-best-item

36 Get item Goto next room Get item in room Detect item missing Face itemMove to item Stop moving to item Go through door Go to door Align with door Face door Move to door Record at door Slide to door Stop move to door Stop slide to door Collect-Powerups Choose-best-item

37 Get item Goto next room Get item in room Detect item missing Face itemMove to item Stop moving to item Go through door Go to door Align with door Face door Move to door Record at door Slide to door Stop move to door Stop slide to door Collect-Powerups Choose-best-item

38 Get item Goto next room Get item in room Detect item missing Face itemMove to item Stop moving to item Go through door Go to door Align with door Face door Move to door Record at door Slide to door Stop move to door Stop slide to door Collect-Powerups Choose-best-item

39 ‘Soar’ Quake-Bot – Anticipation Robot anticipates player’s moves by: Robot anticipates player’s moves by: –Forming an internal model of player Player status Player status –Health –Weapon level Player’s beliefs (current perception of the world) Player’s beliefs (current perception of the world) –Projecting its own behavior on player

40 ‘Soar’ Quake-Bot – Anticipation (cont’d) Why should anticipation be used? Why should anticipation be used? –Ambush –Hunt (pursuit-evasion) –Deny power-ups When should anticipation be used? When should anticipation be used? –Not all the time Requires lots of CPU for reasoning. Requires lots of CPU for reasoning. May interfere with regular mechanisms May interfere with regular mechanisms –Should be used when Sensing enemy (some knowledge of enemy state) Sensing enemy (some knowledge of enemy state) Enemy is far away and not facing the bot Enemy is far away and not facing the bot

41 ?

42

43 His Distance: 1 My Distance: 1

44 His Distance: 2 My Distance: 2

45 His Distance: 2 My Distance: 2

46 His Distance: 3 My Distance: 1 (but hall)

47 His Distance: 4 My Distance: 0 Ambush!

48

49 * Bot remembers successful sequences successful sequences (learning) (learning)

50 Other interesting projects

51 “Haunt 2” Situation: player is a ghost-like energy creature trapped in a house Situation: player is a ghost-like energy creature trapped in a house Goal: escape Goal: escape Problem: player is severely limited in manipulating the environment Problem: player is severely limited in manipulating the environment Game-play: get house residents (AI characters) to do things for you by: Game-play: get house residents (AI characters) to do things for you by: –frightening –enticing –cajoling –Threatening Game-play entirely based on interaction with AI characters!

52 “Haunt 2” – cont’d AI characters must have: AI characters must have: –Personality –Goals and motivations –Very believable reactions to environment Example of AI characters: Example of AI characters: –Evil scientist Driven by desire to capture ghost Driven by desire to capture ghost Personality: Immune to fear, can’t stand cold Personality: Immune to fear, can’t stand cold –Lost hitchhiker Driven by curiosity Driven by curiosity Personality: Easily frightened, physically strong Personality: Easily frightened, physically strong

53 Cyphesis Idea: characters in virtual worlds alive, all NPCs have ambitions Idea: characters in virtual worlds alive, all NPCs have ambitions Between multi-player and single-player Between multi-player and single-player Scripting and planning in use Scripting and planning in use A thought: how to make it computationally feasible? A thought: how to make it computationally feasible?

54 Kemal Enver’s project A variation of capture the flag with tank fights A variation of capture the flag with tank fights –A* path-finding –Reactive behavior –Communication between agents

55 Idea for a game Set in a fantasy D&D-like environment Set in a fantasy D&D-like environment (As in Cyphesis) World full of self-interested NPCs. (As in Cyphesis) World full of self-interested NPCs. (As in “Haunt 2”) AI cooperation is very important (As in “Haunt 2”) AI cooperation is very important Achieve cooperation by: Achieve cooperation by: –Negotiation –Threats –Building trust and friendship

56 Idea for a project Simplified case of last idea Simplified case of last idea Setting: a zoo Setting: a zoo –Paths –Cages –Obstacles –Exits –Items: tranquilizer gun, riding horse, security passes Agents: Agents: –Players (BDI, communication skills) –Animals (reactive, subsumption architecture or FSM) –Guards?

57 Idea for a project – cont’d Game-play: Game-play: –Zoo is set randomly –Missions are assigned randomly Release Tiger into the wild Release Tiger into the wild Move animal Bear from cage ‘a’ to cage ‘b’ Move animal Bear from cage ‘a’ to cage ‘b’ Keep at least ‘n’ animals in their cages (maintenance task) Keep at least ‘n’ animals in their cages (maintenance task) Protect the Monkey at all costs! Protect the Monkey at all costs! Agents have goals  agents have tasks. So game can be seen as task-oriented domain Agents have goals  agents have tasks. So game can be seen as task-oriented domain –Players don’t know about each other’s missions (an opportunity to incorporate learning!) –Run simulation and see how fast, if at all, human player completes task.

58


Download ppt "Existing and Possible Applications of Artificial Intelligence in Computer Games Ori Liel."

Similar presentations


Ads by Google