TXT

Last updated: 11/10/98 23:27

A variety of TXT files are present within the TA Unit and Map structure.

AI Text Information

A good deal of this information came from an AI Tutorial article by Switeck (I have no idea if this email address is still used) within the Anniihilation Factory site.

Also available is the text from the AI Tweaking Guide by Switeck.

The ai text files use very simple commands to tell the ai what it can and cannot build. Most of the commands only affect 1 specific unit, but there are a few universal values that can be used to affect groups of similar units or units all on one side. Sadly, the universal values aren't as useful as they might seem.

Units are refered to by abbreviations made by Cavedog or 3rd party unitmakers. Within these web pages, this is what has been called the "short name" for the unit. The abbreviation's first 3 letters are almost always ARM or COR (except in the case of a few 3rd party units), and correspond to which side the unit is built by.

First, an example from the original totala1.hpi's ai/default.txt file:

// This is a comment line

weight cormakr 0.25

weight armmakr 0.2
weight armrl 1.25
weight corrl 1.25
weight cormoho 1.5
weight armmoho 1.5
limit special 10

plan easy
limit constr 3
limit plant 3
limit level2 10
limit level3 2

plan medium
limit constr 6
limit plant 5

Explanations:

Command and Format Description Example
limit [unitname] # Limits the AI to the creation of "#" units, where "unitname" is the short name of the unit you are limited, such as ARMMAKR for the ARM Metal Maker. Limit ARMMAKR 0
limit [category name] # In addition to limiting specific units, you can limit the construction of groups of units based on category. A unit is placed into a category in the unit's FBI file. limit plant 3
limit special 10
limit level2 10
limit level3 2
weight [unitname] [value] The Weight command increases or decreases the probability that a certain unit will be built at any given time. The value specified can be a value between 0.05 and 255 (?), and is a multiplier increasing the odds that a unit will be built. If not specified, the default weight for any particular unit is 1. Weight ARMFLASH 9
plan [difficulty level] All information within an AI text file pertains to all difficulty levels. Information following a "plan" line pertains to AI rules that will be followed for the specified difficulty level (easy, medium, or hard). plan easy

I've still discovered a couple tricks with weights and limits to make it LOOK like the ai has some simple "do not build till later" units. If something is weighted VERY low (I.E. Weight ARMGUARD 0.05) then that item will most likely only get built if the construction units/buildings have nothing else they are allowed to build. So when all the resources are finished, THEN my ai is allowed to build guardians which are very expensive metal-wise.

Weights seem to work better when placed at the top of the ai profile. Since the ai profile is read from top to bottom. If 2 commands change the same thing then the TOP command would be the one the game uses.

All this is not enough information to make a good ai, however. That is best done by trial and error.

Campaign Briefs Text Information

Each mission in a campaign has a mission briefing in which the scenario and objectives are revealed. This is shown immediately before beginning a mission, and is typically accompanied by the James-Earl-Jones-Wannabe voice-over.

Campaign briefings are placed in a TXT file within the camps/briefs subdirectory, and is given the same filename as the accompanying "useonly" TDF file in the useonly sibling directory under camps. It is a simple text file with no special formatting, as in the following example from the ARM Core Contingency mission 1 briefing:

MISSION 1.0001ARME
Establish a guard detail around the Galactic Gate.

&Y*PRIORITY CRITICAL*&
Core agents have somehow breached our security and are on Empyrrean. Worse yet, the Commander is off-planet and Core waits in ambush near the Gate through which he must return. Take your units to the Gate and secure it. Our Commander must return safely or we are lost.

INFO FEED
The Gate is located in the Crater to the north. &RExpect Core patrols.&

END

Certain "words" can be used to change the display type of a section of the text. They are used similarily to html codes, and have two "characters". The first designates the start and style of the formatting, and the second designates the end of the formatting. The following two "words" have special meaning:

Both tags create blinking text, but in different colors. The color depends on the empire:

Docs Text Information

The docs subdirectory typically contains miscellaneous documentation for units, maps, missions, etc. Although not required, this is a good place to put your own information and comments about a map, mission, or unit that you have created.

As an example, here is a piece of the TXT file from the Core Thunderbolt:

CORE THUNDERBOLT - UNIT DESCRIPTION
The Thunderbolt is a powerful floating defensive unit with
medium range and medium armor. It works best when targeting
enemy sea units and nearby land units. The Thunderbolt has no
defense against submarine attacks so it is susceptible to
torpedoes. It requires 558 metal and 5812 energy.

In general, it is a good idea to include information such as who you are, what the unit is called, what it does, when you'd want to use it, where can it be built, and what does it cost to build the unit.

Note: When ZIPping your final UFO file to be distributed to your friends (and enemies!), the UFO file should be shipped along with a separate copy of the TXT description file from the docs directory. This file should be copied into the C:\CAVEDOG\TOTALA\DOCS directory (or wherever their Total Annihilation was installed) as part of your installation procedure as a simple courtesy to remind users what your unit is and what it does.