Title: Existing and Possible Applications of Artificial Intelligence in Computer Games
1Existing and Possible Applications of Artificial
Intelligence in Computer Games
Ori Liel
2In this lecture
- A few words about the industry
- Current AI technologies applied in games
- Fuzzy logic
- Soar Quake-bot
- Interesting projects and possible future
applications
3The computer (and console) game industry
- Multi-Billion industry
- Growing fast
- Main trends
- Increasing of games with multi-player options
- Movement towards console games
- Emerging trend - increasing investment in AI
- Graphics and sound cant make ground-breaking
leaps - More CPU power available
- Hardware improvements
- Graphics cards carry the burden
4Need for AI different game geners
- Action
- Quake
- IGI Covert Strike
- Need Formidable opponents
- Need good Support characters
- Adventure RPG
- Mist
- NeverWinter Nights
- Need Believable NPCs
- Have beliefs, desires and intentions
- Are able to formulate and carry out plans
- New notion plot management
5Need for AI contd
- Strategy
- Civilization 3
- WarCraft 3
- Need enemies with ability to plan, react and
learn - God-games
- SimCity
- Populous
- Need Believable environments
6Need for AI contd
- Why are agents suitable?
- For all the reasons which were mentioned before
- First of all agents as a natural metaphor
- Modularity
- Decentralization
- Changeability
- Open environments
7Current State of AI in games
- 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.
8Current AI technologies applied in games
9Current technology - FSM
- Finite State Machines
- States transformation rules
- Agent behavior
- deterministic
- reactive
- Can be improved by adding intelligent-looking
scripted behavior
10Current technology Flocking
- 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
- Move towards center of mass
- Keep your alignment similar to other agents
follow the leader flocking
11Current technology others
- Pursuit-evasion algorithms
- AI character in pursuit
- AI character escaping
- Path-finding - A algorithm
- Used by units to find their way around in the
environment
12Fuzzy logic
- (And its application in game AI)
13Fuzzy logic
- Development of fuzzy logic
- Plato said it first there is something between
true and false - Since then
- Three-valued logic -1, 0, 1
- N-valued logic
- Finally, infinite-valued logic
14Fuzzy logic contd
- The idea
- the universe is made of fuzzy sets.
- The fuzzy set of old people
- The fuzzy set of red objects
- and a membership function m
- m STATEMENT ? VALUE
15Fuzzy logic contd
- An example
- Jane is 70 years old. Is Jane old? Depends on who
youre asking. - Assume that membership in old is defined as
follows - mOLD(x) 1 (if age(x)gt100)
- 0.01age(x) otherwise)
16Fuzzy logic contd
- According to this definition
- mOLD(Jane) 0.7
- Question
- What does this mean?
- Answer
- Janes degree of membership within the set of old
people is 0.7 - Not to be confused with probabilistic approach
17Fuzzy logic contd
- 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) lt mB(x)
- C A ? B ? mC(x) MAX(mA(x), mB(x))
- C A ? B ? mC(x) MIN(mA(x), mB(x))
18Fuzzy logic contd
- 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? - mOLD ? SMART(Jane) 0.7
- What is the degree of membership of Jane in the
old-and-smart set? - mOLD ? SMART(Jane) 0.6
-
19Fuzzy logic applications
- Fuzzy-logic introduces a random element into
decision-making - Opponents personalities in Civilization 3 are
defined in this way - maggressive (Japan) 0.7
- mscientific(Japan) 0.4
- mexpansionistic(Japan) 0.6
- A probabilistic function uses these values (among
others) to determine Japans next move, depending
on Japans present state.
20Probabilistic Fuzzy-State machine
goodwill lt 85
ALLIED treaty 0.8 assist 0.8
COOPERATIVE treaty 0.4 assist 0.2
goodwill gt 85
goodwill lt 65
goodwill gt 65
goodwill lt 65
Neutral treaty 0.1 attack 0.1 assist 0.05
goodwill gt 85
30 lt goodwill lt 45 or gain gt 60
goodwill lt 50 and gain gt 90
goodwill gt 45
AGGRESIVE attack 0.6 ceasefire 0.3 peace
0.8
HOSTILE attack 0.95 ceasefire 0.05
goodwill gt 30 or gain gt -50
gain gt10
21The Soar Quake-bot
22Quake II
- Quake II a first person shooter
- The Quake II environment
- Levels sets of rooms and passages
- Weapons from knife to RPG
- Power-ups
- Quake II Death-Match
23Quake II - mods
- mods are modified versions of existing games
- New game-play features
- Altered laws of physics, changes to environment
- 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.
24Quake II - Quake-bots
Bots simulate human perception
Status of the targets Status of the targets Status of the targets Status of the targets
target In range visible In front
A Yes No Yes
B Yes No No
C Yes Yes Yes
D No N/A N/A
E Yes No No
25The Soar Quake-Bot
- The Soar bots decision cycle
26Soar Quake-Bot contd
- Evaluation, proposal and operator selection take
into account - Internal state
- Health level
- Current weapon
- Knowledge of map
- Some pre-defined ordering among operators, which
is unique to the version of the robot.
27Soar Quake-Bot contd
- Operator application
- Operators can be
- primitive actions (move, shoot)
- internal actions (remember location)
- abstract actions (collect power-ups)
- If an abstract operator has been selected, it is
immediately regarded as a goal
28Collect-Powerups
Get item
Choose-best-item
Goto next room
Get item in room
Detect item missing
Face item
Move 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
29Collect-Powerups
Get item
Choose-best-item
Goto next room
Get item in room
Detect item missing
Face item
Move 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
30Collect-Powerups
Get item
Choose-best-item
Goto next room
Get item in room
Detect item missing
Face item
Move 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
31Collect-Powerups
Get item
Choose-best-item
Goto next room
Get item in room
Detect item missing
Face item
Move 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
32Collect-Powerups
Get item
Choose-best-item
Goto next room
Get item in room
Detect item missing
Face item
Move 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
33Collect-Powerups
Get item
Choose-best-item
Goto next room
Get item in room
Detect item missing
Face item
Move 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
34Collect-Powerups
Get item
Choose-best-item
Goto next room
Get item in room
Detect item missing
Face item
Move 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
35Collect-Powerups
Get item
Choose-best-item
Goto next room
Get item in room
Detect item missing
Face item
Move 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
36Collect-Powerups
Get item
Choose-best-item
Goto next room
Get item in room
Detect item missing
Face item
Move 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
37Collect-Powerups
Get item
Choose-best-item
Goto next room
Get item in room
Detect item missing
Face item
Move 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
38Collect-Powerups
Get item
Choose-best-item
Goto next room
Get item in room
Detect item missing
Face item
Move 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
39Soar Quake-Bot Anticipation
- Robot anticipates players moves by
- Forming an internal model of player
- Player status
- Health
- Weapon level
- Players beliefs (current perception of the
world) - Projecting its own behavior on player
40Soar Quake-Bot Anticipation (contd)
- Why should anticipation be used?
- Ambush
- Hunt (pursuit-evasion)
- Deny power-ups
- When should anticipation be used?
- Not all the time
- Requires lots of CPU for reasoning.
- May interfere with regular mechanisms
- Should be used when
- Sensing enemy (some knowledge of enemy state)
- Enemy is far away and not facing the bot
41?
42(No Transcript)
43His Distance 1 My Distance 1
44His Distance 2 My Distance 2
45His Distance 2 My Distance 2
46His Distance 3 My Distance 1 (but hall)
47His Distance 4 My Distance 0 Ambush!
48(No Transcript)
49 Bot remembers successful sequences
(learning)
50Other interesting projects
51Haunt 2 http//winter.eecs.umich.edu/haunt/overv
iew.html
- Situation player is a ghost-like energy creature
trapped in a house - Goal escape
- Problem player is severely limited in
manipulating the environment - 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!
52Haunt 2 contd
- AI characters must have
- Personality
- Goals and motivations
- Very believable reactions to environment
- Example of AI characters
- Evil scientist
- Driven by desire to capture ghost
- Personality Immune to fear, cant stand cold
- Lost hitchhiker
- Driven by curiosity
- Personality Easily frightened, physically strong
53Cyphesis http//www.worldforge.org/wf/dev/eng/serv
ers/cyphesis
- Idea characters in virtual worlds alive, all
NPCs have ambitions - Between multi-player and single-player
- Scripting and planning in use
- A thought how to make it computationally
feasible?
54Kemal Envers project http//www.multiagent.tk
- A variation of capture the flag with tank fights
- A path-finding
- Reactive behavior
- Communication between agents
55Idea for a game
- Set in a fantasy DD-like environment
- (As in Cyphesis) World full of self-interested
NPCs. - (As in Haunt 2) AI cooperation is very
important - Achieve cooperation by
- Negotiation
- Threats
- Building trust and friendship
56Idea for a project
- Simplified case of last idea
- Setting a zoo
- Paths
- Cages
- Obstacles
- Exits
- Items tranquilizer gun, riding horse, security
passes - Agents
- Players (BDI, communication skills)
- Animals (reactive, subsumption architecture or
FSM) - Guards?
57Idea for a project contd
- Game-play
- Zoo is set randomly
- Missions are assigned randomly
- Release Tiger into the wild
- Move animal Bear from cage a to cage b
- Keep at least n animals in their cages
(maintenance task) - Protect the Monkey at all costs!
- Agents have goals ? agents have tasks. So game
can be seen as task-oriented domain - Players dont know about each others missions
(an opportunity to incorporate learning!) - Run simulation and see how fast, if at all, human
player completes task.
58(No Transcript)