Warning: A skin using autodiscovery mechanism, SotS, was found in your skins/ directory. The mechanism will be removed in MediaWiki 1.25 and the skin will no longer be recognized. See https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery for information how to fix this. [Called from Skin::getSkinNames in /home/caste2warsots/public_html/wiki/sots1/includes/Skin.php at line 74] in /home/caste2warsots/public_html/wiki/sots1/includes/debug/Debug.php on line 303
AI -- Modding - SotS

AI -- Modding

From SotS

Most of the AI related files are in \Data\Strategy\AI\:

- aitechgrp.csv: sets how AI catagorizes the weapon techs.

- aitechmode.csv: sets the circumastances under which the AI researches techs.

- aitechpri.csv: sets the AI reserach priorities for every tech.

- affinity_section.csv: sets how AI uses ship sections.

- affinity_weapon.csv: sets how AI uses weapon families.

- weapon_replacements.csv: sets some hard replacements for weapons.


- various data in each .weapon file contributes to AI choices.

aitechmode.csv

This file sets what techs the AI will research when it is in a specific "research mode". The research modes are:


w - weapon

n - engine

e - empire


A research mode is triggered by situational factors, and provides the strategic direction for AI research.

If the AI is attacked a few times or with a large fleet it goes into "weapon" mode, also if it wants to assault a player it goes into this mode.

Empire mode is for empire expansion, like for biological and output techs. This is the default staring mode and is for the AI is not at "war".

Engine I am less sure about but evidence points towards it being related to drive tech, like if the AI wants to increase strat speed and/or range. I currently use this mode for all my drive tree techs.

So in this file you list each tech and put one of the 3 modes after, you can put the tech more than once assigniing it up to all 3 modes. The AI will then consider all the techs listed in the mode when in that mode for research.

aitechgrp.csv

This file sets how the AI chooses techs to counter the use of enemy techs. It is mostly for weapons and combat techs. It groups techs into catagories so the AI knows what type of weapon/defence it will get from researching a specific tech. The groups are:

AITG_NRGWEAP - Energy weapons

AITG_BALWEAP - Ballistic weapons

AITG_BIOWEAP - Biological weapons

AITG_ARMOR - Armours, specifically a ballistic weapon counter.

AITG_SHIELDS - Shields, specifically the MK 1 - 4 line.

AITG_TORPS - Torpedoes

AITG_BEAM - Heavy beams

AITG_WARHEAD - Warhead/missiles


These will guide AI research in terms of counters and exploits. For example, the AI percieves that an enemy is using armour, it will avoid researching AITG_BALWEAP and may look to AITG_NRGWEAP.

aitechpri.csv

This file gives priorities for each race to every tech. The range is from 0 to 255, with the lower being the higher priority but 0 causes the tech to be ignored. You can look at it in the way that the AI consideres all its rolled techs, then screens based on the tech mode, then specific purpose like tech groups then finally these priorities. You can use the same priority for more than one tech at the same time.

These priorites seem to be translated as "chances for rolling to research this tech".

This file seems most influenced by hardcoded values, for example to get the AI to avoid the typical Fusion rush you have to give a very high value to DRV_Fusn, like 200.

So you can "script" AI research in some situations, and provide strong guidelines in most others.

For the above 3 files you need to add any new tech you add to mastertechlist.tech for the AI to consider for research. You will get an error in session.log if the tech in these files does not exist. It is my understanding that putting the vanilla tech names in these files overrides the hardcoded values in an unpredictable way.

affinity_section.csv

This file specifies what the AI will use and consider for its internal coded "purposes". It is fairly simple to understand when looking at the vanilla one but there are a few quirks:

- These "purposes" are used for strategic and tactical behaviour.

- Each "purpose" has a hard limit of 50 as listed in this file, not per race or ship size or whatever.

- You get errors if a section listed here is not available to a race. i.e the section file is not present or in _shipsections.txt.

- The AI will never expand if it does not have a "scout" as listed in this file. This group is used to scout strategically.

- *_cm stands for counter measure and is what the AI will try use to counter the specified techs.

- "planet_attack" is used for actual colony assault, for reducing pop, inf, etc.

- "orbit_def_attack" is used for assaulting the defence platforms.

- "orbit_def" is used for defence platforms but can also be used to get the AI to build system defence fleets.

Any sections not listed in this file will not be built by AI.

affinity_weapon.csv

This file is used to specify what weapon families (as used in .weapon files) will be used to counter enemy techs. It is my understanding that you can use some of the other AI file references as well as the ones in this file for vanilla (no errors at least).

weapon_replacements.csv

This is a final check file used to force the AI to use a weapon after it decides one one already.

The weapon name first will replace the weapon name after.

How the AI chooses weapons

"First it picks the weapon family, then it looks for the weapon that has the highest Dam_Est. If more than one weapon has the same value (or none at all), it will use the one with the highest alphabetical order. It seems there is more leeway when it comes to PD weapons (will randomly pick one unless it's replaced by something else in the weapon replacement file), and weapon without family designation can be picked at random (burster, thumper, tractor beam, grav beam etc). Doesn't seem any other value is considered from the weapon file so far."

Kludgy has mentioned that session.log errors regarding .weapon files (like missing effects) can cause the AI to ignore those weapons.

Personal tools
SotS 2 Codex