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.)
Version 1.00![Party [party] [party]](/images/smilies/partytime.gif)
This is version 1.00 because it has a compilation of several big new systems that I've been working on for a while, and a giant leap forward for the BTS AI. Here's just a couple of highlights:
I'm not sure if work on the AI could every really be finished, and certainly there are some big things I'd still like to do (centralized wonder selection, nuke decision making, tech selection system). However, usually when I package up a release I immediately start thinking about the next important piece. This release has come far enough that I think I'll pause and play through a couple whole games myself ... that was very hard to do when all I would see were AI weaknesses and deficiencies, but the project really has made immense progress and I think I might actually be able to play through a whole game or two.
Since this is a big milestone, I'd also like to thank and acknowledge a few fellow modders who helped make this a reality one way or another. Much credit goes to Blake and Iustus who really pioneered fan-developed AI, Blake's work made a huge impact on the Civ4 AI leading up to BTS and his example was one inspiration for this project. Also special thanks to Yakk and glider1 for batting around ideas to fix the original closeness bug which really got this all started. I would also like to thank the others who one way or another helped me get into modding, taught me some useful tricks, or otherwise helped make the last four years of Civ modding such a great experience: Kael, Solver, TheLopez, DrElmerGiggles, Dom Pedro II, EmperorFool, glider1, phungus420. And, of course, this mod would not be where it is today without the great community here on the forum and everyone who has posted bugs, ideas, and engaged in our discussions. Thank you!
Enjoy!
New in Better BTS AI 1.00
Merged in Unoffical Patch 1.50
Added the Lead From Behind mod 1.2 by UncutDragon (improves selection of order for attack for both human and AI stacks, preserving GG, medics, experienced units)
Added CIV4LeaderHeadInfos.xml and CIV4CivilizationsSchema.xml to mod files for new victory strategy system
Bugfix
- Fixed divide by 0 issue with debug text which could cause crashes in debug logging when loading world builder scenarios using a non-Final_Release DLL
- Fixed bug (introduced) where giving pillage orders to a stack or multi-move unit would pillage multiple times
- Fixed bug (introduced) allowing ships to move diagonally over isthmuses under some circumstances
- Fixed bug (introduced) slowing AI expansion, especially on Archipelago maps
- Fixed bug where AI units could sleep indefinitely when using debug tools like ChangePlayer and AIAutoPlay
- Fixed issues with rounding off small commerce amounts leading to AI or governor working suboptimal tiles/specialists in some circumstances (reported by Caboose)
- Fixed bug in calculation of city closeness where city would consider its closeness to itself, so cities can now properly tell when they are close to other cities in their owner's empire (should now see more AI city razing)
Victory Strategy AI
- Switched all cultural victory logic to new victory strategy framework
- AIs gunning for cultural victory now much less likely to declare war the closer they get, biggest reduction for TOTAL war, smaller reduction for DOGPILE
- AIs in late stages of cultural victory more willing to agree to peace
- Updated close to cultural victory detection so that AIs who haven't been trying but get reasonably close will pursue it, and so that they can detect when human player is pursuing this strategy
- First complete implementation of AI victory strategy framework for Conquest, Domination, Space, and Diplomacy
- Levels 3 & 4 of each victory strategy are now based on observables, not hidden AI leader tendencies. So, other AIs can now understand when other AIs are going for a particular victory, and it also serves as an estimate of what the human player is doing.
- AIs going for CONQUEST and DOMINATION victories willing to spend more gold on units
- Improved existing system for AI going for DOMINATION to build health buildings to help boost pop
- AIs going for culture/space now put defensive spies in important cities
War strategy AI
- AI now detects when other players are close to victory and greatly boosts start war value against them (still plays within leader's attitude no war probabilities, so won't declare on friendly)
- If enemy is (still) running higher levels of CULTURE or SPACE victory, AI will not accept capitulation until it ruins the enemies chance of winning
- AIs running highest levels of CONQUEST and DOMINATION strategies may ignore leader's attitude no war probabilities and attack highest value target
- AI calculations of the state of their wars now work better with minor civs (for mods)
- Smoothed AI valuation of how much bombard strength it needs to build for its attack stacks, upped desired bombard strength in era of walls and castles. AI should now produce considerably more siege, especially the bigger AIs.
- Reduced AI valuation of interception probability as criteria for UNITAI_COUNTER units, to reduce drive to switch infantry to SAM
- AI now won't start air blitz build logic until it can build bombers (previously started with fighters)
- Added AI_STRATEGY_ALERT1 and AI_STRATEGY_ALERT2, AI will now analyze if it might be attacked in the near future and take pre-emptive action
- AI now generates extra defence in its high culture cities a bit earlier when going for cultural victory
- Removed some of the reductions to defender builds when AI is running AI_STRATEGY_GET_BETTER_UNITS (should help AI defend itself early in game)
- Added AI_STRATEGY_TURTLE implementation, if AI is badly outgunned and either recently attacked or losing badly, it will use any offensive stacks it has for defense and go into a defensive survival shell
- AI now plans ahead to counter units of enemies it is preparing for war against based on what it can see
- Added function so AI can calculate the air power of its rivals
- Corrected AI valuation on interception abilities for UNITAI_COUNTER units so that it doesn't switch Infantry to SAM until rivals have air units
- Adjusted Dagger and Crush strategy thresholds so if AI has started them it is more likely to keep them up
- AI will not do Crush if also doing ALERT2
- AI will now better defends its first few cities after invading a rivals continent
- Reduced effect of having vassals on AI aggressiveness (victory strategies replace this)
- AIs at war and looking for second front now adjusts it's power down for current enemies, and prefers weaker opponents
- AI will now always start last stand strategy after it launches space ship, even if other players haven't launched yet
- AI now much more willing to start final war strategy if enemy launches spaceship, if either Aggressive AI is on or AI is close to winning itself
- Vastly sped up AI war planning/declaration process in end of game situations, particularly enemy spaceship launch
- AI now targets cultural victory cities, capital if enemy is going for space
War tactics AI
- Tweaked AI_finalOddsThreshold to reduce suicide attacks in stack v stack combat, especially at sea
- Reworked AI logic for when to raze cities it conquers
- Rewrote logic in AI_attackCityMove so AI stacks behave more intelligently around enemy cities, will pillage if not strong enough to attack or choke from defensive terrain if outgunned
- AI carriers will now move to support/air defend ground troops, support invasions
- AI now values active wonders a little more in deciding cities to target
- Fixed bug where AI would over value holy cities of religions other than its state religion
- Upped threat cities feel when they are next to much more powerful rivals
- The strategy FAST_MOVERS no longer limits the AI from forming main stacks of mixed fast and slow units, but it will still form small fast attack groups
- Augmented the strategy LAND_BLITZ, a more restrictive case of FAST_MOVERS, so that main stacks will be made of multi-move units when possible in the modern era
- Fixed bug blocking under many circumstances AI from using logic to attack without bombarding when bombarding will take a long time
- Fixed bugs in AI calculations of how many turns they need to bombard defenses
- AI will now pillage with healthy, fast, non-bombard units in stack first
- AI will now pillage plot it is on before bombarding city (since need to bombard means there's a chance it won't take city)
- AI_choke now works better for multiple units if head unit is no defensive bonus, won't accidentally attack enemy units
- Added function for AI attack stacks to pillage around target city to buy time if not strong enough to attack. Favors pillaging defensive terrain
- AI attack stacks load in transports if land path is too long
- Added option to AI_anyAttack to block attacking cities
- Attack city stacks will now considering taking transports if overland path is long
- Tactical nukes retreat better from cities when threatened
- AI now moves missles safely
- Fixed issues causing AI to rebase missles into empty forts
- AI attack stacks now do not head out for conquest unless they have some non-seige units which can capture cities
- AI attack stacks will wait for unit upgrades before heading out for conquest (helps most when AI has just been surprise attacked)
- AI attack units will now more readily band together in threatened cities and go after enemy units applying a choke
Unit AI
- Greatly improved speed and turn efficiency for loading of large stacks onto many transports
- AI pillage units now value healing in enemy territory more
- AI should now promote a few more units to medics
Naval AI
- Assault transports no longer set off to join transport groups already mounting assaults
- When assault transports head out for invasion, other transport groups which were going to join them will now pick a new mission
- Improved handling for when multiple transports are moving to pickup a stack of stranded units, the closest set of transports will now get the task
- Loaded transports with no escorts now try to join a local flotilla first
- Loaded transports with no escorts will now wait if there are waiting escorts on the same plot (catches case where transport just got troops loaded last turn, takes off before escorts can react)
Pirate AI
- Reduced suicide of pirateers starting from inside their own borders
Worker AI
- Fixed several issues and improved efficiency of CvUnitAI::AI_nextCityToImprove
City AI
- When at war, AI now is less zealotful in building production buildings. They have to be able to be completed faster, and it will only start them probabilistically so not all cities will be building them at once
- Improved AI city build decisions when empire is under seige, especially for small empires
- Added calculations of actual health/happy effects of buildings from BUG mod (thanks EmperorFool)
- Fixed logic bugs in AI valuation of when happy or healthy from buildings was extra important
- AI now actually considers health effects of power, dirty power, coal, and oil
- Reworked AI valuation of buildings with health effects so all effects are considered
- Buildings with negative health effects are now strongly avoided if city has health problems
- AI now better evaluates when building bAreaCleanPower building is useful
- Reworked AI valuation of buildings with happiness effects so all effects are considered
- Buildings with negative happiness effects are now strongly avoided if city has happiness problems
- AI now values buildings which reduce war weariness, previously only avoided buildings which increased it
- AI now values religious buildings for AP religion more than other relgious buildings based on boosted yield
- AI now values religious buildings for state religion more than other religious buildings based on yield boosts from wonders
- Tweaks to help AI build mobile defense/counter attack force when outgunned
- Lowered max build turn limit for high priority production buildings when AI is in a tough war
- AI will now probably only build one workboat using very early capital logic as originally intended (speeds expansion in water resource heavy starts)
- Resolved issues where AI early game build logic would get confused because Warriors cannot be built as UNITAI_CITY_DEFENSE
- Improved AI logic for when to conscript defenders, AI now conscripts less unless it is in dire situation. Tied in with TURTLE strategy
- AI now will build more attack units to break a choke
- Fixed issue where AI cities with lots of food available would not avoid growth when angry under some circumstances
Tech AI
- Separated out building and unit valuation into own function for debugging and future efforts
- Adjusted valuation of tech based on units enabled, boost to defensive units under ALERT and TURTLE and offensive when going for conquest victory
- AIs going for DOMINATION victory will aim for Galleons earlier
- AIs going for SPACE emphasize getting Apollo earlier
- AIs with Apollo now better emphasize getting techs for parts
- AIs with high odds of starting a total war now value units as if always at war
Civic AI
- If AI is leader of AP, it now values state religion civics more
- AI now values benefits it receives from wonders for state religion buildings when computing value for state religion civics
- AIs with high odds of starting a total war now stay in militaristic civics during short peace intervals
- AIs will now more often stay with peaceful civics when engaged in wars they're not really committed to, not losing
Diplomacy AI
- All AIs will check more frequently for tech trades when well behind in tech race, biggest benefit for those who typically wait longest
Gold AI
- Improved AI budgeting for unit upgrades in scenarios, advanced start
Missionary AI
- Fixed issues and improved logic in AI usage of MISSIONARY strategy (religious full-court press)
Great People AI
- AI Great Generals will no longer lead units which can't kill enemy units such as catapults
- Great Generals are always willing to lead units whose class has MaxGlobalInstances set regardless of UNITAI (for mods)
Barbarian AI
- No barb stacks sitting on goody huts, only single units
- If barbs have upper hand in an area (like new world), then they'll group stacks more actively
General AI
- Changed player consistent random method for picking strategies from being based on capital city location to a stored rand, so AI player tendencies will be consistent even if capital moves
- Changed how building defense is handled when unit is estimating its defensive strength against unknown attacker (CvUnit::maxCombatStr(pPlot,NULL)). Firaxis took conservative approach and always ignored defense in this case (so defensive strength could be considerably higher in castled low culture city). This lead to AIs suiciding stacks on city walls in early/mid game. New method is to use ignoreBuildingDefense flag of defender which should have fewer fatal side effects.
Player Interface
- Added automate explore option for spies
Efficiency
- Several efficiency improvements were added with Lead From Behind
- Improved efficiency of several unit motion selection loops, reducing number of calls to generatePath
Customization
- Split GlobalDefinesAlt.xml into a few separate files by type
- Improved handling of default values for new BBAI variables in case xml files are accidentally missing or something
- Tweaked variables for AI stack attacks of cities to reduce suicides
- Added BBAI_TURTLE_ENEMY_POWER_RATIO to BBAI_AI_Variables
- Added BBAI_VICTORY_STRATEGY_CONQUEST, etc to BBAI_Game_Options so that you can turn off any parts of the new AI playing to win logic that you wish. The code already checks for whether the victories are enabled or blocked by other things like the always peace option, so this is really just for if you don't like how it plays for some reason.
- Changed BBAI_ALLIANCE_OPTION to BBAI_DEFENSIVE_PACT_BEHAVIOR, now has three options
CvUnitInfos.xml
- Returned UNITAI_CITY_DEFENSE to Roman Praetorians
- Returned work boats to original tags of military support (exploit) and military production (faster with drydock) (thanks Fuyu)
CIV4LeaderHeadInfos.xml
- Added new AI weights for five victory strategies
![Party [party] [party]](/images/smilies/partytime.gif)
![Party [party] [party]](/images/smilies/partytime.gif)
This is version 1.00 because it has a compilation of several big new systems that I've been working on for a while, and a giant leap forward for the BTS AI. Here's just a couple of highlights:
- New victory strategy system, so AI actually goes for conquest and space victories
- Major overhaul of AI city attack stack logic and ability to defend itself
- AI now weighs having stacks walk or sail in transports
- Lead from Behind 1.2 added to help AI preserve key units
- And a lot more ...
I'm not sure if work on the AI could every really be finished, and certainly there are some big things I'd still like to do (centralized wonder selection, nuke decision making, tech selection system). However, usually when I package up a release I immediately start thinking about the next important piece. This release has come far enough that I think I'll pause and play through a couple whole games myself ... that was very hard to do when all I would see were AI weaknesses and deficiencies, but the project really has made immense progress and I think I might actually be able to play through a whole game or two.

