CS 680: GAME AI
WEEK 2: REAL-TIME STRATEGY GAMES
1/23/2012 Santiago Ontañón santi@cs.drexel.edu https://www.cs.drexel.edu/~santi/teaching/2012/CS680/intro.html
CS 680: GAME AI WEEK 2: REAL-TIME STRATEGY GAMES 1/23/2012 - - PowerPoint PPT Presentation
CS 680: GAME AI WEEK 2: REAL-TIME STRATEGY GAMES 1/23/2012 Santiago Ontan santi@cs.drexel.edu https://www.cs.drexel.edu/~santi/teaching/2012/CS680/intro.html Outline Student Presentation: Artificial Stupidity: The Art of
1/23/2012 Santiago Ontañón santi@cs.drexel.edu https://www.cs.drexel.edu/~santi/teaching/2012/CS680/intro.html
“Artificial Stupidity: The Art of Intentional Mistakes”
“Expressive AI: Games and Artificial Intelligence”
“Artificial Stupidity: The Art of Intentional Mistakes”
“Expressive AI: Games and Artificial Intelligence”
(strategy)
to stop and think with calm
reconnaissance, etc.)
“Artificial Stupidity: The Art of Intentional Mistakes”
“Expressive AI: Games and Artificial Intelligence”
they are quite similar
simple and expandable architecture for RTS AI.
used:
subproblems (pathfinding, construction, etc.)
Perception Strategy Give Orders Execute Orders Analyze Game State: Extract Useful Information High-level Strategy: Army composition, priorities Middle level tasks: Base building, research, etc. Auxiliary and Individual unit control: Pathfinding Building placement, etc.
Perception Strategy Give Orders Execute Orders Unit Analysis Map Analysis Strategy Economy Logistics Attack Unit AI Building Placer Pathfinder Unit AI Unit AI Arbiter
Perception Strategy Give Orders Execute Orders Unit Analysis Map Analysis Strategy Economy Logistics Attack Unit AI Building Placer Pathfinder Unit AI Unit AI Arbiter
two points A and B
CPU
Perception Strategy Give Orders Execute Orders Unit Analysis Map Analysis Strategy Economy Logistics Attack Unit AI Building Placer Pathfinder Unit AI Unit AI Arbiter
buildings
preferences (close to resources, close to enemy, etc.)
search, or influence maps
Perception Strategy Give Orders Execute Orders Unit Analysis Map Analysis Strategy Economy Logistics Attack Unit AI Building Placer Pathfinder Unit AI Unit AI Arbiter
game will have special code to execute its actions (movement, attack, etc.)
machine
Perception Strategy Give Orders Execute Orders Unit Analysis Map Analysis Strategy Economy Logistics Attack Unit AI Building Placer Pathfinder Unit AI Unit AI Arbiter
enough resources
strategy
based
Perception Strategy Give Orders Execute Orders Unit Analysis Map Analysis Strategy Economy Logistics Attack Unit AI Building Placer Pathfinder Unit AI Unit AI Arbiter
between units, e.g.: creating unit A requires unit B. If Economy wants A, Logistics will detect that A is needed and create it.
Perception Strategy Give Orders Execute Orders Unit Analysis Map Analysis Strategy Economy Logistics Attack Unit AI Building Placer Pathfinder Unit AI Unit AI Arbiter
strategy, trains units, selects targets and sends units to attack
modules: exploration, defense, research, diplomacy
Perception Strategy Execution Execute Orders Unit Analysis Map Analysis Strategy Economy Logistics Attack Unit AI Building Placer Pathfinder Unit AI Unit AI Arbiter
execute actions. This module makes sure there are no conflicts (e.g. two modules wanting to control the same unit)
requests with preferences, Arbiter chooses the order of execution
Perception Strategy Execution Execute Orders Unit Analysis Map Analysis Strategy Economy Logistics Attack Unit AI Building Placer Pathfinder Unit AI Unit AI Arbiter
lower modules (e.g. %of economy to be spent in attacking, types of units to use)
machine, or rule-based
Perception Strategy Execution Execute Orders Unit Analysis Map Analysis Strategy Economy Logistics Attack Unit AI Building Placer Pathfinder Unit AI Unit AI Arbiter
about units the rest of modules might need (idea is to do it only once, so other modules do not need to be recomputing information again and again)
Perception Strategy Give Orders Execute Orders Unit Analysis Map Analysis Strategy Economy Logistics Attack Unit AI Building Placer Pathfinder Unit AI Unit AI Arbiter
about the map other modules might need:
points, resource locations, etc.
Perception Strategy Give Orders Execute Orders Unit Analysis Map Analysis Strategy Economy Logistics Attack Unit AI Building Placer Pathfinder Unit AI Unit AI Arbiter
compute all of the above
After training 4 footmen Resource spending: 80% Economy, 20% Military 2 workers wood 1 worker metal Army Composition: 100% footmen Resource spending: 20% Economy, 80% Military 2 workers wood 4 workers metal Army Composition: 100% knights Army Composition: 50% knights 50% archers If enemy has Flying units If enemy has no more flying units
send an idle worker to gather gold.
logistics module):
Perception Strategy Give Orders Execute Orders Unit Analysis Map Analysis Strategy Economy Logistics Attack Unit AI Building Placer Pathfinder Unit AI Unit AI Arbiter
logistics module):
module sends the request to build an archer, it ensures there is a lumber mill first (otherwise, it creates a request to build one)
certain actions
dependencies are enforced.
worry about this. If the attack module wants an archer, it simply requests one, and this module does all what is necessary to get one
resources to be spent in different areas)
modules)
have enough resources, and that there are no conflicts (basically sorting)
R1 executes before R2
R1 R2 R3 R4 Request list
point
Can be improved with preferences:
Perception Strategy Give Orders Execute Orders Unit Analysis Map Analysis Strategy Economy Logistics Attack Unit AI Building Placer Pathfinder Unit AI Unit AI Arbiter
“Artificial Stupidity: The Art of Intentional Mistakes”
“Expressive AI: Games and Artificial Intelligence”
closest chokepoint
enemy from the player, defend the chokepoint”
Example: Potential Field Friendly troops have a positive influence Enemy troops have a negative influence
can shoot the enemy are positive
enemy can hit us are negative
enemy can damage our units
how much damage the enemy can do to us in that cell
level above
Game Perception Action Perception Action
“Artificial Stupidity: The Art of Intentional Mistakes”
“Expressive AI: Games and Artificial Intelligence”
bots_stats.php
expert human (Oriol Vinyals)
“Artificial Stupidity: The Art of Intentional Mistakes”
“Expressive AI: Games and Artificial Intelligence”