In RoRd, the "command" is stored all on one line as a set of 59 bytes per command. It seems to control which effects are activated depending on which units are targeted.
I have discovered that the format used in the command line is actually the same format as units.txt in AoK/SWGB GeniEd and is what StSB77 calls the "Unit Abilities" in AGE.
The alpha version of Age of Empires (that Litude sent me) also comes with extracted data from the DAT. The tr_obj.txt from that alpha includes all of the unit data, and in it, the commands each contain 29 values.
Note: All of the names in the C structure were either made up my me or came from AGE, and are not the official names.
C struct:
That is not a mistake, flag_5 is actually a short. All shorts are -1 when unused, except for the unused_s and flag_5, which are 0. All floats and bytes are 0 when unused. A flag means that it can hold either 0 or 1.
Perl template:
The Perl template can be used with Perl's pack and unpack functions.
About the values:
one
Must be one. Setting it to 0 makes the game crash when loading a scenario or the Scenario Builder.
id
The id number of the specific command, counting from 0 until command_count-1.
attr
The type of command (attack, heal, garrison, etc.).
Example: 5 is used for Fishing Boats and Fishermen
class
Use this command only on units of this class.
Example: 9 and 10 for Hunters are prey and predator animals, respectively
Example: Transports are class 20, used for garrison ability
unit
Use this command only on this specific unit.
Example: 50 for the Farmer is the Unit ID of the Farm
res_in
The civ header resource the unit takes in. Usually the same as the actual civ header resource. For food, depends on the type of food. For trading, uses the Trade Goods resource.
Example: 9 is Trade Goods, 15 is meat, 16 is berries and grain (farm), 17 is fish
res_out
The civ header resource the res_in is converted into. In AoE, used only for food and trade. If res_in is the same as res_out, res_out is unused and set to -1.
Example: 0 is Food, seehere
graphics
Transforms unit graphics unto this while command is in effect.
Example: the Hunter's 685 471 472 92 -1 -1
graphics[0]
Graphic used when walking with tool, but carrying no resources. (chopping tree, hunting, etc.)
graphics[1]
Graphic used when proceeding to gather a resource. (chopping tree, hunting, etc.) Also used for the running Lion.
graphics[2]
Graphic used when actually gathering a resource. (getting meat, foraging, mining, etc.) Also used for converting Priests and grazing Gazelles (considered an "attack").
graphics[3]
Graphic used when carrying a resource. (carrying meat, fish, gold, grain, etc.)
graphics[4]
graphics[5]
Unknown graphics. Both are always -1.
I have discovered that the format used in the command line is actually the same format as units.txt in AoK/SWGB GeniEd and is what StSB77 calls the "Unit Abilities" in AGE.
The alpha version of Age of Empires (that Litude sent me) also comes with extracted data from the DAT. The tr_obj.txt from that alpha includes all of the unit data, and in it, the commands each contain 29 values.
Note: All of the names in the C structure were either made up my me or came from AGE, and are not the official names.
C struct:
struct aoe_command
{
short one; //always 1
short id; //sequence number counting from 0
char flag_1; //0 or 1
short attr; //the "Type" in AGE
short class; //the "Class" in AGE
short unit; //the "Unit" in AGE
short unknown_s_1; //2 only for transports, -1 elsewhere
short res_in; //the "Resource In" in AGE
short unknown_s_2; //47 only for gold miners, -1 elsewhere
short res_out; //the "Resource Out" in AGE
short unknown_s_3; //always -1
float unknown_f_1;
float unknown_f_2;
float unknown_f_3;
char flag_2; //0 or 1
float unknown_f_4;
char flag_3; //0 or 1
char flag_4; //0 or 1
short flag_5; //0 or 1
short unused_s; //always 0
char unknown_c_1; //holds multiple values (0, 2, 3, 4, 5)
char flag_6; //0 or 1
char flag_7; //0 or 1
short graphics[6] ; //graphics ID
} command[command_count] ;
That is not a mistake, flag_5 is actually a short. All shorts are -1 when unused, except for the unused_s and flag_5, which are 0. All floats and bytes are 0 when unused. A flag means that it can hold either 0 or 1.
Perl template:
s2cs8f3cfc2s2c3s6
The Perl template can be used with Perl's pack and unpack functions.
About the values:
Must be one. Setting it to 0 makes the game crash when loading a scenario or the Scenario Builder.
The id number of the specific command, counting from 0 until command_count-1.
The type of command (attack, heal, garrison, etc.).
Example: 5 is used for Fishing Boats and Fishermen
Use this command only on units of this class.
Example: 9 and 10 for Hunters are prey and predator animals, respectively
Example: Transports are class 20, used for garrison ability
Use this command only on this specific unit.
Example: 50 for the Farmer is the Unit ID of the Farm
The civ header resource the unit takes in. Usually the same as the actual civ header resource. For food, depends on the type of food. For trading, uses the Trade Goods resource.
Example: 9 is Trade Goods, 15 is meat, 16 is berries and grain (farm), 17 is fish
The civ header resource the res_in is converted into. In AoE, used only for food and trade. If res_in is the same as res_out, res_out is unused and set to -1.
Example: 0 is Food, see
Transforms unit graphics unto this while command is in effect.
Example: the Hunter's 685 471 472 92 -1 -1
Graphic used when walking with tool, but carrying no resources. (chopping tree, hunting, etc.)
Graphic used when proceeding to gather a resource. (chopping tree, hunting, etc.) Also used for the running Lion.
Graphic used when actually gathering a resource. (getting meat, foraging, mining, etc.) Also used for converting Priests and grazing Gazelles (considered an "attack").
Graphic used when carrying a resource. (carrying meat, fish, gold, grain, etc.)
graphics
Unknown graphics. Both are always -1.