Plangenerierungsverfahren und Strategieerkennung am

Plan generation processes and strategy
detection on the example of a Real-Time
Strategy Game
Advisors:
Thorsten Maier
Peter Kaczmarczyk
xaitment GmbH, Quierschied
Games!
RTS Games
• Different factions
• Own tech-tree, buildings, units
• Macromanagement vs. Micromanagement
• Mixture economy - military
• Highly dynamic world
• Imperfect information
You won the match!
Solutions?!?
• Higher difficulty
– More cheating
• Resources (gold, units)
• Information (map, enemy)
• Make enemies more efficient
– Better algorithms
– More complex AI
Requirements of a better AI
•
•
•
•
Fast
Reliable
Adapts to changes
Follows a strategy
Strategy as planned build path
• Start: current state
• End: all buildings build
Planning techniques
• STRIPS
– Used since 1971
– Full environmental information needed
– Operator changes state
– Goal reached after transformations
-> Search-based architecture
Planning techniques
• STRIPS
Planning techniques
Planning techniques
Planning techniques
• 8 possible directions
• Maps with 200 fields
8²⁰⁰ different states
• Usually >100 units
not computable in real-time
use of other techniques
Current work
Brickman and Joshi
‚HTN Planning and Games State Management in
Warcraft II‘
• Different Layers
– Reduces search space
– Layers interchangeable
Current work
Brickman and Joshi
‚HTN Planning and Games State Management in
Warcraft II‘
• High level
• Low level
harvest gold
train worker
harvest lumber
train worker
harvest gold
train peon
…
; harvest resources
(:operator
; head(!harvest ?res_type)
; pre((unit peon free))
; delete list((unit peon free))
; add list((unit peon harvest
?res_type))
)
Current work
Santiago Ontañón et al.
‚Learning from demonstration and case-based
planning for real-time strategy games‘
Current work
• Goal:
– Programming bot
– Different ways of planning
• HTN
• Case-based reasoning
– No recognition of enemy strategy done
– Enemy strategy a plan too!
• Same prerequisites
• Same outcome
Master questions
• Enemy strategy detection by
– Using hierarchical interpretation?
– Using knowledge of old games?
– Using possible goals?
• Drawbacks
– Continuous dynamic data
– Imperfect information
Software
• xaitKnow/xaitThink
• BWAPI
xaitKnow/xaitThink
• Ontologies
• Relationships
• Rules
– Abstract
– Concrete
xaitKnow/xaitThink
if exists Builder(Builder1) and
exists Resource(Resource1) and
exists BuildingHuman(Building1) and
exists canBuild(BuilderBuilding) suchthat
{
BuilderBuilding.Source == Builder and
Building1.Name == "Refinery" and
Builder1.Actions == isIdle and
Resource1.AmountCrystal >= getCCosts(Building1.Name) and
Resource1.AmountGas >= getGCosts(Building1.Name)
}
then
build(Building1.Name);
xaitKnow/xaitThink
• Annotate game traces with strategy rules
if (builders.amount == 6)
and (buildings.amount == 3)
and (techLevel == 1)
and (Race == “Zerg”)
then fireStrategy(“6Hatchery used”);
xaitKnow/xaitThink
• Predict enemy strategy
if (builders.amount <= 6)
and (buildings.amount <= 3)
and (techLevel.max <= 1)
and (Race.enemy == “Zerg”)
then fireEnemyStrategy(“6Hatchery used”);
then fireCounterStrategy(“EarlyDefence”);
 or
then create EnemyStrategy(“6Hatchery”);
xaitKnow/xaitThink
• HTN planning
High-level:
If exists enemyStrategy(eStrategy) suchthat
{ eStrategy.Name == “Rush” }
Then create playerStrategy(pStrategy);
pStrategy.Name = “Defensive”;
Low-Level:
If(Strategie.Name == “Defensive”)
then create Prerequisite(p1);
…
BWAPI
• C++, open-source coding
• Midware-Tool
• Connects Game and AI
– Script
– Executable
BWAPI
StarCraft
process
communicates
BWAPI
process
exposes
executes
AIModule
Launcher
implements
StarCraft Bot
xaitmentTools
Wrapper
Proxy
implements
communicates
StarCraft Bot
xaitmentTools
StarCraft Bot
xaitmentTools
Summary
• RTS Games characteristics
– Highly dynamic
– Imperfect information environment
– Too complex for traditional search-based planning
systems
bad AI enemies
Summary
• Use of different systems
– Determine strategy of enemy
• Imperfect information
– View as player
• Perfect information
– View as spectator
– Generate counter-strategy
• Predefined rules and heuristics
• Case-based database