FIT CTU
Adam Vesecký
vesecky.adam@gmail.com
Lecture 10
Game AI
Doom 1 (1993)
Age of Empires (1997)
Half-life (1998)
Starcraft (1998)
Unreal Tournament (1999)
Quake III (1999)
Halo 2 (2004)
F.E.A.R. (2005)
XCOM: Enemy Unknown (2012)
ARMA 3 (2013)
The Last Of Us (2013)
DOTA 2 (2013)
Starcraft II (2013)
Game AI features and limits
Game AI properties
1 | // Doom 2: find player to chase |
2 | void A_Look (mobj_t* actor) { |
3 | mobj_t* targ; |
4 | actor->threshold = 0; // any shot will wake up |
5 | targ = actor->subsector->sector->soundtarget; |
6 | if (actor->flags & MF_AMBUSH){ |
7 | if (P_CheckSight (actor, actor->target)) |
8 | goto seeyou; |
9 | } else goto seeyou; |
10 | |
11 | if (!P_LookForPlayers (actor, false)) return; |
12 | // go into chase state |
13 | seeyou: |
14 | P_ChasePlayer(); |
15 | } |
State | Transition | Condition |
---|---|---|
Wander the maze | Chase pacman | Pacman spotted |
Wander the maze | Flee Pacman | PowerPellet eaten |
Chase Pacman | Wander the maze | Pacman lost |
Chase Pacman | Flee Pacman | PowerPellet eaten |
Flee Pacman | Return to Base | Eaten by Pacman |
Flee Pacman | Wander the maze | PowerPellet expired |
Return to Base | Wander the maze | Central base reached |
Node Type | Success | Failure | Running |
---|---|---|---|
Selector | If one child succeeds | If all children fail | If one child is running |
Sequence | If all children succeed | If one child fails | If one child is running |
Decorator | It depends | It depends | It depends |
Parallel | If N children succeed | If M-N children succeed | If all children are running |
Action | When completed | Upon an error | During completion |
Condition | If true | If false | Never |
Selector
Sequence
Decorator
Parallel node
Condition
Action
Blackboard
Soldier | Assassin | Rat |
---|---|---|
Attack | Attack | Animate |
AttackCrouch | InspectDisturbance | Idle |
SuppressionFire | LookAtDisturbance | GotoNode |
FlushOutWithGrenade | AttackMeleeUncloaked | |
AttackFromCover | TraverseBlockedDoor | |
BlindFireFromCover | AttackFromAmbush | |
ReloadCovered | AttackLungeUncloaked |
Partial observations of the game state
PathZilla AI
trAIns
AdmiralAI
NoCAB
Triangulation
Min spanning tree
Shortest path tree
Planning graph
Final road network
Planning
Supervised learning
Unsupervised learning
Reinforcement learning
Algorithms
Models
Monte-Carlo tree search
MarI/O
DeepMind 2014
Main idea
Steps
Main elements
Other features
Resource Control
Tech tree
Build order (opening)
Fog of war
Micromanagement
Tactics
Strategy
Rule | Condition | Command | Freq [ms] |
---|---|---|---|
AiRuleWorkerHarvest | Worker stopped | Order worker to harvest | 2 000 |
AiRuleRefreshHarvester | Worker reassigned | 20 000 | |
AiRuleScoutPatrol | Base is stable | Send scout patrol | 10 000 |
AiRuleRepair | Building Damaged | Repair | 10 000 |
AiRuleReturnBase | Stopped unit | Order return to base | 5 000 |
AiRuleMassiveAttack | Enough soldiers | Order massive attack | 1 000 |
AiRuleAddTasks | Tasks empty | Add tasks | 5 000 |
AiRuleBuildOneFarm | Not enough farms | Build farm | 10 000 |
AiRuleResourceProducer | Not enough resources | Build resource producer | 5 000 |
AiRuleProduce | Performing prod. task | 2 000 | |
AiRuleBuild | Performing build task | 2 000 | |
AiRuleUpgrade | Performing upg. task | 30 000 | |
AiRuleUnBlock | Blocked units | Move surrounding units | 3 000 |