If you wanted to tell an AI how to behave using config files, how would you design the config file?
Background
Realistic Spring AIs are primarily rule-based, to minimize resource utilization.
Rule-based AIs are fast, untiring, and can be everywhere at once. The downside is that they must be taught everything, via a set of rules somewhere.
Rule-based AIs can learn, but humans have some advantages for learning, such as communication with others via bulletin boards, chat etc. AIs can carry out statistical analysis more accurately than us, run simulations overnight whilst we're not watching, but ultimately the win or lose of an AI is down to human tweaking.
By making AIs easily configurable by humans, it's possible that they could become more powerful.
Clearly the design of the config file will drive the design of the underlying AI engine.
Note that we could build AI training facilities to generate the config file automatically, eg for different mods, and/or test them.
Some thoughts
An AI should have multiple opening gambits. Ideally, the config file(s) should be able to handle this.
An AI should be flexible to be able to react to what the enemy is doing. Ideally, the config file(s) should be able to handle this.
It's ok to specify specific unit names within the config file. This is precisely the type of information that humans are good at determining and communicating. We could provide self-training methods to the AI. Such methods would provide as a result specific unit types under specific conditions, and record these in the config file.
An example of a config file could be:
Code: Select all
<config>
<unitcategories>
<unitcategory name="groundmelee" comment="these are used for assaults along the ground">
<unittype name="armstump" />
<unittype name="armsam" />
<unittype name="armmav" />
<unittype name="armbulldog" />
<unittype name="armyork" coment="phalanx" />
</unitcategory>
<unitcategory name="level1mobileconstructors" comment="this allows us to use the variable level1mobileconstructors.count in the production rules>
<unittype name="armcom" />
<unittype name="armcv" />
</unitcategory>
</unitcategories>
<buildinggroups comment="this is to group things like laser towers and guardians together">
<group name="defensivestrongpoint" intergroupspacing="1000" comment="we want th>
<unit name="armguardian" quantity="2"
</group>
</buildinggroups>
<productionrules name="basicrules" comment="things to keep us alive">
<when variable="energystorage" type="lessthan" value="1000" comment="if commander dies">
<build priority="10.0" unit="armmstor"/>
</when>
<when variable="metalstorage" type="lessthan" value="1000" comment="if commander dies">
<build priority="10.0" unit="armestor"/>
</when>
<when variable="level1mobileconstructors.count" type="lessthan" value="1">
<build priority="10.0" unit="armcv"/>
</when>
</productionrules>
<productionrules name="level1tankrush">
<build priority="2.2" unit="armstump" quantity="10"/>
<build priority="2.2" unit="armsam" quantity="10"/>
<build priority="2.0" unit="armcv" quantity="1"/>
</productionrules>
<productionrules name="level2tankrush">
... some stuff here to build mobile fusion reactors, bulldogs, farks etc
</productionrules>
<productionrules name="groundtoair">
<build priority="2.2" unit="armsam" quantity="10"/>
<build priority="2.2" unit="armyork" quantity="10"/>
...
</productionrules>
<overallcontrol>
<when type="always">
<useproductionrules name="basicrules"/>
</when>
<when type="equals" variable="currentframecount" value="0">
<probabilitychoice>
<possibility probability="0.7">
<useproductionrules name="level1tankrush"/>
</possibility>
<possibility probability="0.3">
<useproductionrules name="level2tankrush"/>
</possibility>
</probabilitychoice>
<when player="enemy" variable="airgroundattack.percentage" type="morethan" value="30">
<useproductionrules name="groundtoair" />
</when>
</overallcontrol>
</config>
It would be useful to be able to configure attacks:
*squad creations: 2 squads of tanks? 1 giant squad? 1 squad of light tanks, 1 squad of heavy tanks and artillery, and 1 squad of bombers?
*squad tactics and formations. Just bunch everything together? Use an arrowhead formation of tanks with a line of lugers behind?
*tower attack / creeping artillery. It can be very effective to bring up some groundmelee really close to the enemy base, and build a guardian or two just behind them.
Code: Select all
<positions comment="we're going to describe a decent tower attack position here">
<position name="nearenemybase" comment="we specify what we mean by near enemy base">
<conditions>
<distance fromtype="area" from="enemybase" type="lessthan" value="500" comment="areas are defined from mapping"/>
<distance fromtype="unitcategory from="enemydefense" type="morethan" value="300"/>
</conditions>
</position>
</positions>
<attack name="towerattack">
<squads>
<squad name="constructors">
<unitcategory name="constructors" quantity="3"/>
</squad>
<squad name="groundmelee">
<unitcategory name="groundmelee" quantity="10"/>
</squad>
</squads>
<attackformation>
<squadformation distancefrompoint="0" type="line" spacing="30">
<squad name="groundmelee"/>
</squadformation>
<squadformation distancefrompoint="200" type="line" spacing="30">
<squad name="constructors"/>
</squadformation>
</attackformation>
<execution>
<order sequence="1">
<moveto target="nearenemybase" />
</order>
<order sequence="2">
<build unittype="armguardian" quantity="2" />
</order>
</execution>
</attack>