220 likes | 372 Views
Dynamic Task Allocation in a turn based strategy game. Gilles Schtickzelle September 2012 ULB. Problem Statement. Creating an intelligent player for a turn-based strategy game. Working Framework: Many possible challenges to meet: Resource management Adversarial planning Spatial reasoning
E N D
Dynamic Task Allocation in a turn based strategy game Gilles Schtickzelle September 2012 ULB
Problem Statement • Creating an intelligent player for a turn-based strategy game. • Working Framework: • Many possible challenges to meet: • Resource management • Adversarial planning • Spatial reasoning • …
A game of FreeCol • Colonization of America • Establish settlements, grow and develop them • Victory: Declare independence & Beat the Royal Expeditionary Force
Colony Management • Assigning tasks to units for optimal resources production
Division of labor in insect societies • Ants and wasps colonies have efficient distributed task allocation mechanisms through stygmergy. Bonabeau, E., Theraulaz, G., & Deneubourg, J.-L. (1996).
Response Threshold • Ants have probabilistic response to stimuli: • Varying threshold θ induces specialization • Reduces switching costs • Increases individual efficiency
From insects to games • Ants/Wasps Colony • Insects • Tasks • Specialization • FreeCol Colony • Units • Resources • Expert units
Resources Dynamics • Surplus: Extra workers. Shortage: Loseworker. • Freedom. 50% required to win. Gives bonus or penalty to workers. • required to makehammers • Used to produce buildings or artileries • required to maketools • Used to produce buildings or artilleries
Allocation Mechanism • One stimulus Sr for each resource r = • One set of dynamic thresholds θriper unit i
Stimuli and Thresholds • Simple computation rules for each stimulus • One set of dynamic thresholds θruper unit u • GeneticAlgorithm to findappropriatescalefactorsβr
AI goals • Reach the year 1776 with enough bells to be able to declare independence. • Have the best defense possible to resist the attack of the royal expeditionary force. • Allocate workers to • minimize famine • Keep the production modifier as high as possible
Planning approach • Suboptimal allocation: building too early • Two planning methods: • Layered response threshold. • Rule-based planning.
Planning approach • Layered response threshold : • Use two sets of scalefactors: • Optimized for growth • Optimized for production • Rule-based planning :
Planning Results (1) Layered AI Rule-based AI
Planning Results (2) Statistics for 100 gameswith the simple scenario.
Modified Threshold rule • Unit u produces resource r • Unit u does not produces resource r
“State of the art” player • Modified Threshold update rule + rule-based planning
AI goal completion • Reach the year 1776 with enough bells to be able to declare independence. • Have the best defense possible to resist the attack of the royal expeditionary force. • Allocate workers to • minimize famine • Keep the production modifier has high as possible
Conclusions • Human-level performances can emerge from simple rules, without cheating. • Easy to implement (compared to traditional rule-based only AI). • Easy to tune down performances (if playing against non-expert). • Hybrid system (with planning instructions) improves on basic RTM • Tendency to chaos with large number of stimuli • Difficult to extend to other game aspects (combat, spatial reasoning, diplomacy,…).