Version 0.41 Discussion Thread

jdog5000

Revolutionary
Joined
Nov 25, 2003
Messages
2,601
Location
California
You can always get the latest stable release here at CFC 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.

This release fixes a crash bug caused by unowned forts in 0.4 plus includes the new 0.21 version of Dresden & Solver's unofficial patch.

Better BTS AI v0.41 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

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

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 or free sea experience 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

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

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

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

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

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

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

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

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

Better BTS AI also includes Dresden & Solver's unofficial 3.17 patch version 0.21.


The next steps are effectively the same as before, with an added request to examine worker behavior specifically related to tearing down villages/towns for other improvements.
 
I often see the AI waiting in front of a city because the AI has not enough siege units. We should tweak the siege unit building behavior. Human players always build more than enough siege units for ultra fast bombard and collateral damage.

(edit: until bombers are available or ships can reduce the defense)
 
At other times, the AI has an OVER abundance of siege, such that it is no time until all the non-siege are kaput and the siege are useless except as XP opportunities.

I get especially irritated when the AI comes invading (like threatening a worker) with a solitary siege unit. And sticks to the hills/forests, which is of NO use to it. Or accompanied by mounted/armor only, but still keeping with the hill/forest terrain.
 
Me too I often see army invasion wayting in front of city because they have only one siege weapon and take more than ten turn to attack the city, during this we have all our time to send an rescue army to this city.

PS: By the way godd job for the air combat :goodjob:

Armand.
 
Glad you're enjoying the air combat, I was very happy how it came together.

I will take a look at the waiting forever to bombard defenses down ... three factors: building the right amount of siege, sending off the attack stack properly, and deciding whether to wait for bombards before attacking with ground troops.
 
In any case, the siege units might as well bombard immediately. There's nothing to gain by waiting, even if an actual attack on the city might be some turns away.
 
This is completely trivial, but would you consider removing the line of equal signs under the mod version in the flag tooltip? If a mod changes the tooltip size, the line wraps. Just add a blank line under the version string.
 
This is completely trivial, but would you consider removing the line of equal signs under the mod version in the flag tooltip? If a mod changes the tooltip size, the line wraps. Just add a blank line under the version string.
Mods can change the width of the hover? How do they do that? It'd be darned useful to increase some of them. :D

I guess I should consider doing the same for the Unofficial Patch since I blatantly copied the way BetterAI does its version string, including the use of the equal signs...
 
I think I found another bug... this time it's not a crash, but just a coastal movement issue.

I'm playing as Julius and Suri is just across the coast from me... I got MC first and launched an attack when he tried to settle an island adjacent to me... the problem I found is that my ships can't enter his water... but his are picking me off routinely in mine... I'm attaching a screenshot showing my blocked coastal movement...

Spoiler :




The save below also shows the problem...

Thoughts?
 

Attachments

  • dpennington AD-0610.CivBeyondSwordSave
    117 KB · Views: 114
I think I found another bug... this time it's not a crash, but just a coastal movement issue.

I'm playing as Julius and Suri is just across the coast from me... I got MC first and launched an attack when he tried to settle an island adjacent to me... the problem I found is that my ships can't enter his water... but his are picking me off routinely in mine... I'm attaching a screenshot showing my blocked coastal movement...

The game is supposed to work that way. The rule is: before astronomy one can enter coastal areas or areas within your own cultural area or areas within the cultural area of someone with whom you have open borders. In this war, your coastal tiles are directly adjacent to his cultural area while his coastal tiles are not directly adjacent to your cultural area. This leads to a disadvantage for you in this war.

It has nothing to do with an AI-advantage or something like that.

You could argue that the design decision to allow ancient ships within your own cultural area (and friendly cultural area) while these tiles are not coastal directly leads to this situation. The best solution that I could quickly think of is to make all tiles up to 2 tiles distant from the coast coastal. But that is something for a gameplay mod and not the BetterAI mod. It would also have various other consequences like more continents would be connected in the ancient age.
 
The game is supposed to work that way. The rule is: before astronomy one can enter coastal areas or areas within your own cultural area or areas within the cultural area of someone with whom you have open borders. In this war, your coastal tiles are directly adjacent to his cultural area while his coastal tiles are not directly adjacent to your cultural area. This leads to a disadvantage for you in this war...

The tiles adjacent to me are ocean within his borders... his (supposedly coastal) ships are entering ocean squares; however, Civopedia clearly says they cannot enter ocean squares. Perhaps 'pedia is wrong here...

The bottom line is that his ships are moving into my territory and back into his while mine can't. Asymmetrical rules like this need fixing; why is it sane for his ships to be able to sail from my coast back to his, when my ships can't do the same? Changing (formerly ocean) tiles two squares from land into coastal tiles is only one of the possible solutions...

Another option is to allow symmetrical movement for combatants or ppl with open borders. If we can code it to allow him to return from my territory, we can code it to allow my ships to enter his.
 
The tiles adjacent to me are ocean within his borders... his (supposedly coastal) ships are entering ocean squares; however, Civopedia clearly says they cannot enter ocean squares. Perhaps 'pedia is wrong here...

The bottom line is that his ships are moving into my territory and back into his while mine can't. Asymmetrical rules like this need fixing; why is it sane for his ships to be able to sail from my coast back to his, when my ships can't do the same? Changing (formerly ocean) tiles two squares from land into coastal tiles is only one of the possible solutions...

Another option is to allow symmetrical movement for combatants or ppl with open borders. If we can code it to allow him to return from my territory, we can code it to allow my ships to enter his.

I wasn't telling how I wished it should work, I was explaining the logic behind the present rules. I was explaining that it wasn't a bug but a result of the game rules. The game rules aren't my choice, so don't blame me.

