XE8 BUILDTREE DOCUMENTATION
AI.TDF
[AI]
{
datapath=AI;
}
AI.tdf is located in the main spring directory, and controls how NTai loads its data. The default folder to load from is "AI". Be careful as if the folder specified does not exist then NTai will not do anything, also make sure it is case sensitive, especially on non-microsoft operating systems.
The AI folder
The AI fodler holds a lot of information that is used by NTai. I'll start off by listing the folders NTai uses.
Learn
In the learn folder, NTai write learning data in TDF files. These can be of use as they contain the unit name, the human unit name seen in game and the tool tip within the comments.
XE8 comes with a batch of pre-created learning files for numerous mods.
Log/Logs
In the logs folder NTai outputs any logs it may need in text file format. Html output is an option but it's disabled internally and leads to large log files. Every instance fo NTai will have its own log file whose filename includes the mod, date, and the team NTai was part of.
It's important to read logs should NTai crash or you're in the process of constructing a build tree.
Mexdata
This folder holds cached data from the mex placement algorithm. This data is identical in format to any output from OTAI, and both can be interchanged freely.
As many as 30 maps have pre-calculated caches bundled witht eh NTai download to rpevent slowdown.
Default
This is the default build tree. It is composed entirely of universal build tags such as B_MEX or B_GLOBAL, and is the data loaded if the mod being played doesnt have custom data of its own. This folder takes the same formata s other mod data fodlers.
DTBuildData
This folder contains more cached data for DT rings. This data is identical to that generated by OTAI too
MexDebug
NTai will output debug data so that the mex algorithms efficiency can be determined (and I have something to prove to krogothe that his algorithm isn't working).
ThreatDebug
When you type .threat in game NTai will output it's threat matrixes as a set of TGA images. They will be outputted to this directory.
Output
NTai will not directly use this directory, however the UnitDef output GroupAI will output data to this folder in the format output//modname// etc
Mod data folders
The name of these folders is by default the name of the mod archive loaded. Thus when loading a copy of AA it will load from the name of the variant and not the main data file because that is the file where mod_info.tdf is contained.
However, there is an override. A mod may have the following in their mod_inf.tdf
[NTAI]
{
tdfpath=xxxx;
}
which will force NTai to laod from the folder xxxx instead of the modname. This convention is used in EE/AA/XTA/Nanoblobz.
What's stored inside Mod Data folders?
Mod data folders contain 2 things. The first is a file called mod.tdf, the second is a set of text files which are the task queues of every builder/factory unit in that mod. All these text files have lowercase filenames in order to keep better Linux compatibility. However this shouldn't affect windows, as the file loading in windows is case insensitive.
Data text files
These take the following forms depending on what is contained within mod.tdf.
commander.txt
builder.txt
factory.txt
global.txt
*unitname*.txt
Which files are loaded depends on settings in mod.tdf., however this section is more about what's contained within those files.
Data within these files consists of values separated by commas. These represent the task list the unit will follow. For example if in XTA the file armcom.txt (the unit name of the Am Commander is ARMCOM)contains "ARMMEX, ARMMEX, ARMSOLAR, ARMLAB" then when NTai starts a game of XTA as Arm, then it will order the Arm commander to build 2mex, a solar, and a kbot lab.
So Starting from the beginning it is a list of what NTai will build, but it's not just that, you can also tell it what it will do. There are keywords that extend and modify this queue. For example B_RESURECT/B_RESSURECT will make the unit issue an area resurrect command if there are wreckages nearby, and B_RANDMOVE will make a unit move away in a random direction. There are also modifiers that change how the list is treated. For example once the list has been executed, by default it's reloaded, however you can specify that it doesn't get reloaded.
Also it is possible to take advantage of unit learning and universal build routines using keywords. for example you could replace ARMMEX in the above example with B_MEX and NTai will auto detect and pick the correct build option.
Should NTai come across a value while loading that isn't a unit name or a keyword, then it'll skip over it and display a message in the logs.
universal build routines are as follows:
B_MEX
B_POWER_
B_ESTORE
B_MSTORE
B_SILO
B_DEFENCE
B_DEFENSE
B_PLASMA_REPULSOR
B_PLASMA_REPULSER
B_FORTIFICATION
B_SONAR
B_RADAR
B_TARG
B_MINE
B_FACTORY
B_FACTORY_CHEAP
B_ASSAULT
B_RANDASSAULT
B_RANDOM
B_MISSILE_UNIT
B_BOMBER
B_CARRIER
B_SCOUT
B_RESSURECT/B_RESURECT
B_RANDMOVE
There may be more that I cant exactly remember off of the top of my head
There're also keywords such as repeat and no_repeat and is_factory that change how a units task list is handled, there're also keywords that affect how the AI works, such as turning on and off GAIA mode or affecting the attack agent.
Global.txt
This file is always loaded, and is loaded into a global task list that gets reloaded when it's empty. When a unit comes across a B_GLOBAL task it will start at the beginning of this list and continue until ti finds the first task it is capable of doing.
It is to be noted that you should not use faction specific words in this file otherwise the list will never get emptied and B_GLOBAL will become useless in the middle o the game. Use unit names of building available to all factions, universal build routines, or use meta tags. You can see an example of meta tags for this in lindirs XTA build tree in XE8.
B_GLOBAL will only work in XE8
XE8 specific mod.tdf tags
singlebuild=;
solobuild=;
energyIncome=;
metalIncome=;
energyStorage=; // might be Stored not Storage
metalStorage=; // might be Stored not Storage
Tags that've changed in XE8
random_efficiency=;
No longer used in XE8!!!!!! Use only if you wish to support XE7/7.5 All meta tag stuff is now based on efficiency
Scouters=;
Attackers=;
If dynamic selection is turned on, the routines will first search through these tags then apply the detection algorithms. This means you can adjust for where the algorithms fail to detect scouts and attackers correctly, or if you wish to override.
Other mod.tdf tags
dynamic_selection=;
hardtarget=;
cheap_multiplier=;
metatags=;
abstract=;
message=;
author=;
version=;
MetaTags
I'll do an example on how to define a meta tag. For more examples see lindirs XTA build tree which defines a several.
[AI]
{
metatags=B_LVL1LAB,B_NEWTAGS2;
}
[TAGS]
{
B_LVL1LAB=armlab,corlab;
B_NEWTAG2=unitname,unitname;
}
And the metatag can then be used just like any other unitname or universal build routine tag in task list