jdog5000
Revolutionary
You can always get the latest stable release from the download thread or sourceforge. Development versions and updated source code can also be checked out from sourceforge. There will also sometimes be development versions on CFC, see the development thread for more info.
There are a lot of smaller tweaks and changes spread out throughout the code in this version compared to prior, more focused releases. The one big block of changes are to how the AI chooses to vote on AP/UN proposals, particularly for ending a war. The AIs war tactics have also been tweaked, stacks without much bombard strength now prefer cities with low defenses and the AI will now minimize how many turns attack stacks and transports spend in enemy territory so they don't get counter attacked or give as much advance warning. Several reported bugs or odd behavior have been addressed, including issues with fired global event triggers not being set for new players, AI building boats in ice locked cities, AI not building workboats to get resources in small lakes, and unnecessary use of fighters for air patrolling when enemies don't have aircraft yet.
Better BTS AI v0.50 Changelog
_________________________
Bugfix
- Fixed bug in player closeness calculations causing the AI to be blind to its actual proximity to other players
- Fixed bug with needed defenders where the AI would choose to defend a recently captured holy city less than a normal city
- Fixed bug causing player ID to be used in place of actual attitude when checking for denials in bonus, civic, and religion trading
- Fixed bug in paradrop code causing AI to avoid paradropping onto terrain bonuses under certain circumstances
- Fixed bug in AI denial of switching civics when in Emancipation
- Fixed bug introduced in unofficial patch causing immunity to collateral damage
- Fixed bug with espionage mission to spread culture to an enemy city
- Fixed bug causing combat promotions to be counted twice for aircraft
- Fixed bug (introduced) in consideration of plot defense when selecting bases for offensive air units
- Fixed bug (introduced) causing crashes if there was an unowned fort on the map
- Fixed bug in unit AI type matching for retreating emptied transports
- Fixed bug in unit AI's determing if a transport had required space to hold them where they didn't consider other units intending to load
- Fix for naval blockades reaching across land, including across diagonal water tiles (fixed both actual range and graphically shown range)
- Fixed bug (introduced) caused by different fixes to the espionage mission to spread culture in this mod and the Unofficial Patch
- Fixed bug in use of unit type instead of UNITAI type when retreating assault transports after drop-off in certain circumstances
- Created CvPlayer::initInGame to fix several problems with using CvPlayer::init in CvGame::addPlayer, including global event triggers reseting for new player and city culture, revealed plots, plus other data not reseting when overwriting old player
- Fixed bug where AI would use total war boolean when checking whether to do limited war despite poor finances
War strategy AI
- Modified how closeness is used for determining who to attack, different settings for regular and Aggressive AI
- Created new function CvTeamAI::AI_calculateBonusWarValue so AI will consider declaring war for resources, weighted towards resources AI doesn't have and plots that are more easily captured
- Modified city attack targetting by terrain bonuses to consider how important bonus is to AI
War tactics AI
- Attack city stacks will now reduce the distance they travel in enemy territory so the enemy has less time to prepare or hit them with suicide siege
- Attack stacks with decent initial odds and big troop advantage will skip bombarding and just attack (so enemy can't restock)
- Attack stacks without much bombard power will now prefer to go after cities with low defense modifiers, effect reduced after AI can build bombers
- Attack stacks without much bombard power are a little bolder in attacking city before defenses are lowered to 0, though they will bombard a few turns to make sure bombers and ships can get some shots in
- Loaded transports coming in for an invasion will now usually move outside opponents territory and adjacent tiles to up surprise factor and reduce exposure to attacks before landing
City AI
- AI will now more likely fill empty transports when enagaged in transcontinental war, making reinforcements and second waves on invasions more likely
- When doing invasions, AI will now be more likely to have cities with free air experience fill vacancies on carriers
- When doing invasions, AI will now have cities with high production more often fill needs for aircraft carriers
- When doing invasions, if AI has at least 50% of its possible missile capacity it will no longer always build missiles
- Rewrote CvCityAI::AI_isAirDefended so that it considers unit damage, movement, AI type and can also count land units
- Normal workboat build blocked if there's an enemy sea unit camping outside city
- Coastal cities will now build boats as if planning a sea invasion if there is no route to enemy cities
- Improved handling of building troops to fill transports, unified between coastal and non-coastal cities
- Non-coastal cities now help fill carriers, missile carriers
- The AI was blocked from building attack troops if it felt it was unable to build good ones, now if it is at war it can build them but with low probability so it can fight back a little early in the game
- AI will now emergency build fighter planes if its air defenses are shot down but it still has lots of bombers and missiles
- If not critical, AI will let cities with high production or free air experience usually build most planes
- Cities with military production bonuses now a bit more likely to build military units
- AI will now always build some assault transports if it has significant overseas colonies to help defend them
- AI will now build reserve sea units to defend its settler transports in later eras
- Reduced construction of escorts that are weaker than the transports they would be escorting (Caravels escorting Galleons primarily)
Worker AI
- Fix issue where AI would not build workboats to make use of resources in small lakes (was blocked because it felt lake was not relevant militarily)
Espionage AI
- When a spy has waited in a city but has no mission available, they are now more likely to move around and explore instead of sitting
- Revamped desired Espionage rate and priority weighting calculations, AI now always update weights, relations play a larger role
- Neutral priority weighting is now 10 instead of 0, differentiates between
- When AI starts preparing for war against another player they will heavily shift their espionage spending towards that player
- AI will attempt to gain passive mission levels against adversaries
- AI will now actually load spies onto the spy transport it builds
Gold AI
- AI now has a budget for troop upgrades each turn based on how much gold it wants to have, it won't spend more than this budget on non-critical units when at peace
- AI now prioritizes upgrading escort ships to same extent as transports
Diplomacy AI
- Removed blanket acceptance of all proposals by secretaries the AI is friends with, now just auto accept less strategic proposals like extra trade routes
- Being friends with secretary now influences civics and other strategic proposals
- AI now more likely to defy civic proposals which are bad for it, particularly on Aggressive AI
- Reworked AI voting on forced peace, added thresholds so winning/losing calculations are more meaningful (no longer losing a war in which no units have fought, unless being dogpiled)
- For forced peace proposals, added considerations for whether peace team is winning or losing big
- AIs which are third parties to the war in question may now vote to continue it for selfish reasons (share wars with peace team, are planning to attack peace team)
- AI will now only defy forced peace if it is doing quite well in the war,
increased use of personality so warmongers are much more likely to defy
- Vassals will now vote for forced war proposal under some circustances. Previously they were blocked from voting for a war they weren't already in since they can't declare war on their own. (Vassals of player to be attacked always vote no still)
- AI will now always vote for a forced war proposal against a player they are planning to attack anyway in addition to always voting yes if already at war
- For forced war vote, replaced blanket check on whether AI doesn't hate victim with roll based on AI's attitude-based peace probability
Naval AI
- Modified bombard behavior. Priority remains on supporting player's ground troops, if none then consider supporting other troops with common enemy and spreading out stacks to increase reach of blockade.
- Modified and expanded Solver's changes to retreat from city/fort AI to be more specialized for various unit AI types, only move if there's a real threat
- Increased city danger threshold so enemy ships do not runaway so easily
- Damaged ships will stay in city unless city is highly threatened
- Galleons assigned escort roles before Frigates are available will now change their UnitAI type to assault transport instead of getting stuck in their role after better escorts come along
- Transport ships waiting in port will now only unload their cargo during a land war if an enemy city can be reached by land, the player is on the defensive locally, or a stack of enemy units shows up. Increases naval invasions of distant enemies on Pangea maps, sea assaults to complement land assaults.
- Assault flotillas now leave behind empty transports
- Assault ships now assume cities whose defenses the player can't see are properly defended (previously counted as a single defender). Should make invasions more likely to occur near blockades, attack ships, prior invasions.
- AI will now try to break blockades if it has many attack ships in port
- Transports will now pickup units stranded on small islands
- Transports looking for cargo to pickup now use PUF_isAvailableGroupHeadUnitAIType instead of just counting unit ai types, should stop assault transports from waiting forever for units attached to a settler to load or waiting forever on small islands for units already in their cargo to load
- EscortAI units will now also shadow settler_sea units when there is nothing else to do
- Added a pathlength consideration to AI_pickup so that mostly loaded flotillas don't sail around the world to pickup one more unit (previously they would have waited trying to load the units they already had on board until someone else came around)
- SettlerSea transports now only run pickup if they're not full (another change necessary since transports no longer try to pickup the units they're already holding)
- Modified CvUnitAI::AI_shadow to optionally ignore units in cities, far away
- Reserve sea units will now prioritize shadowing settler transports out at sea even if they're empty
- Attack sea units won't run around the world to shadow transports and carriers
- Slow escorts (Caravels mainly) will now protect large flotillas instead of doing nothing
- Escorts with nothing to do will now return to the primary area if it's not too far away so that primary area city production decisions take them into consideration
- If a settler transport if full of workers but has nowhere to take them, it will now dump the cargo if an available settler comes along
Air AI
- Modified and expanded Solver's changes to retreat from city/fort AI to be more specialized for various unit AI types, only move if there's a real threat
- Increased city danger threshold so enemy aircraft do not retreat so easily
- Attack planes in endangered cities will now more likely to airstrike attackers
- Improved code for defense planes in endangered cities so they stay to defend longer and either airstrike or patrol
- Improved efficiency of danger threshold check for ships and planes
- Improved code for moving planes to offensive or defensive bases to take city threat into account
- AI bombers will no longer consider basing in undefended forts even if the fort is unthreatened
- AI bombers will now consider moving to a city with two defenders (down from requiring 3), change made because of added threat logic and should allow AI to now use almost all of its cities as airbases
- Fixed bug introduced in Unofficial Patch 0.19 causing bombers to skip their turns whenever an interceptor was around
- Many improvements to better handle damaged planes in threatened cities
- Added two functions for defensive airstrikes to make both air defense and offense units more directly aid in defending cities from enemy stacks
- AI air defense units wake from airpatrol every turn, re-decide roles/need
- AI air defense units now consider how many other air defense units there are in the city and guarantee air defense
- Air defense units with Interceptor promotions now will be more likely to patrol when city is threatened
- Added new function for weighting bases for attack air units with new consideration for supporting offensive stacks and defending endangered cities, plus keeping planes safe from sneak attacks when at peace
- When at war forts are now more likely to be used as offensive bases, though cities are still preferred
- AI will again consider basing attack planes in teammate's territory (plot defense considerations effectively disabled this in many circumstances in earlier versions of mod)
- AI will now consider basing attack planes in vassal territory, though it will only use them if it owns no good base cities or forts itself
- Attack air units will now pull out of cities/forts if the defenders leave
- Airstrikes will no longer target enemies in adjacent territory when the territory is only adjacent to owned water tiles
- Fighters now always move before bombers, they're much better at taking on enemy fighters
- New function in CvPlot to count how many air units are running intercept missions already
- Added emphasis for both offensive and defensive units on the the players primary area
- If nearby enemies have no attack aircraft, fewer units are needed for air defense (freeing up fighters to make air strikes). Only applies to players the AI is actually at war with, so their sneak attack preparations remain the same.
Unit AI
- AI will skip bombarding and go straight to attacking cities when it has good initial attack odds and a big strength advantage
- Stranded units with nothing to do will wait once someone is coming to get them instead of mindlessly patrolling
- Stranded settlers will now wait if someone is coming to get them instead of just scrapping after 20 turns
- Attack unit stacks will now break up when assigned to defend workers so that some of the units can do other things (protect other workers, get in transports)
- Units set to UNITAI_ATTACK will now get in transports instead of aimlessly patrolling when player is preparing invasion force
- If attack_city units cannot reach an enemy city while in land war, they will try airlifts and then load into boats
- Tweaked circumstances where attack units load into transports to encourage filling up boats
- Fixed discrepancy where attack units could group with settlers and then get in boats but were highly unlikely to get in boats with waiting settlers
- Speed up to AI_group so it loops over selection groups instead of units
- Attack units now do a bit better of defending cities in the new world if the AI hasn't sent/built enough city defense units yet
- Removed blanket block for loading transports when in land war, now handled by specific unit ai logic
- Tweaked loading of Counter units (Axemen, etc) onto boats to integrate with other changes
- Removed redundant logic from counter ai routine
- If an attack city stack is not big enough to go out on its own, but has enough units coming to join it, it will wait instead of traveling a long way to join another forming stack
Barbarian AI
- Barb ships will now often blockade cities for a few turns before moving on if they have no nearby targets
- Barb ships trapped by ice or around 1-tile islands are now removed so more can spawn
- Barb ship spawn rate throttled so they don't swamp the seas before players build navies
- Improved barb ship blockade decisions so they stick around for a while but will then should actually move to another area
- Barb ships less suicidal, more oppurtunistic
- Reduced range in which barb ships detect unprotected resources by 25%
- Barbarians now will build defenders in captured cities first, not buildings
Pirate AI
- Privateers now prefer moving outside of other teams territory and enter at the last moment for a quick strike
- Fixed issue with AI Privateers being unable to group, also won't run around the whole world just to group
General AI
- Modified city closeness calculations to use population from both cities, not just pop of the other city
- Created functions for determining when cities share the same water area (lake, ocean)
- Removed the unused partial implementation of a new A* solver for closeness
- A bonus which enables the civ's unique unit is now valued more
- Added function to calculate plot strength of teammates and (if desired) vassals
- AI will now be more likely to sacrifice green units when assaulting a well-defended city
- AI will now be reluctant to sacrifice units with medic promotions when assaulting a well-defended city
- Created function PUF_isAvailableGroupHeadUnitAIType for counting number of unit ai's on a plot which might actually load onto a transport (aren't in another group, aren't already cargo)
- Created two path finding flags to weight paths towards avoiding enemy territory, useful for minimizing exposure of attack stacks, loaded transports, or privateers to enemy attack
- Created function to approximate how long it will take for a stack to bombard city defenses to 0
Combat Mechanics
- Modification for air v air combat to make veteran units more valuable, especially when wounded. Air v air combat is now more much more similar to land combat. This change can be disabled/enabled using BBAI_AIR_COMBAT in GlobalDefinesAlt.xml
XML changes
- Increased WAR_SUCCESS_CITY_CAPTURING from 10 to 25, AI now feels more like it's winning/losing based on city gain/loss
Customization
- Added GlobalDefinesAlt.xml to mod files to allow some customization of what new features are running
Debug
- Added SDK and adapted python code from AIAutoPlay mod to faciliate testing
- Modified debug mode output to show relevant information for these developments
- Added string to lower right flag help text showing Better BTS AI version number currently running
- Added SDK and adapted python code from ChangePlayer mod to facilitate testing
- Added new Python module Tester for testing purposes
- Updated ChangePlayer SDK pieces to fully redraw units
- Brought over war decision debug output from Warlords version of Better AI, updated for BTS logic
Better BTS AI also includes Dresden & Solver's unofficial 3.17 patch version 0.21.
One of the next pushes will be have the AI reinforce or ferry troops once it has a beachhead in invasion scenarios, something which it doesn't do explicitly right now.
There are a lot of smaller tweaks and changes spread out throughout the code in this version compared to prior, more focused releases. The one big block of changes are to how the AI chooses to vote on AP/UN proposals, particularly for ending a war. The AIs war tactics have also been tweaked, stacks without much bombard strength now prefer cities with low defenses and the AI will now minimize how many turns attack stacks and transports spend in enemy territory so they don't get counter attacked or give as much advance warning. Several reported bugs or odd behavior have been addressed, including issues with fired global event triggers not being set for new players, AI building boats in ice locked cities, AI not building workboats to get resources in small lakes, and unnecessary use of fighters for air patrolling when enemies don't have aircraft yet.
Better BTS AI v0.50 Changelog
_________________________
Spoiler :
Bugfix
- Fixed bug in player closeness calculations causing the AI to be blind to its actual proximity to other players
- Fixed bug with needed defenders where the AI would choose to defend a recently captured holy city less than a normal city
- Fixed bug causing player ID to be used in place of actual attitude when checking for denials in bonus, civic, and religion trading
- Fixed bug in paradrop code causing AI to avoid paradropping onto terrain bonuses under certain circumstances
- Fixed bug in AI denial of switching civics when in Emancipation
- Fixed bug introduced in unofficial patch causing immunity to collateral damage
- Fixed bug with espionage mission to spread culture to an enemy city
- Fixed bug causing combat promotions to be counted twice for aircraft
- Fixed bug (introduced) in consideration of plot defense when selecting bases for offensive air units
- Fixed bug (introduced) causing crashes if there was an unowned fort on the map
- Fixed bug in unit AI type matching for retreating emptied transports
- Fixed bug in unit AI's determing if a transport had required space to hold them where they didn't consider other units intending to load
- Fix for naval blockades reaching across land, including across diagonal water tiles (fixed both actual range and graphically shown range)
- Fixed bug (introduced) caused by different fixes to the espionage mission to spread culture in this mod and the Unofficial Patch
- Fixed bug in use of unit type instead of UNITAI type when retreating assault transports after drop-off in certain circumstances
- Created CvPlayer::initInGame to fix several problems with using CvPlayer::init in CvGame::addPlayer, including global event triggers reseting for new player and city culture, revealed plots, plus other data not reseting when overwriting old player
- Fixed bug where AI would use total war boolean when checking whether to do limited war despite poor finances
War strategy AI
- Modified how closeness is used for determining who to attack, different settings for regular and Aggressive AI
- Created new function CvTeamAI::AI_calculateBonusWarValue so AI will consider declaring war for resources, weighted towards resources AI doesn't have and plots that are more easily captured
- Modified city attack targetting by terrain bonuses to consider how important bonus is to AI
War tactics AI
- Attack city stacks will now reduce the distance they travel in enemy territory so the enemy has less time to prepare or hit them with suicide siege
- Attack stacks with decent initial odds and big troop advantage will skip bombarding and just attack (so enemy can't restock)
- Attack stacks without much bombard power will now prefer to go after cities with low defense modifiers, effect reduced after AI can build bombers
- Attack stacks without much bombard power are a little bolder in attacking city before defenses are lowered to 0, though they will bombard a few turns to make sure bombers and ships can get some shots in
- Loaded transports coming in for an invasion will now usually move outside opponents territory and adjacent tiles to up surprise factor and reduce exposure to attacks before landing
City AI
- AI will now more likely fill empty transports when enagaged in transcontinental war, making reinforcements and second waves on invasions more likely
- When doing invasions, AI will now be more likely to have cities with free air experience fill vacancies on carriers
- When doing invasions, AI will now have cities with high production more often fill needs for aircraft carriers
- When doing invasions, if AI has at least 50% of its possible missile capacity it will no longer always build missiles
- Rewrote CvCityAI::AI_isAirDefended so that it considers unit damage, movement, AI type and can also count land units
- Normal workboat build blocked if there's an enemy sea unit camping outside city
- Coastal cities will now build boats as if planning a sea invasion if there is no route to enemy cities
- Improved handling of building troops to fill transports, unified between coastal and non-coastal cities
- Non-coastal cities now help fill carriers, missile carriers
- The AI was blocked from building attack troops if it felt it was unable to build good ones, now if it is at war it can build them but with low probability so it can fight back a little early in the game
- AI will now emergency build fighter planes if its air defenses are shot down but it still has lots of bombers and missiles
- If not critical, AI will let cities with high production or free air experience usually build most planes
- Cities with military production bonuses now a bit more likely to build military units
- AI will now always build some assault transports if it has significant overseas colonies to help defend them
- AI will now build reserve sea units to defend its settler transports in later eras
- Reduced construction of escorts that are weaker than the transports they would be escorting (Caravels escorting Galleons primarily)
Worker AI
- Fix issue where AI would not build workboats to make use of resources in small lakes (was blocked because it felt lake was not relevant militarily)
Espionage AI
- When a spy has waited in a city but has no mission available, they are now more likely to move around and explore instead of sitting
- Revamped desired Espionage rate and priority weighting calculations, AI now always update weights, relations play a larger role
- Neutral priority weighting is now 10 instead of 0, differentiates between
- When AI starts preparing for war against another player they will heavily shift their espionage spending towards that player
- AI will attempt to gain passive mission levels against adversaries
- AI will now actually load spies onto the spy transport it builds
Gold AI
- AI now has a budget for troop upgrades each turn based on how much gold it wants to have, it won't spend more than this budget on non-critical units when at peace
- AI now prioritizes upgrading escort ships to same extent as transports
Diplomacy AI
- Removed blanket acceptance of all proposals by secretaries the AI is friends with, now just auto accept less strategic proposals like extra trade routes
- Being friends with secretary now influences civics and other strategic proposals
- AI now more likely to defy civic proposals which are bad for it, particularly on Aggressive AI
- Reworked AI voting on forced peace, added thresholds so winning/losing calculations are more meaningful (no longer losing a war in which no units have fought, unless being dogpiled)
- For forced peace proposals, added considerations for whether peace team is winning or losing big
- AIs which are third parties to the war in question may now vote to continue it for selfish reasons (share wars with peace team, are planning to attack peace team)
- AI will now only defy forced peace if it is doing quite well in the war,
increased use of personality so warmongers are much more likely to defy
- Vassals will now vote for forced war proposal under some circustances. Previously they were blocked from voting for a war they weren't already in since they can't declare war on their own. (Vassals of player to be attacked always vote no still)
- AI will now always vote for a forced war proposal against a player they are planning to attack anyway in addition to always voting yes if already at war
- For forced war vote, replaced blanket check on whether AI doesn't hate victim with roll based on AI's attitude-based peace probability
Naval AI
- Modified bombard behavior. Priority remains on supporting player's ground troops, if none then consider supporting other troops with common enemy and spreading out stacks to increase reach of blockade.
- Modified and expanded Solver's changes to retreat from city/fort AI to be more specialized for various unit AI types, only move if there's a real threat
- Increased city danger threshold so enemy ships do not runaway so easily
- Damaged ships will stay in city unless city is highly threatened
- Galleons assigned escort roles before Frigates are available will now change their UnitAI type to assault transport instead of getting stuck in their role after better escorts come along
- Transport ships waiting in port will now only unload their cargo during a land war if an enemy city can be reached by land, the player is on the defensive locally, or a stack of enemy units shows up. Increases naval invasions of distant enemies on Pangea maps, sea assaults to complement land assaults.
- Assault flotillas now leave behind empty transports
- Assault ships now assume cities whose defenses the player can't see are properly defended (previously counted as a single defender). Should make invasions more likely to occur near blockades, attack ships, prior invasions.
- AI will now try to break blockades if it has many attack ships in port
- Transports will now pickup units stranded on small islands
- Transports looking for cargo to pickup now use PUF_isAvailableGroupHeadUnitAIType instead of just counting unit ai types, should stop assault transports from waiting forever for units attached to a settler to load or waiting forever on small islands for units already in their cargo to load
- EscortAI units will now also shadow settler_sea units when there is nothing else to do
- Added a pathlength consideration to AI_pickup so that mostly loaded flotillas don't sail around the world to pickup one more unit (previously they would have waited trying to load the units they already had on board until someone else came around)
- SettlerSea transports now only run pickup if they're not full (another change necessary since transports no longer try to pickup the units they're already holding)
- Modified CvUnitAI::AI_shadow to optionally ignore units in cities, far away
- Reserve sea units will now prioritize shadowing settler transports out at sea even if they're empty
- Attack sea units won't run around the world to shadow transports and carriers
- Slow escorts (Caravels mainly) will now protect large flotillas instead of doing nothing
- Escorts with nothing to do will now return to the primary area if it's not too far away so that primary area city production decisions take them into consideration
- If a settler transport if full of workers but has nowhere to take them, it will now dump the cargo if an available settler comes along
Air AI
- Modified and expanded Solver's changes to retreat from city/fort AI to be more specialized for various unit AI types, only move if there's a real threat
- Increased city danger threshold so enemy aircraft do not retreat so easily
- Attack planes in endangered cities will now more likely to airstrike attackers
- Improved code for defense planes in endangered cities so they stay to defend longer and either airstrike or patrol
- Improved efficiency of danger threshold check for ships and planes
- Improved code for moving planes to offensive or defensive bases to take city threat into account
- AI bombers will no longer consider basing in undefended forts even if the fort is unthreatened
- AI bombers will now consider moving to a city with two defenders (down from requiring 3), change made because of added threat logic and should allow AI to now use almost all of its cities as airbases
- Fixed bug introduced in Unofficial Patch 0.19 causing bombers to skip their turns whenever an interceptor was around
- Many improvements to better handle damaged planes in threatened cities
- Added two functions for defensive airstrikes to make both air defense and offense units more directly aid in defending cities from enemy stacks
- AI air defense units wake from airpatrol every turn, re-decide roles/need
- AI air defense units now consider how many other air defense units there are in the city and guarantee air defense
- Air defense units with Interceptor promotions now will be more likely to patrol when city is threatened
- Added new function for weighting bases for attack air units with new consideration for supporting offensive stacks and defending endangered cities, plus keeping planes safe from sneak attacks when at peace
- When at war forts are now more likely to be used as offensive bases, though cities are still preferred
- AI will again consider basing attack planes in teammate's territory (plot defense considerations effectively disabled this in many circumstances in earlier versions of mod)
- AI will now consider basing attack planes in vassal territory, though it will only use them if it owns no good base cities or forts itself
- Attack air units will now pull out of cities/forts if the defenders leave
- Airstrikes will no longer target enemies in adjacent territory when the territory is only adjacent to owned water tiles
- Fighters now always move before bombers, they're much better at taking on enemy fighters
- New function in CvPlot to count how many air units are running intercept missions already
- Added emphasis for both offensive and defensive units on the the players primary area
- If nearby enemies have no attack aircraft, fewer units are needed for air defense (freeing up fighters to make air strikes). Only applies to players the AI is actually at war with, so their sneak attack preparations remain the same.
Unit AI
- AI will skip bombarding and go straight to attacking cities when it has good initial attack odds and a big strength advantage
- Stranded units with nothing to do will wait once someone is coming to get them instead of mindlessly patrolling
- Stranded settlers will now wait if someone is coming to get them instead of just scrapping after 20 turns
- Attack unit stacks will now break up when assigned to defend workers so that some of the units can do other things (protect other workers, get in transports)
- Units set to UNITAI_ATTACK will now get in transports instead of aimlessly patrolling when player is preparing invasion force
- If attack_city units cannot reach an enemy city while in land war, they will try airlifts and then load into boats
- Tweaked circumstances where attack units load into transports to encourage filling up boats
- Fixed discrepancy where attack units could group with settlers and then get in boats but were highly unlikely to get in boats with waiting settlers
- Speed up to AI_group so it loops over selection groups instead of units
- Attack units now do a bit better of defending cities in the new world if the AI hasn't sent/built enough city defense units yet
- Removed blanket block for loading transports when in land war, now handled by specific unit ai logic
- Tweaked loading of Counter units (Axemen, etc) onto boats to integrate with other changes
- Removed redundant logic from counter ai routine
- If an attack city stack is not big enough to go out on its own, but has enough units coming to join it, it will wait instead of traveling a long way to join another forming stack
Barbarian AI
- Barb ships will now often blockade cities for a few turns before moving on if they have no nearby targets
- Barb ships trapped by ice or around 1-tile islands are now removed so more can spawn
- Barb ship spawn rate throttled so they don't swamp the seas before players build navies
- Improved barb ship blockade decisions so they stick around for a while but will then should actually move to another area
- Barb ships less suicidal, more oppurtunistic
- Reduced range in which barb ships detect unprotected resources by 25%
- Barbarians now will build defenders in captured cities first, not buildings
Pirate AI
- Privateers now prefer moving outside of other teams territory and enter at the last moment for a quick strike
- Fixed issue with AI Privateers being unable to group, also won't run around the whole world just to group
General AI
- Modified city closeness calculations to use population from both cities, not just pop of the other city
- Created functions for determining when cities share the same water area (lake, ocean)
- Removed the unused partial implementation of a new A* solver for closeness
- A bonus which enables the civ's unique unit is now valued more
- Added function to calculate plot strength of teammates and (if desired) vassals
- AI will now be more likely to sacrifice green units when assaulting a well-defended city
- AI will now be reluctant to sacrifice units with medic promotions when assaulting a well-defended city
- Created function PUF_isAvailableGroupHeadUnitAIType for counting number of unit ai's on a plot which might actually load onto a transport (aren't in another group, aren't already cargo)
- Created two path finding flags to weight paths towards avoiding enemy territory, useful for minimizing exposure of attack stacks, loaded transports, or privateers to enemy attack
- Created function to approximate how long it will take for a stack to bombard city defenses to 0
Combat Mechanics
- Modification for air v air combat to make veteran units more valuable, especially when wounded. Air v air combat is now more much more similar to land combat. This change can be disabled/enabled using BBAI_AIR_COMBAT in GlobalDefinesAlt.xml
XML changes
- Increased WAR_SUCCESS_CITY_CAPTURING from 10 to 25, AI now feels more like it's winning/losing based on city gain/loss
Customization
- Added GlobalDefinesAlt.xml to mod files to allow some customization of what new features are running
Debug
- Added SDK and adapted python code from AIAutoPlay mod to faciliate testing
- Modified debug mode output to show relevant information for these developments
- Added string to lower right flag help text showing Better BTS AI version number currently running
- Added SDK and adapted python code from ChangePlayer mod to facilitate testing
- Added new Python module Tester for testing purposes
- Updated ChangePlayer SDK pieces to fully redraw units
- Brought over war decision debug output from Warlords version of Better AI, updated for BTS logic
Better BTS AI also includes Dresden & Solver's unofficial 3.17 patch version 0.21.
One of the next pushes will be have the AI reinforce or ferry troops once it has a beachhead in invasion scenarios, something which it doesn't do explicitly right now.