//============================================================================== /* aiHeader.xs This file contains all personality trait and control variable definitions. It is included by the loader file, above the inclusion of aiMain.xs. This file is intended primarily as a reference for the variables that can be safely set by the loader file. */ //============================================================================== //============================================================================== // Behavior Traits. // // These global variables all range from -1.0 to +1.0, with 0.0 as a neutral value. // All names start with bt for Behavior Trait, followed by two words that are // opposites. A value above zero emphasizes the first word, a negative value // emphasizes the second word. Setting btRushBoom to 1.0 would create an extreme // rusher, setting it to -1.0 would create an extreme boomer. // NOTE! *** in a comment means this variable has not yet been implemented. Stay tuned for updates. extern float btRushBoom = 0.0; /* Affects emphasis and timing of early attacks. Extreme rushers will attack early and relentlessly Extreme boomers invest in economic upgrades, gamble on a later, more powerful attack. In ages 3+, 'rushers' focus a bit more on military, 'boomers' a bit more on econ, but the differences are more subtle. */ extern int btAttackGroups = 1; // Number of attack groups the AI has //extern float btOffenseDefense = 0.0; /* A defensive personality will add towers and upgrade them. An offense-oriented personality will skip these investments in favor of a larger and more upgraded army. */ extern float btBiasCav = 0.0; // These variables control a personality's bias toward or away extern float btBiasArt = 0.0; // from each unit line. 0.0 is neutral. 1.0 means heavily favor extern float btBiasInf = 0.0; // this unit line. -1.0 means avoid when possible. extern float btBiasArcher = 0.0; extern float btBiasNavy = 0.0; // This variable controls the AI's navy bias. It works a bit differently than // the above biases. By default, the AI's navy will try to keep up with the player's // number of naval units. It extern float btBaselineHandicap = 1.0; // This is the handicap given to cDifficultyHard. Our intent is to ship with this at 1.0, // meaning that hard has no handicap advantage or penalty. // All other difficulty levels will be adjusted relative to this constant. This means that // we can gradually reduce this number as the AI's competence increases, and all the difficulty levels will respond. extern bool btHighStartingResources = false; // Used to flag that an AI has an abundance of starting resources //============================================================================== // Army control variables //============================================================================== extern int btTargetAge1ArmyCount = 8; extern int btTargetAge2ArmyCount = 0; extern int btTargetAge3ArmyCount = 0; extern int btTargetAge4ArmyCount = 90; extern bool btMilitaryInAge1 = false; // Should we attempt to build military units in Age 1? extern bool btBuild2ndDockAge2 = false; extern int btMilitaryCap = 200; extern int btAttacksThisAge = 0; extern float btAttackRampUp = 10; //============================================================================== // Econ control variables //============================================================================== extern int btTargetAge1VilCount = 20; // Villager counts for the various ages. This, EDIT: Ace old 14 extern int btTargetAge4VilCount = 80; // number is interpolated for age 2 and 3. EDIT: Ace old 70 extern int btAge2VilReqPercent = 50; extern int btAge3VilReqPercent = 70; extern int btAge4VilReqPercent = 80; extern float btSpendingType = 0.0f; // Not Yet Implemented //============================================================================== // Tech research variables //============================================================================== extern bool cvOKToResearchEcon = true; extern bool cvOKToResearchMilitary = true; //============================================================================== // Control Variables. // // Control variables are generally set in the loader file's preInit() function, // to shape AI behavior while isolating the loader file from ongoing script development. //============================================================================== // NOTE! *** in a comment means this variable has not yet been implemented. Stay tuned for updates. extern bool btRevealEnemyBases = true; // Should the AI auto-reveal enemy bases? extern float cTimeToRevealEnemyBases = 60; // Amount of time for the AI to auto-reveal if auto-revealing // Permission-oriented control variables //extern bool cvInactiveAI = false; // Setting this true in preInit() will disable all upper AI functions (attack, defend, gather, etc.) extern bool cvOKToDefend = true; // False prevents the AI from using the defense behavior. extern bool cvOkToSelectMissions = true; // False prevents the AI from activating any missions extern bool cvOkToAttack = true; // False prohibits launching of any new attacks extern bool cvOkToTrainArmy = true; // False prohibits training land mil units extern bool cvOkToTrainNavy = true; // False prohibits training naval units //extern bool cvOkToFortify = true; // False prohibits outposts extern bool cvOkToTaunt = true; // False prohibits routine ambience (personality development) chats. NOTE that this defaults to FALSE in SPC/campaign games. //extern bool cvOkToChat = true; // False prohibits all planning-oriented comms, like requests for defense, joint ops, tribute requests, etc. extern bool cvOkToBuild = true; // False prohibits buildings. extern bool cvOkToBuildFarms = true; // False prohibits building farms. extern bool cvOkToBuildDocks = true; // False prohibits building docks. extern bool cvOkToBuildHouses = true; // False prohibits building houses. //extern bool cvOkToBuildWalls = true; // False prohibits any wall-building //extern bool cvOkToBuildForts = true; // False prohibits fort building extern bool cvOkToRepair = true; // False prohibits repairing extern bool cvOkToHerd = true; // False prohibits herding extern bool cvOkToCaravan = true; // False prohibits caravans extern bool cvGuardAlliedBases = false; // Should we defend allied bases as well? Used for quests. // Resignation is handled differently in scenario and campaign games. In them, init() sets cvOkToResign to false. // If you want to turn resignation back on in a scenario, the loader file must set it true in postInit(). (preInit() will // have no effect because this value is actually set in init(), unlike the other control variables. extern bool cvOkToResign = true; // AI can offer to resign when it feels overwhelmed extern bool cvDoAutoSaves = true; // Setting this false will over-ride the normal auto-save setting (for scenario use) extern bool cvOkToExplore = true; // Setting this false will disable all AI explore plans extern bool cvOkToFish = true; // Setting it false will prevent the AI from building dock and fishing boats, and from // using the starting ship (if any) for fishing. extern bool cvOkToGatherFood = true; // Setting it false will turn off food gathering. True turns it on. extern bool cvOkToGatherGold = true; // Setting it false will turn off gold gathering. True turns it on. extern bool cvOkToGatherWood = true; // Setting it false will turn off wood gathering. True turns it on. extern bool cvOkToGatherStone = true; // Setting it false will turn off stone gathering. True turns it on. // Limit control variables extern int cvMaxArmyPop = -1; // *** -1 means undefined. 0 means don't train anything. extern int cvMaxNavyPop = -1; // *** Navy units no longer take up pop. extern int cvMaxCivPop = -1; // *** -1 means undefined. 0 means don't train anything. Until navy is working, use this for total mil pop extern int cvMaxAge = cAge4; // Set this to cAge1..cAge4 to cap age upgrades. cvMaxAge = cAge3 will let the AI go age 3, but not age 4. // Non-boolean control variables // To make the AI train mostly hussars and some musketeers, set cvNumArmyUnitTypes = 2; cvPrimaryArmyUnit = cUnitTypeHussar; // and cvSecondaryArmyUnitType = cUnitTypeMusketeer; // To return the AI to normal operation, set those same variables back to -1. extern int cvPrimaryArmyUnit = -1; // This sets the AI's primary land military unit type. -1 lets the AI decide on its own. extern int cvSecondaryArmyUnit = -1; // This sets the AI's secondary land military unit type, applies only if cvNumArmyUnitTypes is >2 or set to -1. extern int cvTertiaryArmyUnit = -1; // This sets the AI's tertiary land military unit type, applies only if cvNumArmyUnitTypes is >3 or set to -1. extern int cvNumArmyUnitTypes = -1; // The AI will not use more than this number of unit types. (May be less if not available). -1 means AI can decide. extern int cvPlayerToAttack = -1; // *** Leaving this at -1 will let the CP choose its own targets. Setting it to an enemy player ID will make it focus // on that player unless it can see no bases owned by that player. extern float cvDefenseReflexRadiusActive = 60.0; // When the AI is in a defense reflex, this is the engage range from that base's center. extern float cvDefenseReflexRadiusPassive = 30.0; // When the AI is in a defense reflex, but hiding in its main base to regain strength, this is the main base attack range. extern float cvDefenseReflexSearchRadius = 60.0; // How far out from a base to look before triggering a defense reflex. THIS MUST NOT BE GREATER THAN 'RadiusActive' ABOVE! extern int cvNumTowers = 6; // The total number of towers the AI should attempt to build extern int cvMinTowerAge = cAge2; // The age when tower building is allowed to begin extern int gMaxUnitLines = 1; // The maximum number of unit lines the AI should try to build extern int gAge1UnitLineCap = 1; // Unit line caps for the various ages extern int gAge2UnitLineCap = 2; extern int gAge3UnitLineCap = 3; extern int gAge4UnitLineCap = 3; // Mission intervals extern int gAttackMissionInterval = 180000; // 3 minutes. Suppresses attack scores (linearly) for 3 minutes after one launches. Attacks will usually happen before this period is over. extern int gDefendMissionInterval = 300000; // 5 minutes. Makes the AI less likely to do another defend right after doing one. // The following are more like constants once set at initialization extern string cvRandomMapName = ""; // *** Force this player to act as if it is on a specific map type. extern bool cvTransportMap = false; // *** Set to true to force AI to prepare for transports, false to prohibit transporting. extern bool cvFishingMap = false; // *** Set to true to enable fishing, false to prohibit it. //============================================================================== // Global vars //============================================================================== extern int gLandUnitPicker = -1; // Picks the best land military units to train. extern bool gHasWave = false; // Set when we have a wave hit so that we know to attack. extern bool gGoodFishingMap = false; // Is this a map we want to fish on? extern bool gNavyMap = false; // Is this a map we should be doing navy things on? // tower building variables // used for tower placement algorithm extern vector cEnemyDirection = cInvalidVector; extern int cTowerCount = 0; // EDIT Ace // Debug messages extern bool bDebugMessages = false; extern bool gMakeBarracksAge1 = true; //Will the ai make barracks in age 1?