Welcome
Downloads Home
Best Files
Review Guidelines
Main site
Forums
Code of Conduct
Search

Advanced Search
Miscellaneous Files
Home
New Releases
New Reviews
New Comments
Top-Rated

Submit File
Browse Categories
New Files


Download File Post Review Post Comment

Alpha AI

Author File Description
Aphelion3371
File Details
Game Version: TAD
//==============================================================================
// Alpha AI 1.0
// by Aphelion
// based on the original AI Script for TAD
//
//==============================================================================

I made this in 2012 and i'm releasing it now.

Changelog:
//==============================================================================
// Alpha AI 1.0
// by Aphelion
// based on the original AI Script for TAD
//
//==============================================================================
//
// AI Personality Changes:
// - Queen Isabella: Negative bias towards natives/trade reduced.
// - Frederick: Negative bias towards natives/trade removed. Less defensive.
// - Ivan: Less defensive.
// - Suleiman: Small bias towards artillery added.
// - Henry: Small bias towards artillery added.
// - Hiawatha: Small bias towards artillery added. No longer favors natives.
// - Gall: Less of a rusher, favors natives. Negative trade bias removed.
// - Cuahtemoc: Chance to favor natives and trade added.
// - Tokugawa: Less of a rusher, balanced on defense. Favors trade.
// - Kangxi: No longer a boomer, more defensive. Doesn't favor Infantry.
// - Akbar: Boomer, less defensive. Favors natives and trade.
//
//
// TODO: Fix navy manager, better hc card selection, fix villager idling.
//
// aiPlanAddUnitType(planID, unitType, need, want, max);
// cUnitStateABQ includes units being created.
// minimum number of units to consider instance of an attack increased to 3.
//
//
// navyManager():
// - BUGGED! FIX!
// - references to cUnitTypeFrigate replaced with gFrigateUnit.
// - special handling added for the Aztecs.
// - special handling added for the Chinese.
// - special handling against natives added.
// - Canoes and Tlaloc Canoes (for the Aztecs) are now maintained.
//
//==============================================================================
// ****************
// ** Version 1.0
// ****************
//
// ****
// ** Changes:
// ****
//
// ageUpgradeMonitor():
// - number of wonder builders now randomized based on age.
//
// age2Monitor():
// - enables secondAge rule group.
// - no longer researches chinese village pop cap increase.
//
// age3Monitor():
// - enables thirdAge rule group.
// - no longer researches chinese village pop cap increase.
// - amount of towers to be built increases regardless of biases.
//
// age4Monitor():
// - enables fourthAge rule group.
// - no longer researches chinese village pop cap increase.
// - amount of towers to be build increases regardless of biases.
// - townWatch rule call removed.
//
// age5Monitor():
// - enables fifthAge rule group.
// - amount of towers to be built maxed out regardless of biases.
//
// agingUp():
// - wonder support added.
//
// bigTechManager():
// - minInterval lowered to 120 seconds (down from 300).
// - certain techs will now be researched at 15 minutes and the rest at 30.
// - Iroquois crate techs assigned the economic escrow.
// - Horse Secrets, Siege Drill and Rawhide Covers added for the Iroquois.
// - War Drums, Bonepipe Armor and Flaming Arrows added for the Sioux.
// - Tezcatlipoca added for the Aztecs.
//
// buildingMonitor():
// - execution allowed for Dutch regardless of whether having banks.
// - for the Dutch two banks will be constructed in the Colonial Age,
// two more in the Fortress Age and any number left in the later ages.
// - market enabled for the ottomans and dutch.
// - church moved to age 2, independant of difficulty and mills.
// - additional military buildings added for ages 3-5.
// - additional war academy added for the chinese in the second age.
// - extra war huts added for the Aztec and Sioux.
// - construction of livestock pen buildings moved to livestockMonitor.
//
// crateMonitor():
// - number of crate gatherers fixed to wanted amount.
//
// createSimpleAttackGoal():
// - special island-to-island handling enabled for Amazonia.
//
// createSimpleBuildPlan():
// - explorers, war chiefs and monks defined as town center builders.
// - settler wagons will be used to build if other settlers exist.
//
// commHandler():
// - unit training request confirmation added.
// - number of aztec nobles huts to be built defined for turtle requests.
// - number of asian castles to be built defined for turtle requests.
//
// consulateMonitor():
// - minInterval increased to 60 seconds.
// - no longer activated for the Japanese in townCenterComplete.
// - increases export generation in the Fortress Age.
// - maximizes export generation in the Industrial Age.
//
// danceMonitor():
// - 1/10 villagers now dance at the fire pit (up from 1/15).
// - warrior priests will now dance at the fire pit (up to 8).
// - dancers are now re-allocated every 60 seconds and the dance switch time
// remains the same.
// - the alarm dance will only be used if there are less nearby allied units
// than enemy units.
// - the war chief revival dance is used by all natives, and only when the
// war chief has fallen.
// - the fertility dance is prohibited if aging up.
// - the aztecs now use the warrior priest dance in ages 2-3.
// - the sioux will now use the dog soldier spawn dance in ages 4-5.
// - the aztecs will now use the skull knight spawn dance in ages 4-5.
//
// deathMatchSetup():
// - number of asian castles to be built defined.
//
// econUpgrades():
// - research of market food upgrades allowed regardless of whether a mill, farm
// rice paddy exists.
//
// exploreMonitor():
// - references to LogicalTypeScout replaced with LogicalTypeValidSharpshoot.
// - proper handling for war chiefs and monks added.
// - explorer dogs added to nugget hunting and defending base.
// - explorer defend base plan refresh frequency lowered to 10 (down from 15).
// - unconditional stop to rusher nugget gathering after 4 minutes added.
// - unconditional stop to nugget gathering after 8 minutes added.
//
// findEnemyBase():
// - method aborted for Amazonia.
// - explorers, war chiefs and monks are no longer used for the task.
// - units will now be sent back to our base once they've reached the enemy's.
//
// getBaseEnemyStrength():
// - asian outposts, blockhouses, war huts, nobles huts, castles and agra forts added to calculation.
//
// getBaseValue():
// - factories, banks, mills, farms and rice paddies added to calculation.
//
// getPointAllyStrength():
// - asian outposts, blockhouses, war huts, nobles huts, castles and agra forts added to calculation.
//
// getPointEnemyStrength():
// - asian outposts, blockhouses, war huts, nobles huts, castles and agra forts added to calculation.
//
// getPointValue():
// - factories, banks, mills, farms and rice paddies added to calculation.
// - plantation value corrected.
//
// houseMonitor():
// - execution allowed for Dutch regardless of whether having banks.
//
// init():
// - check for AITransportRequired added, which enables navy regardless of having a flag.
// - check for AIFishingUseful allowed in RM games as well as SPC.
// - check for a Homecity Water flag added, which enables navy and fishing.
// - enables scoutMonitor rule.
//
// initArrays():
// - base settler target for the Imperial Age set to 80.
// - base Dutch settler targets added.
// - selection of wonders improvied and somewhat randomized selection.
// - consulate tech array corrected.
//
// initGatherGoal():
// - initial gathering share for gold added for the Dutch.
// Dutch no longer build banks in the Discovery Age, so gather goal adjusted.
// - initial gathering share for wood added for the Indians.
//
// initPersonality():
// - method fully refined, personality changes listed above.
// - negative cavalry bias removed.
// - negative native and trade bias for rushers reduced.
//
// initEcon():
// - reorganized code.
// - japanese no longer forced to farm.
// - base settler targets increased for the natives because of the fire pit.
// - shrine defined as gLivestockPenUnit for the Japanese.
// - canoe defined as gCaravelUnit for natives.
// - war canoe defined as gGalleonUnit for natives.
// - tlaloc canoe defined as gFrigateUnit for the Aztecs.
// - tekkousen defined as gFrigateUnit for the Japanese.
// - maximum population defined as 220 for the Chinese.
//
// main():
// - method refined.
// - call for initDifficulty added.
//
// militaryManager():
// - number of units to pick increased to 4 (up from 3).
//
// monasteryMonitor():
// - rule is now activated once the Colonial Age has been reached.
// - Sabotage and White Tiger Training are no longer researched.
//
// monitorFeeding():
// - feeding resources in the first age (if not capped at) forbidden.
// - feeding resources to defeated players forbidden.
// - maximum amount of resources that can be fed set to 1000.
//
// monitorScores():
// - missing chats about the Iroquois, Sioux and Aztec added.
//
// mostHatedPlayer():
// - configured to target the weakest players on the enemy team,
// on Hard or Expert difficulty settings (non FFA games only).
//
// nuggetHandler():
// - handling added for war chiefs and monks.
//
// ottomanMonitor():
// - tanzimat tech will no longer be researched.
//
// popManager():
// - the Chinese now take full advantage of their higher population limit.
// +10 pop on moderate (+5 econ, +5 mil)
// +20 pop on hard/expert (+10 econ, +10 mil)
//
// scoreOpportunity():
// - value of a trading post increased to 2000 (up from 1000).
//
// setUnitPickerPreference():
// - tertiary army unit now properly supported.
// - yojimbos, iron troops and flail elephants allowed.
// - monastery mercenaries allowed for asians.
// - preference for outlaw-type units set to 0.25 to prevent overuse.
// - preference for chinese banner armies adjusted.
// - preference for han / standard army adjusted according to age, once the han
// reforms card is sent the preference for these armies is increased greatly.
// - preference for mansabdar gurkha set to 0, replacing mansabdar urumi.
// - preference for mahouts and howdahs increased to 0.40 (up from 0.10).
//
// shouldIResign():
// - new resign conditions added.
//
// towerManager():
// - order of Blockhouse upgrades corrected.
// - corrupt upgrade plans are now destroyed.
// - construction of Blockhouses with Outpost Wagons made possible for the Russians.
//
// townCenterComplete():
// - japanese build plan for rice paddy removed.
//
// turtleUp():
// - execution not allowed if in the Discovery Age.
// - execution allowed regardless of having ten settlers.
// - execution allowed for Dutch regardless of whether having banks.
// - number of aztec nobles huts to be built is / 1.75 of standard calculation.
// - number of asian castles to be built defined.
// - minimum number of towers set to zero to prevent the value from being negative.
//
// useCoveredWagons():
// - attempt to construct addition town centers forbidden if at limit.
//
// updateForecasts():
// - forecasts for new building plans added.
// - forecasts for Dutch banks in ages 2-3 and extra banks added.
// - church techs added to forecasts.
// - tanzimat removed from forecasts.
// - missing forecasts added.
//
// updateGatherers():
// - settler wagons counted as two settlers.
// - consulate banks and factories (not the first one) added to calculation.
// - gatherer percentage for gold adjusted according to gather rates.
//
// updateUnitPicker():
// - forces updates on the unit picker every 5 minutes.
//
// updateUnitPickerUnitTypes():
// - updates the land unit picker, defining the units we want to select.
// the number of units we want is based on the current age.
// - when allied with a civilization at the consulate the number of
// units to select will be increased, making space for the consulate armies.
//
// waterAttackDefend():
// - minimum number of boats required for an attack is now 6 for natives.
// - defend engageRange halved.
//
// removed rule getSteamPower():
// - replaced by factoryUpgradeMonitor.
//
// removed rule orchardMonitor():
// - replaced by rickshawMonitor.
//
// removed rule townWatch():
// - replaced by churchTechMonitor.
//
// removed rule xpBuilderMonitor():
// - replaced by travoisMonitor.
//
// removed method chooseConsulateFlag():
// - replaced with selectConsulateFlag.
//
// removed method SPCInit():
// - directly handled in main.
//
// ****
// ** Added rules:
// ****
//
// added rule agraFortUpgradeMonitor():
// - handles research of agra fort upgrades.
//
// added rule baseMonitor():
// - updates variables that tell if we're under attack.
//
// added rule churchTechMonitor():
// - researches basic church techs.
//
// added rule envoyMonitor():
// - handles independant scouting for Envoys.
// - at least 1 envoy is maintained for the Dutch, regardless of Age.
//
// added rule capitolMonitor():
// - researches explorer upgrade techs from the Capitol.
//
// added rule factoryUpgradeMonitor():
// - handles research of steam power and mass production.
//
// added rule fortUpgradeMonitor():
// - handles research of fort upgrades.
//
// added rule healerMonitor():
// - places healers in a defensive position so that they can heal units.
//
// added rule livestockMonitor():
// - maintains at least 1 livestock pen or sacred field for 4 herdables.
// - tasks all herdables to civ-appropriate "livestock pens".
//
// added rule rescueExplorer():
// - sends a unit to rescue fallen explorers or monks.
// - explorers will be ransomed instead if they are nearby an enemy town center.
//
// added rule sacredFieldMonitor():
// - mantains 1 sacred field and 10 sacred cows.
// - researches livestock holiness (increases XP work rate for herdables).
// - researches navajo shepherds (increases XP work rate for herdables).
// - researches udasi new year (increases XP work rate for herdables).
//
// added rule scoutMonitor():
// - creates explore plans for Native and Mongol Scouts, Envoys, and Hot Air Balloons.
//
// added rule setFactoryTactic():
// - configures the first factory to produce heavy artillery.
//
// added rule setGoldenPavillionTactic():
// - configures the golden pavillion power (unit hitpoints boost is chosen mostly).
//
// added rule setSummerPalaceTactic():
// - configures the summer palace to produce Territorial, Forbidden or Imperial
// armies in the Fortress Age.
//
// added rule settlerUpgradeMonitor():
// - handles research of settler techs.
// - rushers research settler techs later.
//
// added rule shipmentMonitor():
// - replaces extraShipMonitor.
//
// added rule tcMonitor():
// - uses a explorers, war chiefs, or monks to construct town centers if lost.
// - the distance of town center placement is slightly increased if under attack.
//
// added rule travoisMonitor():
// - handles use of all travois.
//
// added rule useConsulateLevy():
// - handles use of the ottoman consulate levy.
//
// added rule villageUpgradeMonitor():
// - handles research of chinese village upgrades.
//
// added rule wagonMonitor():
// - handles use of certain wagons from the home city.
//
// added rule warhutUpgradeMonitor():
// - makes sure war huts are upgraded for the Sioux and Aztecs.
//
// ****
// ** Added methods:
// ****
//
// added method createAdvancedBuildPlan():
// - createSimpleBuildPlan with advanced functions.
//
// added method getSimpleScout():
// - returns a simple non-explorer unit appropriate for scouting
//
//
// added method initDifficulty():
// - finds out the difficulty setting, sets handicap.
//
// added method researchConsulateTechs():
// - creates research plans for consulate techs.
// - skips creation of portuguese tech research plans on land maps.
// - enables useConsulateLevy for Indians.
//
// added method selectConsulateFlag():
// - rewritten consulate flag selector, replaces chooseConsulateFlag.
//
// added method shipmentHandler():
// - refactored shipment handler, replaces shipGrantedHandler.
// - fort wagons will no longer be sent if a forward base already exists.
// - priority given for hero combat cards, caballeros, yeomen, mercenary combat,
// way of the bow, close combat, bloody harvest, confucious gift,
// fencing, dueling riding and banner school, shogun tokugawa,
// 2 orchard/grove rickshaw and Indian wood trickles cards.
// - priority for military cards doubled if under attack.
// - handling of war hut travois cards added.
// - handling of nobles hut travois cards added.
// - handling of castle wagon cards added.
// - handling of dojo wagon cards added.
// - handling of 'Shogun Tokugawa' card added.
// - special handling added for Chinese villager shipments.
// - special handling added for Indian shipments.
// - special handling added for Coureurs and Settler Wagon shipments.
// - target number of town centers now independant of rush/boom bias.
// - target number of town centers is now 3 for the ottomans.
// - 1/25 chance for a card value to be doubled added. does not take effect when
// the home base is under attack.
// - 1/50 chance for a card value to be halved added. does not take effect when
// the home base is under attack.
// - value of wood crates in the first age no longer decreased for the Indians.
// - value of coin crates in the first age no longer decreased for the Dutch.
// - value of cards previously used (japanese/infinite cards) are now halved.
// - disciples allowed in the Colonial Age.
// - special handling added for Treaty games.
//
//==============================================================================
AuthorComments & Reviews   ( All | Comments Only | Reviews Only )
Lord_KiLLMS Hey there Aphelion,

It's been a while since i've had much interest in aoe, especially since ensemble got shut down, but recently me and some friends have been trying to max out the AI and short from giving them a 100% handicap it seems like they're beat, even with Felix's Draugur AI.

However reading over your list of changes it seems like you've put a lot of thought into this, so its unfortunate that no one has commented yet, encouraging you to think of a few more decent updates.

I haven't tried your mod yet but once we've played a few test rounds, i'll report back with a thorough review. Fingers crossed.

Cheers,

Alexander

Post Review Post Comment

HGDL v0.8.0

Login
Forum Username:


Password:




Create a new account
Forgot password?
Statistics
Downloads:784
Favorites: [Who?]0
Size:144.18 KB
Added:11/20/13
Updated:02/25/14