Units.dat: This file will be much like the units.txt file below except it will not
be a text file, and it will include the descriptions.
Units.txt: Now we can start using what we have developed in the tech tree. Units.txt will allow us to define all the unit types in the game and base them off some technology advancement. Lets get into the nitty-gritty.
UnitNumber, UnitName, Until, domain, move, range, attack, defense, health, firepower, cost, holds, role, prereq, flags, unitmodel.
Now thatís a lot of items. Lets describe each one in turn.
UnitNumber: A number that represents the unit. For the computer.
UnitName: The name of the unit type. Pretty obvious.
Until: This tells us when the unit type expires. We canít have knights being produced at the same time as stealth bombers.
Domain: This is used to know what type of unit this is. Is it a flying unit, a walking unit, a water unit. On top of these three types used in civ I think a few more are needed. One type is Anphibious. A walking/water unit. Good for hovercrafts. Another one, rare in most game types, but still might be useful is a tunneling unit, or underground unit.
Move: This is the speed at which the unit moves.
Range: This is used for units that have a range on them. For example, most planes can only fly a certain distance before needing to be refueled.
Attack: This is the attack power of the unit.
Defense: This is the defensive power of the unit.
Health: This is how much damage a unit can take
Firepower: This is how often a unit can attack. Some units are faster than others giving them more chances to attack in one turn.
Cost: This is how expensive a unit is. How much resources or money is needed to buy the unit.
Holds: This is for troop carrying units. Tells how many troops the unit can hold.
Role: This is mainly used for AI. It tells the computer what way to use the unit. Defensive, aggressive, support, etc.
Prereq: This is the prerequsite from the tech tree. This technology needs to be researched before the unit can be used.
Flags: These flags are used to deturmine a bunch of things. The list is long, and I am not going to cover all of them for now, since there is a chance they may change. However this is used for special things a unit can do, like a settler making cities. Also this will include a list of race flags for choosing what races can have this unit. In general this will be a 32 bit list of flags.
UnitModel: This is the model that will be used for the unit. The model will contain all the information for the looks, and animation of the unit.
"Riflemen" 5 0 2 0 4 2 1 2 50 0 0 3 00000000000000000000000000000000 Riflemen.mdl
Basically this says a Rifleman needs tech #3 (our bullet) to be made, and expires in era 5 (probably spaceage). He has 2 movement, 4 attack 2 defense, 1 health and 2 firepower, and costs 50 resources.