//------------------------------------------------------------------- // INCLUDES: //------------------------------------------------------------------- include "aiHeader.xs"; // Gets global vars, function forward declarations include "aiUtil.xs"; // Misc. shared AI utility functions include "aiEcon.xs"; // All of the AI's econ functionality include "aiMilitary.xs"; // All of the AI's military functionality include "aiNavy.xs"; // All of the AI's naval functionality include "aiEventHandlers.xs"; // Event handler methods for the AI include "aiMain.xs"; // The bulk of the AI include "aiCampaignCore.xs"; // The Core Campaign AI data and features //------------------------------------------------------------------- // for anything defined in SetCampaignDefaults, if needed, override it here void OverrideCampaignDefaults() { btStrengthATK = 0.0; // 0.0 - 4.0, weak attack strength to hardcore attack strength btStrengthDEF = 0.0; // 0.0 - 4.0, weak defense strength to hardcore defense strength btStrengthECO = 0.0; // 0.0 - 4.0, weak economy strength to economy attack strength btRushBoom = -1.0; // -1.0 = max rush, 1.0 = max boom bAllowBAM = true; // when true, this AI will always use the better attack manager bAllowScaling = false; // when true, this AI will scale group sizes and econ handicaps based on player 1 } //------------------------------------------------------------------- // for anything calculated in CalculateCampaignSettings, if needed, override it here void OverrideCampaignSettings() { btAttackGroups = 4; btTargetAge1ArmyCount = 2; btTargetAge2ArmyCount = 3; btTargetAge3ArmyCount = 3; btTargetAge4ArmyCount = 4; // in case we use BAM, define a percent of each attack interval during which attacks can take place float attackPeriodPercent = 0.8; // set additional BAM params gBAMAttackInterval = ( 190 - (btStrengthATK * 15) + (btRushBoom * 60) ); gBAMGroupInterval = (gBAMAttackInterval * attackPeriodPercent) / btAttackGroups; gBAMAttackGroups = btAttackGroups; gBAMAttackRoutePattern = cAttackPlanAttackRoutePatternRandom; gBAMTargetAge1GroupSize = btTargetAge1ArmyCount; gBAMTargetAge2GroupSize = btTargetAge2ArmyCount; gBAMTargetAge3GroupSize = btTargetAge3ArmyCount; gBAMTargetAge4GroupSize = btTargetAge4ArmyCount; gBAMGroupSizeRampUp = gBAMAttackGroups * 3; gBAMEngageRadius = 30; bPreventLevelUpMaxAgeChanges = true; cvMaxAge = cAge3; } //------------------------------------------------------------------- void preInit(void) { aiEcho("preInit() Starting..."); // force defaults for all internal settings SetCampaignDefaults(); // Override Defaults // do this before any formula based settings are calculated // This allows each parent script to set the intended default overrides before anything is calculated OverrideCampaignDefaults(); // derive any settings from the defaults CalculateCampaignSettings(); // Override Campaign Settings // in some cases, it is valuable blow out even the calculated settings OverrideCampaignSettings(); // print everything out EchoCampaignSettings(); } //------------------------------------------------------------------- void postInit(void) { aiEcho("postInit() Starting..."); }