Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
Adrien AllardFlorian BrulhartSebastien Broussaud
Decision making in Endless Space 2
Background
Our Stud io
2011 2012 2013 2014 2015 2016 201712 Dev 20 Dev 30 Dev 40 60 Dev
Our 4X
Explore
Search points of interest
Discover the world
Gather Intel
Expand
Increase territory
Expand to new places
Exploit
Build / research
Gather resources
Optimize economy
Fight in battles
Unit management
War management
Exterminate
Asymmetric factions
Quests
Amplitude touch
Relation with players
Evaluate deals
Diplomacy
Post -mortem: Endless Legend
• Decisions are difficult to control
• AI doesn’t have global strategy
• Diplomatic relations can seem
irrational
Control
• Heuristic results are just numbers
• No access to intermediate
reasons
• Decision process is opaque
Understand Technical
• Code is spread and duplicated
• Code base is not incremental
friendly
• Tools are too complex
Object ives
• High level control
• Low level control
• Handle each resource
differently
For design
• Understand each decision
• Understand resource
allocation
• User friendly
For debugging For programming
• Incremental
• Allow different AI techniques
• Isolate data refining from
decision
MeetE.N.F.E.R.
Process Over v iew
Game
SyncData
Analysis Tasks generation
Tasks allocationExecution
Process Over v iew
Game
Tasks generation
Tasks allocation
Tasksgeneration
S i tuat ion
Des igner needs
Aaah, the Cravers are invading! The AI should definitely defend
its system here!
Goal
Defend system against enemiesDefend System
Des igner needs
Hum ok … but how do you defend the system?
Des igner needs
Details, schmetails… erm... well… you know… it could build
defenses or create ships.
Tasks
Defend system against enemiesDefend System
Create ships
Build defense
Des igner needs
Hum ok … but how does the AI decide which action to
take?
Des igner needs
Well, we're talking about Cravers. Insectoid, psycho, warmachines. We need the best defense against them.
Scor ing
Defend system against enemiesDefend System
Create ships 0.4
Build defense 0.8
Des igner needs
Oh, but I forgot, it's that crappy system we stole from the Lumeris
earlier. The AI shouldn't prioritise it.
Scor ing
Defend system against enemiesDefend System
Create ships 0.4
Build defense 0.8
Scor ing
Defend system against enemiesDefend System 0.5
Create ships 0.4
Build defense 0.8
Scor ing
Defend system against enemiesDefend System 0.5
Create ships
Build defense
0.2
0.4
Des igner needs
And one more thing! If the AI's planning a war against the Cravers in any case, ships should be preferred.
Mult ip le reasons
Defend system against enemiesDefend System 0.5
Create ships 0.2
Build defense 0.4
Mult ip le reasons
Defend system against enemiesDefend System 0.5
Create ships 0.2
Build defense 0.4
Attack Cravers 0.7Improve military power to attack
Mult ip le reasons
Defend system against enemiesDefend System 0.5
Create ships
Build defense 0.4
Attack Cravers 0.7Improve military power to attack
0.5
Mult ip le reasons
Defend system against enemiesDefend System 0.5
Create ships
Build defense 0.4
Attack Cravers 0.7Improve military power to attack
Reduce upkeep 0.9
0.5
Mult ip le reasons
Defend system against enemiesDefend System 0.5
Create ships
Build defense 0.4
Attack Cravers 0.7Improve military power to attack
Reduce upkeep 0.9
0.3
Assoc iated too l
Post -mortem
• Ability to iterate before implementation
• Force separation between each decision step
• Improve decision debugging
• Feedback decision chains
• Understand decision at different granularity
Tasksallocation
Tasks a l locat ion
• Tasks in the game have costs
• Can I afford this task?
• Concurrence between tasks are due to shared resources
Build defense 0.3
Create ships 0.6
Context
80
Tasks a l locat ion
• Tasks in the game have costs
• Can I afford this task?
• Concurrence between tasks are due to shared resources
100
Build defense 0.3
10Create ships 0.6
Context
Tasks a l locat ion
• Use motivation to split resources
• Task motivation must be independent from the cost
• Each resource has its own way of being split
• Handle tasks with multiple resources
Objectives
80
100
Build defense 0.3
10Create ships 0.6
0/10
Tasks a l locat ion
0/80
0/100
Build defense 0.3
Create ships 0.6
0/10
Tasks a l locat ion
0/80
0/100
Build defense 0.3
Create ships 0.6 100
allocator
Stock:
0/10
100/100
Tasks a l locat ion
0/80Build defense 0.3
Create ships 0.6
allocator
Stock: 0
0/10
100/100
Tasks a l locat ion
0/80Build defense 0.3
Create ships 0.6
allocator
Stock: 0
0/10
100/100
Tasks a l locat ion
0/80Build defense 0.3
Create ships 0.6
allocator
Stock: 0
0/10
100/100
Mult ip le resources
0/80Build defense 0.3
Create ships 0.6
0/10
100/100
Mult ip le resources
0/80Build defense 0.3
0
allocator
Stock:
Create ships 0.6
0/10
100/100
Mult ip le resources
0/80Build defense 0.3
0
allocator
Stock:
Create ships 0.6
0/10
100/100
Resource rea l locat ion
0/80Build defense 0.3
Create ships 0.6
0/10
100/100
Resource rea l locat ion
0/80Build defense 0.3
Create ships 0.6 0
allocator
Stock:
0/10
Resource rea l locat ion
0/80
0/100
Build defense 0.3
Create ships 0.6
allocator
Stock: 100
0/10
Resource rea l locat ion
0/80
0/100
Build defense 0.3
Create ships 0.6
allocator
Stock: 100
80/80
0/10
Resource rea l locat ion
0/100
Build defense 0.3
Create ships 0.6
allocator
Stock: 20
80/80
0/10
Val idate tasks for execut ion
0/100
Build defense 0.3
Create ships 0.6
Assoc iated too l
Post -mortem
• Simplify the task generation by removing cost handling
• Handle concurrence between tasks
• Centralize allocation algorithms
• Each resource behaves differently so we can allocate them differently
Uses andimprovements
Where to integrate features
Decision graph
Economy
Diplomatic contracts
Fleet management
Fleet production
Where to integrate features
Diplomacy relations
Analysis Decision graph
Ship/Fleet Design
War topology
Economy
Diplomatic contracts
Fleet management
Fleet production
Where to integrate features
Diplomacy relations
Analysis Decision graph
Ship/Fleet Design
War topology
Economy
Diplomatic contracts
Fleet management
Fleet production
Execution
Fleet behavior
Battle behavior
Dip lomat ic re lat ion behav ior
Empire destroyed our explorer AND We are a military faction
Prepare war
In alliance
Ask for Alliance
Analysis Decision graph
Increase ship number
Dip lomat ic re lat ion behav ior
Empire destroyed our explorer AND We are a military faction
Prepare war
In alliance
Ask for Alliance
Analysis Decision graph
Build alliance contract
Dip lomat ic re lat ion behav ior
Empire destroyed our explorer AND We are a military faction
Prepare war
In alliance
Ask for Alliance
Analysis Decision graph
F leet Management
Defend empire
Defend empire 0.9Defend system
Pegasus0.6
Defend attacked system
A fleet is a resource for military decisions
Taskforce
F leet Management
Defend empire
Defend empire 0.9Defend system
Pegasus0.6
Defend attacked system
A fleet is a resource for military decisions
Advance tasks generat ion
Goals can generate goals
Defend empire
Defend empire 0.9Defend system
Pegasus 0.3Defend attacked system
Advance tasks generat ion
Goals can generate goals
Defend attacked systemDefend constellation Defend constellation
0.5Defend empire
Defend empire 0.9Defend system
Pegasus 0.3
Advance tasks generat ion
Tasks can generate tasks
TaskforceDefend system Pegasus 0.3
Defend attacked systemDefend empire
Defend empire 0.9
Advance tasks generat ion
Tasks can generate tasks
Assist
Escort defensefleet
0.2Taskforce
TaskforceDefend system Pegasus 0.3
Defend attacked systemempire
Defend empire 0.9
1000
1000
Advance tasks generat ion
Link tasks with an allocation rule
Build unique wonderon Pegasus
0.3Build wonder
Build unique wonderon Andromeda
0.6Build wonder
1000
1000
Advance tasks generat ion
Link tasks with an allocation rule
Build unique wonderon Pegasus
0.3Build wonder
Build unique wonderon Andromeda
0.6Build wonder
Only one in empire
1000
1000
Advance tasks generat ion
Link tasks with an allocation rule
Build unique wonderon Pegasus
0.3Build wonder
Build unique wonderon Andromeda
0.6Build wonder
Only one in empire
1000
1000
Advance tasks generat ion
Link tasks with an allocation rule
Build unique wonderon Pegasus
0.3Build wonder
Build unique wonderon Andromeda
0.6Build wonder
Only one in empire
Mult ip le Personal i t ies
We have 8 different factions.
Mult ip le Personal i t ies
And we want to add someflashy, new, exotic gameplay!
Mult ip le Personal i t ies
Sheesh. Alright, we've got this. Wecan add a specific decision branch.
Mult ip le Personal i t ies
And we want somegameplay restrictions!
Mult ip le Personal i t ies
Well then we can cut a specific decision branch.
Mult ip le Personal i t ies
And the personality of the new AI faction must match the lore!
Mult ip le Personal i t ies
In that case we can modifya specific decision branch.
Some numbers
• 90 analysis computations
• 45 types of goal
• 90 types of task
• 300 generators
• 50 types of game action handled
• 70 diplomatic states
• 3 programmers and 2 designers
Summing-Up
• Create a language to talk about AI decision
• Keep it simple
• Ensure modular approach so new content
doesn't break decision system
• Understanding the AI is mandatory
• Emergent behavior must be controlled
• Tools must display a system the way you design it
Thank you