The game-rule reason why he can enter those ocean tiles and you can't is because he culturally controls them.

You could ask why the rules are as they are. There are actually some very good reasons for that.

-If tiles far from the coast could be entered by ancient age ships, then large bodies of water could be crossed early in the game which would be uninteresting. Thus only tiles adjacent to land tiles can be accessed early in the game.
-Some sea food resources are 2 tiles from the coast and they need to be accessible. So the rule that when you culturally control a tile, then it is available for your ships was created. This way your work boats can enter and improve those tiles.
-If you could also enter hostile foreign culture ocean tiles, then that would make travel between continents easier and that is against the wishes of the game creators, thus they limited the movement into those tiles.
-Allowing movement into enemy culturally controlled ocean tiles and not into the ocean tiles which are culturally controlled by someone with whom you have closed borders is not logically consistent.

The result of these rules is the rare situation that you encountered in your game. If you'd want to mod that situation out of the game, then I personally think that the extension of coastal tiles to 2 tiles from the land area would work best. It removes the distinction between coastal tiles 1 tile from land and culturally controlled ocean tiles 2 tiles from land. Of course, it would lead to easier movement between continents early in the game, but it would be more logically consistent. A different change would be to not allow ships into culturally controlled ocean tiles. That would stop use of ocean based sea food resources until after astronomy. That could also be interesting.

I'll bet that the creators of this AI-mod are not willing to go that far to remove the situation that you encountered.
 
In this case, I hope BetterAI does something about this... is it a corner case? Yes

Does it ruin this game? Pretty close to it... I now need astronomy to kill Suri.... meanwhile I could be fighting his invasions off until then.
 
@GatlingGun and Roland
This has been interesting from the perspective of how game rules create unforseen consequences again. Thanks for the explanation of this but agree that it is probably not a better AI issue. If anything it is Dresdon unofficial patch area. Personally I don't really see a problem. If his cultural influence at sea extends to your coast line but not visa versa, good on him.

I can see why it would make you frustrated though! If Cumae would have been parked closer to the headland this would not have happened I take it? However then Cumae would have struggled to expand it's population. Damn, perhaps you should have parked Cumae on top of the rice, gained access to the fish two squares out and built up Cumae financially to support a horse colony on the headland with eventual access to the spices to the NE.

Interesting would be to examine what the AI would have chosen for settlement in this region via pulling up Gatling's save and seeing what a settler blue circle would recommend for the area. This would clarify whether the AI would also be vunerable to such an exploitation of the rules.

I personally don't like the idea of restricting access to fish until astronomy though....
Cheers.
 
In this case, I hope BetterAI does something about this... is it a corner case? Yes

Does it ruin this game? Pretty close to it... I now need astronomy to kill Suri.... meanwhile I could be fighting his invasions off until then.

I'm fairly familiar with this issue. It's not that you're the first to come up with it in the years that people have been playing civ IV and thus I've explained these rules to more people. The weird situation is a direct result of the special 'culture enables ocean travel rules'.

To be fair, I do think that the Firaxians have deliberately made the choice to limit travel through culturally controlled ocean squares, but I don't expect the Firaxians to have foreseen this consequence. It's just not the first thing you think of when you create such rules. That's one of the reasons that game developers should make game rules as logical as possible. That way, you're less likely to encounter unforeseen consequences. In this case, it's not that logical that there exists a difference in ability to use ocean squares based on who culturally controls it. It's not even that logical that cultural control helps a civilisation use it's own ocean tiles before ocean travel is possible.

If you're not familiar with this rule and this unforeseen consequence, then it can be annoying. It effectively means that culture is extremely important in this battle. Thus your main objective should be to win the culture battle or end the war for some time. In this case, a great artist's great work would be the perfect choice. It would quickly tip the scales in the culture battle.

By the way, I don't expect the designers of the unofficial patch to be more lenient towards changing this than the creators of this BetterAI mod. It would just change basic game rules too much which is beyond the scope of that mod. I've seen many protests from conservative minds against far more minor game changes.
 
Glider,

I'd agree this probably isn't a BetterAI issue... and to be honest, I didn't even realize it was a historical artifact of the rules until Roland explained it.

To your comment about where I founded Cumae, I didn't even see Suri's borders until after I founded the city...

I still think it's broken to allow asymmetrical travel... I don't expect BetterAI to fix it though... hopefully another patch will take care of it, and I will reserve further comments for another thread (where this really belongs).
 
I still think it's broken to allow asymmetrical travel... I don't expect BetterAI to fix it though... hopefully another patch will take care of it, and I will reserve further comments for another thread (where this really belongs).
The asymmetrical travel isn't really asymmetrical.

The other side has extensive maps and traditions that teach their sailors how to cross that gulf -- that gulf is their home waters.

Your sailors? Every time you try to cross it, your boats sink. None of your sailors are willing to take the risk --- at least not enough to generate a fleet to carry units or engage in war.

In order to claim that gulf, you need to pump out culture in the city (or cities) near the straits. Once you have pushed back even 1 square, your sailors now know how to navigate part of that strait -- and you can invade his territory. If you push back all squares, you have managed to make that entire strait 'yours', and their culture of sailing has been overwhelmed by yours (possibly their sailors defected to your side, due to your cultural superiority).
 
The asymmetrical travel isn't really asymmetrical.

The other side has extensive maps and traditions that teach their sailors how to cross that gulf -- that gulf is their home waters.

That argument would make sense if the tiles in question were coastal instead of open ocean... ;)... coastal waters have navigable features... open ocean simply has big waves which can damage small boats.
 
Top Bottom