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 Dave Switeck within the Anniihilation Factory site.

I've also made available the text from the AI Tweaking Guide by David Sellick.

The ai text files use very simple commands to tell the ai what it can and cannot build. Most such 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 almost always (except in the case of a few 3rd party units) tell which side the unit is made by - either ARM or COR. And the total length of the unit abbrieviation is 8 letters.

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                                                      

Blah blah blah

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 level 3 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. 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.0001ARMH

Core has had ample time to establish itself on Hydross. Using available new technology, establish a base and clear the sector of Core units. You will begin your search for the contingent Core Commander from here.

&Y*PRIORITY CRITICAL*&

Our scientists have developed new units and adapted others to this world. Core will have adapted as well. Prepare your defenses quickly.

INFO FEED

Because of the nearness to the system's sun, the polar ice caps have not formed on Hydross. The planet has no landmasses. You will have to construct your base entirely of water-based units. &RPay attention to your metal economy.&

There is an indigenous life-form known as the Serpent. They will hamper our efforts to remove Core from Hydross. The Serpents must be destroyed as well.

To complete this mission you must destroy all Core units and Serpents.

END

Within a mission briefing file, the following have special meaning:

Text delimited by "&Y" and "&" are displayed in bold.
Text delimited by "&R" and "&" are displayed blinking.

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.