Stock A2 Duplicate File Question

Talk about anything related to old versions of Armada.
posted on October 8th, 2013, 3:01 am
In stock A2 the AI files have an include command to reference the aipdef.H file. In the AI/AIP file there is this:

aipdef.H
///////////////////////////////////////////////////////////////////////////////
//
// AIPDef.h
//
// Contains structure definitions and constants for the supplemental build
// lists in Civ3
//
// by The Mad Dr. I
//
///////////////////////////////////////////////////////////////////////////////




///////////////////////////////////////////////////////////////////////////////
//
// Build_List_Class
// -------------------
// Specifies a list of unit types, from which we should try to build one
struct Build_List_Class
{
char class_name[80]; // The names of the build list
double priority; // How important to build form this list
};

#define UNLIMITED -999999

#define YES 1
#define NO 0

#define MAX_BUILD_LISTS 200

#define MAX_ELEMENTS 200

///////////////////////////////////////////////////////////////////////////////
//
// Build_List_Element
//
// Specifies a type in a build list
struct Build_List_Element
{
char unit_type_name[80]; // The names of a unit type
double units_to_build; // How many of this type per city
};



///////////////////////////////////////////////////////////////////////////////
//
// Better_Build_List_Element
//
// Specifies a type in a build list, and which base to build it from
struct Better_Build_List_Element
{
char unit_type_name[80]; // The names of a unit type
double units_to_build; // How many of this type per city
int m_base_num; // Which base do we put it at?
// (only used for stations)
};


///////////////////////////////////////////////////////////////////////////////
//
// Mo_Better_Build_List_Element
//
// Specifies a type in a build list, which base to build it from, and how many
// times MAX we can rebuild this thing
struct Mo_Better_Build_List_Element
{
char unit_type_name[80]; // The names of a unit type
double units_to_build; // How many of this type per city
int m_base_num; // Which base do we put it at?
// (only used for stations)
int m_buildMAX; // How many UNITS max can be built
// from this line?
};


///////////////////////////////////////////////////////////////////////////////
//
// Way_Better_Build_List_Element
//
// Specifies a type in a build list, which base to build it from, how many
// times MAX we can rebuild this thing, and what Tech level the item either
// defines (positive) or is limited to (negative)
struct Way_Better_Build_List_Element
{
char unit_type_name[80]; // The names of a unit type
double units_to_build; // How many of this type per city
int m_base_num; // Which base do we put it at?
// (only used for stations)
int m_buildMAX; // How many UNITS max can be built
// from this line?

int m_techLevel; // If positive: Tech level this defines
// Negative: Highest tech level at which
// we should build this.
};



/*

This stuff is not used yet in Armada

#define NUMBER_TO_HAVE 0
#define NUMBER_TO_BUILD 1
#define RATIO_TO_BUILD 2
#define RATIO_TO_HAVE 3

*/

However, in the misc folder there is another file with lowercase "a" called aipdef.H:

///////////////////////////////////////////////////////////////////////////////
// UCP Data Structure
// -------------------
// Default Unit Construction Program Definition.
// When no other task demands a Construction Program, build according
// to this program.
struct UNIT_CONSTRUCTION_PROGRAM
{
char account_name[80]; // The names of the budgetary accounts
int budget; // How much money gets fed into account
int max_reserve;
};

#define UNLIMITED -1

#define MAX_UCP_LENGTH 20

///////////////////////////////////////////////////////////////////////////////
// ACCOUNT Data Structure
// -------------------
// Default Unit Construction Program Definition.
// When no other task demands a Construction Program, build according
// to this program.
struct ACCOUNT
{
int priority; // What level of priority does this element have
char item_name[80]; // What sort of thing should we buy/build?
int build_type; // Do we want fixed amounts, ratios, or what?
int build_amount; // How much of something (or what ratio) do we want.
};

#define NUMBER_TO_HAVE 0
#define NUMBER_TO_BUILD 1
#define RATIO_TO_BUILD 2
#define RATIO_TO_HAVE 3

#define MAX_ACCOUNT_LENGTH 50


///////////////////////////////////////////////////////////////////////////////
// Force Matching Data Structure
// -------------------
// Unit Force matching modification definition.
// All units in the game have a calculated unit strength which is roughly
// (Damage_Dealt * Hitpoints)/Rate_of_fire (there is a minimum strength, too)
// this allows the designer to assign coefficients to the strengths of particular
// units (such as "Tachyon Tank" 2.0, which would double the apparent strength).
struct FORCE_MATCHING
{
char unit_name[80]; // The name of the unit type
float multiplier; // How much by which to multiply its strength
};

#define MAX_FORCE_MATCHING 100



///////////////////////////////////////////////////////////////////////////////
// Unit Match-up Data Structure
// -------------------
// Unit Force matching modification definition.
// All units in the game have a calculated unit strength which is roughly
// (Damage_Dealt * Hitpoints)/Rate_of_fire (there is a minimum strength, too)
// this allows the designer to assign coefficients to the strengths of particular
// units (such as "Tachyon Tank" 2.0, which would double the apparent strength).
struct MATCH_UPS
{
char unit_name[80]; // The name of the unit type we may see
char match_up_name[80]; // The sort of unit to build to match this
};

#define MAX_MATCH_UPS 100



/////////////////////////////////////////////////////////////////////////////
// BUILDING MATCHING
// --------------
// Which buildings do we want to emphasize & target with this aip?
// Note that this can be used for BOTH the AI team's unit strengths and
// the opponents'
// Where would we want to build the buildings if we could build them?
/////////////////////////////////////////////////////////////////////////////
struct BUILDING_MATCHING
{
char unit_name[80]; // The name of the unit type
float multiplier; // How much by which to multiply its strength
int build_pos; // How much by which to multiply its strength
};

#define MAX_BUILDINGS 100

#define DONT_CARE 0
#define CENTER_OF_BASE 1
#define PERIMETER 2
#define OUTSIDE_OF_BASE 3
#define NEAR_ENEMY_BASE 4
#define NEAR_ENEMY_TROOPS 5

Is the game referencing both files or is the one in the misc folder obsolete? Are they both being used or causing any conflicts together and should I delete one of them?
posted on October 14th, 2013, 2:43 am
Presumably it's obsolete. It definitely won't be referenced by the AIP folder stuff. As Ian worked on Civilization AI as well, I'm not surprised that it was left in - probably used it in an early build and left it. There are tons of files littering A2/A1 that are leftovers that aren't used by the engine. Since the game was built by hand - a bit like how most modders work A2/A1 today - there were a lot of oversights :)
Reply

Who is online

Users browsing this forum: Google [Bot], Google Adsense [Bot] and 4 guests