Difference between revisions of "Development:AIScripts"
Line 1: | Line 1: | ||
Vega Strike has completely programmable python AI scripts--but often times just editing an XML file with a list of actions at various distances and probabilities is sufficient and quite a bit more performant | Vega Strike has completely programmable python AI scripts--but often times just editing an XML file with a list of actions at various distances and probabilities is sufficient and quite a bit more performant | ||
+ | |||
+ | AI scripts are selected as follows: | ||
+ | the following two excel files in the ai/ folder are consulted | ||
+ | ai/VegaEvents.csv | ||
+ | The VegaEvents file is a table mapping combat_roles of the attacker to roles of his target. Combat roles are stored in the Combat_Role column in units.csv | ||
+ | For instance if my starship is a BOMBER and I am targeting a BASE then vega strike will look in row BOMBER and column BASE and find the beginning of the name of the AI script thus it would be | ||
+ | bomber.* where * might be .agg.xml or .civ.xml depending on the next file: | ||
+ | |||
+ | ai/VegaPersonalities.csv | ||
+ | VegaPersonalities is a list of a factions and what AI scripts they wish to use | ||
+ | Each listed faction is followed by a comma and then by a space separated list of extensions to use on their AI script. | ||
+ | so if bomber was selected from VegaEvents.csv and the faction is merchant which has the second column "scared scared civ" there will be a 1/3 chance that bomber.civ.xml will be selected, otherwise bomber.scared.xml will be selected | ||
+ | |||
+ | if the file is not found bomber.agg.xml will be searched then default.civ.xml then default.agg.xml (I believe .py files are also searched) | ||
+ | |||
+ | |||
+ | Once an XML file is selected, it is parsed every frame to select an AI behavior for the starship to use when attacking its target. |
Revision as of 19:44, 14 August 2008
Vega Strike has completely programmable python AI scripts--but often times just editing an XML file with a list of actions at various distances and probabilities is sufficient and quite a bit more performant
AI scripts are selected as follows: the following two excel files in the ai/ folder are consulted ai/VegaEvents.csv The VegaEvents file is a table mapping combat_roles of the attacker to roles of his target. Combat roles are stored in the Combat_Role column in units.csv For instance if my starship is a BOMBER and I am targeting a BASE then vega strike will look in row BOMBER and column BASE and find the beginning of the name of the AI script thus it would be bomber.* where * might be .agg.xml or .civ.xml depending on the next file:
ai/VegaPersonalities.csv VegaPersonalities is a list of a factions and what AI scripts they wish to use Each listed faction is followed by a comma and then by a space separated list of extensions to use on their AI script. so if bomber was selected from VegaEvents.csv and the faction is merchant which has the second column "scared scared civ" there will be a 1/3 chance that bomber.civ.xml will be selected, otherwise bomber.scared.xml will be selected
if the file is not found bomber.agg.xml will be searched then default.civ.xml then default.agg.xml (I believe .py files are also searched)
Once an XML file is selected, it is parsed every frame to select an AI behavior for the starship to use when attacking its target.