Since this is a big milestone, I'd also like to thank and acknowledge a few fellow modders who helped make this a reality one way or another. Much credit goes to Blake and Iustus who really pioneered fan-developed AI, Blake's work made a huge impact on the Civ4 AI leading up to BTS and his example was one inspiration for this project. Also special thanks to Yakk and glider1 for batting around ideas to fix the original closeness bug which really got this all started. I would also like to thank the others who one way or another helped me get into modding, taught me some useful tricks, or otherwise helped make the last four years of Civ modding such a great experience: Kael, Solver, TheLopez, DrElmerGiggles, Dom Pedro II, EmperorFool, glider1, phungus420. And, of course, this mod would not be where it is today without the great community here on the forum and everyone who has posted bugs, ideas, and engaged in our discussions. Thank you!
Enjoy!
New in Better BTS AI 1.00
Spoiler :
Merged in Unoffical Patch 1.50
Added the Lead From Behind mod 1.2 by UncutDragon (improves selection of order for attack for both human and AI stacks, preserving GG, medics, experienced units)
Added CIV4LeaderHeadInfos.xml and CIV4CivilizationsSchema.xml to mod files for new victory strategy system
Bugfix
- Fixed divide by 0 issue with debug text which could cause crashes in debug logging when loading world builder scenarios using a non-Final_Release DLL
- Fixed bug (introduced) where giving pillage orders to a stack or multi-move unit would pillage multiple times
- Fixed bug (introduced) allowing ships to move diagonally over isthmuses under some circumstances
- Fixed bug (introduced) slowing AI expansion, especially on Archipelago maps
- Fixed bug where AI units could sleep indefinitely when using debug tools like ChangePlayer and AIAutoPlay
- Fixed issues with rounding off small commerce amounts leading to AI or governor working suboptimal tiles/specialists in some circumstances (reported by Caboose)
- Fixed bug in calculation of city closeness where city would consider its closeness to itself, so cities can now properly tell when they are close to other cities in their owner's empire (should now see more AI city razing)
Victory Strategy AI
- Switched all cultural victory logic to new victory strategy framework
- AIs gunning for cultural victory now much less likely to declare war the closer they get, biggest reduction for TOTAL war, smaller reduction for DOGPILE
- AIs in late stages of cultural victory more willing to agree to peace
- Updated close to cultural victory detection so that AIs who haven't been trying but get reasonably close will pursue it, and so that they can detect when human player is pursuing this strategy
- First complete implementation of AI victory strategy framework for Conquest, Domination, Space, and Diplomacy
- Levels 3 & 4 of each victory strategy are now based on observables, not hidden AI leader tendencies. So, other AIs can now understand when other AIs are going for a particular victory, and it also serves as an estimate of what the human player is doing.
- AIs going for CONQUEST and DOMINATION victories willing to spend more gold on units
- Improved existing system for AI going for DOMINATION to build health buildings to help boost pop
- AIs going for culture/space now put defensive spies in important cities
War strategy AI
- AI now detects when other players are close to victory and greatly boosts start war value against them (still plays within leader's attitude no war probabilities, so won't declare on friendly)
- If enemy is (still) running higher levels of CULTURE or SPACE victory, AI will not accept capitulation until it ruins the enemies chance of winning
- AIs running highest levels of CONQUEST and DOMINATION strategies may ignore leader's attitude no war probabilities and attack highest value target
- AI calculations of the state of their wars now work better with minor civs (for mods)
- Smoothed AI valuation of how much bombard strength it needs to build for its attack stacks, upped desired bombard strength in era of walls and castles. AI should now produce considerably more siege, especially the bigger AIs.
- Reduced AI valuation of interception probability as criteria for UNITAI_COUNTER units, to reduce drive to switch infantry to SAM
- AI now won't start air blitz build logic until it can build bombers (previously started with fighters)
- Added AI_STRATEGY_ALERT1 and AI_STRATEGY_ALERT2, AI will now analyze if it might be attacked in the near future and take pre-emptive action
- AI now generates extra defence in its high culture cities a bit earlier when going for cultural victory
- Removed some of the reductions to defender builds when AI is running AI_STRATEGY_GET_BETTER_UNITS (should help AI defend itself early in game)
- Added AI_STRATEGY_TURTLE implementation, if AI is badly outgunned and either recently attacked or losing badly, it will use any offensive stacks it has for defense and go into a defensive survival shell
- AI now plans ahead to counter units of enemies it is preparing for war against based on what it can see
- Added function so AI can calculate the air power of its rivals
- Corrected AI valuation on interception abilities for UNITAI_COUNTER units so that it doesn't switch Infantry to SAM until rivals have air units
- Adjusted Dagger and Crush strategy thresholds so if AI has started them it is more likely to keep them up
- AI will not do Crush if also doing ALERT2
- AI will now better defends its first few cities after invading a rivals continent
- Reduced effect of having vassals on AI aggressiveness (victory strategies replace this)
- AIs at war and looking for second front now adjusts it's power down for current enemies, and prefers weaker opponents
- AI will now always start last stand strategy after it launches space ship, even if other players haven't launched yet
- AI now much more willing to start final war strategy if enemy launches spaceship, if either Aggressive AI is on or AI is close to winning itself
- Vastly sped up AI war planning/declaration process in end of game situations, particularly enemy spaceship launch
- AI now targets cultural victory cities, capital if enemy is going for space
War tactics AI
- Tweaked AI_finalOddsThreshold to reduce suicide attacks in stack v stack combat, especially at sea
- Reworked AI logic for when to raze cities it conquers
- Rewrote logic in AI_attackCityMove so AI stacks behave more intelligently around enemy cities, will pillage if not strong enough to attack or choke from defensive terrain if outgunned
- AI carriers will now move to support/air defend ground troops, support invasions
- AI now values active wonders a little more in deciding cities to target
- Fixed bug where AI would over value holy cities of religions other than its state religion
- Upped threat cities feel when they are next to much more powerful rivals
- The strategy FAST_MOVERS no longer limits the AI from forming main stacks of mixed fast and slow units, but it will still form small fast attack groups
- Augmented the strategy LAND_BLITZ, a more restrictive case of FAST_MOVERS, so that main stacks will be made of multi-move units when possible in the modern era
- Fixed bug blocking under many circumstances AI from using logic to attack without bombarding when bombarding will take a long time
- Fixed bugs in AI calculations of how many turns they need to bombard defenses
- AI will now pillage with healthy, fast, non-bombard units in stack first
- AI will now pillage plot it is on before bombarding city (since need to bombard means there's a chance it won't take city)
- AI_choke now works better for multiple units if head unit is no defensive bonus, won't accidentally attack enemy units
- Added function for AI attack stacks to pillage around target city to buy time if not strong enough to attack. Favors pillaging defensive terrain
- AI attack stacks load in transports if land path is too long
- Added option to AI_anyAttack to block attacking cities
- Attack city stacks will now considering taking transports if overland path is long
- Tactical nukes retreat better from cities when threatened
- AI now moves missles safely
- Fixed issues causing AI to rebase missles into empty forts
- AI attack stacks now do not head out for conquest unless they have some non-seige units which can capture cities
- AI attack stacks will wait for unit upgrades before heading out for conquest (helps most when AI has just been surprise attacked)
- AI attack units will now more readily band together in threatened cities and go after enemy units applying a choke
Unit AI
- Greatly improved speed and turn efficiency for loading of large stacks onto many transports
- AI pillage units now value healing in enemy territory more
- AI should now promote a few more units to medics
Naval AI
- Assault transports no longer set off to join transport groups already mounting assaults
- When assault transports head out for invasion, other transport groups which were going to join them will now pick a new mission
- Improved handling for when multiple transports are moving to pickup a stack of stranded units, the closest set of transports will now get the task
- Loaded transports with no escorts now try to join a local flotilla first
- Loaded transports with no escorts will now wait if there are waiting escorts on the same plot (catches case where transport just got troops loaded last turn, takes off before escorts can react)
Pirate AI
- Reduced suicide of pirateers starting from inside their own borders
Worker AI
- Fixed several issues and improved efficiency of CvUnitAI::AI_nextCityToImprove
City AI
- When at war, AI now is less zealotful in building production buildings. They have to be able to be completed faster, and it will only start them probabilistically so not all cities will be building them at once
- Improved AI city build decisions when empire is under seige, especially for small empires
- Added calculations of actual health/happy effects of buildings from BUG mod (thanks EmperorFool)
- Fixed logic bugs in AI valuation of when happy or healthy from buildings was extra important
- AI now actually considers health effects of power, dirty power, coal, and oil
- Reworked AI valuation of buildings with health effects so all effects are considered
- Buildings with negative health effects are now strongly avoided if city has health problems
- AI now better evaluates when building bAreaCleanPower building is useful
- Reworked AI valuation of buildings with happiness effects so all effects are considered
- Buildings with negative happiness effects are now strongly avoided if city has happiness problems
- AI now values buildings which reduce war weariness, previously only avoided buildings which increased it
- AI now values religious buildings for AP religion more than other relgious buildings based on boosted yield
- AI now values religious buildings for state religion more than other religious buildings based on yield boosts from wonders
- Tweaks to help AI build mobile defense/counter attack force when outgunned
- Lowered max build turn limit for high priority production buildings when AI is in a tough war
- AI will now probably only build one workboat using very early capital logic as originally intended (speeds expansion in water resource heavy starts)
- Resolved issues where AI early game build logic would get confused because Warriors cannot be built as UNITAI_CITY_DEFENSE
- Improved AI logic for when to conscript defenders, AI now conscripts less unless it is in dire situation. Tied in with TURTLE strategy
- AI now will build more attack units to break a choke
- Fixed issue where AI cities with lots of food available would not avoid growth when angry under some circumstances
Tech AI
- Separated out building and unit valuation into own function for debugging and future efforts
- Adjusted valuation of tech based on units enabled, boost to defensive units under ALERT and TURTLE and offensive when going for conquest victory
- AIs going for DOMINATION victory will aim for Galleons earlier
- AIs going for SPACE emphasize getting Apollo earlier
- AIs with Apollo now better emphasize getting techs for parts
- AIs with high odds of starting a total war now value units as if always at war
Civic AI
- If AI is leader of AP, it now values state religion civics more
- AI now values benefits it receives from wonders for state religion buildings when computing value for state religion civics
- AIs with high odds of starting a total war now stay in militaristic civics during short peace intervals
- AIs will now more often stay with peaceful civics when engaged in wars they're not really committed to, not losing
Diplomacy AI
- All AIs will check more frequently for tech trades when well behind in tech race, biggest benefit for those who typically wait longest
Gold AI
- Improved AI budgeting for unit upgrades in scenarios, advanced start
Missionary AI
- Fixed issues and improved logic in AI usage of MISSIONARY strategy (religious full-court press)
Great People AI
- AI Great Generals will no longer lead units which can't kill enemy units such as catapults
- Great Generals are always willing to lead units whose class has MaxGlobalInstances set regardless of UNITAI (for mods)
Barbarian AI
- No barb stacks sitting on goody huts, only single units
- If barbs have upper hand in an area (like new world), then they'll group stacks more actively
General AI
- Changed player consistent random method for picking strategies from being based on capital city location to a stored rand, so AI player tendencies will be consistent even if capital moves
- Changed how building defense is handled when unit is estimating its defensive strength against unknown attacker (CvUnit::maxCombatStr(pPlot,NULL)). Firaxis took conservative approach and always ignored defense in this case (so defensive strength could be considerably higher in castled low culture city). This lead to AIs suiciding stacks on city walls in early/mid game. New method is to use ignoreBuildingDefense flag of defender which should have fewer fatal side effects.
Player Interface
- Added automate explore option for spies
Efficiency
- Several efficiency improvements were added with Lead From Behind
- Improved efficiency of several unit motion selection loops, reducing number of calls to generatePath
Customization
- Split GlobalDefinesAlt.xml into a few separate files by type
- Improved handling of default values for new BBAI variables in case xml files are accidentally missing or something
- Tweaked variables for AI stack attacks of cities to reduce suicides
- Added BBAI_TURTLE_ENEMY_POWER_RATIO to BBAI_AI_Variables
- Added BBAI_VICTORY_STRATEGY_CONQUEST, etc to BBAI_Game_Options so that you can turn off any parts of the new AI playing to win logic that you wish. The code already checks for whether the victories are enabled or blocked by other things like the always peace option, so this is really just for if you don't like how it plays for some reason.
- Changed BBAI_ALLIANCE_OPTION to BBAI_DEFENSIVE_PACT_BEHAVIOR, now has three options
CvUnitInfos.xml
- Returned UNITAI_CITY_DEFENSE to Roman Praetorians
- Returned work boats to original tags of military support (exploit) and military production (faster with drydock) (thanks Fuyu)
CIV4LeaderHeadInfos.xml
- Added new AI weights for five victory strategies