Report Questionable Behavior

Isn't anarchy a time without any output, so it doesn't really matter? At least I always thought so ..
Still doesn't explain the behaviour though.

At the very least then, it's wasting CPU time then.
 
It seems to me that the AI changes civics and drops into anarchy at the drop of a hat, and for reasons confounding.
 
I do alot of playtesting, especially in the early game, just watching what the AI is doing through AIAutoPlay. This latest build is really good in the early game, based on preliminary observation. However there are 2 main simple behaviors I have seen the AI do which makes no strategic sense:

1) Building a Settler immediatly after first warrior:
This should never be done, anything is better then a Settler as the first thing to go in the build queue (that first warrior is done quickly due to the found production bonus an AI gets). The AI later switched to a Warrior, then Switched back, then to a Workboat, then back, then to a Worker, then an archer, and finally completed the Settler. The Settler should just not have been built until it was ready.

2) Revolting to a State Religion when the AI has no state religion, but is chasing a religion in the tech tree:
I just saw the Mongols loose a race for Confusionism by doing this. It made no sense, some random border city gets Judiasm, they are 7 turns away from CoL, and they revolt, change state religions, and then get hit by a revolution (which obviously had it's chances increased due to the anarchy), which caused them to loose the race for Confusionism by a single turn. Related to this, they then switched techs after the Germans founded the religion, that also makes little sense since they are so close. I can see switching research if you're chasing the Muslim faith and miss it with still a dozen turns on divine right, but 1 turn for CoL, a useful tech in it's own right, should not be so easily abandoned.



Anyway those two I think should be easy fixes. Simple if checks that apply to specific situations. By the way the fix for boats and especially the Work Boats being built when the AI wanted workers makes a huge difference, the AI is doing much better in general now since it is building enough workers.
 
A city counts as coastal if it is next to water, even if there is ice on it.

I think it is possible to give the AI the ability to at least build 1-tile channels using forts. The logic for CvCityAI::AI_updateBestBuild() would have to look like this:
  • Loop over all adjancent tiles, if on one tile there is a city and another is water (connected to trade network, not impassable) then
    • Loop over all tiles adjanced to the city (except the tile we are currently evaluating) and check if there is water, and if at least one of them is "good" (not inland sea and not impassable). If water is found but no "good" one AND no other fort, then
      • give some value (similar to what 1 production or 1 food would give) to the improvement fort improvement
 
Are you using BBAI?

First thought: "What a stupid question. Wouldn't only an idiot report questionable BetterAI behaviour here if he wasn't even using the mod?"

Second thought: "Ermh... hm.... turns out..... somehow... :crazyeye: .... "

Sorry for bothering you...
 
In my experience, upwards of 50% of "that cannot be" bugs are fixed when you ask "did you plug it in?" questions.
 
A few things i noted:

1. AI does not seem to understand that it should prefer building temples/monestaries that are of same religion that the apohstolic palace, for some reason the AI dosent seem to care, if there is 2 religions present in city AI has free religion it still seem sto randomly choose which one to build.

2. Today the AI build aphostolic palace, +Spiral minaret + university of sankore (all within 20 turns) and a bit later changed to free religion. All other had the same state religion so no dilpo bonus here either.

3. Why does the AI keep tons of units in the center of its empire, they seem to perfomr no funtion there and it takes ages to move them to the nearest border. This is especially wird on continents were there is a clear border and the other side is ocean.

EDIT: version 0.84 of better BTS AI, played on monarch difficulty
 
A few things i noted:

3. Why does the AI keep tons of units in the center of its empire, they seem to perfomr no funtion there and it takes ages to move them to the nearest border. This is especially wird on continents were there is a clear border and the other side is ocean.
This would require a concept of map understanding and managing units in a somewhat global way.
 
For 1 and 2: I believe the AI doesn't understand the boni from AP, or any normal wonder that gives baseyields to state religion buildings, let alone that this changes when you change state religion.
 
1 Yeah, the AI definitely does not understand the AP bonuses for buildings. This is an important point, I will see what I can do. I wonder if it understands the boosts for other wonders with state religion effects, those might be a little more complicated to fix (since the benefit appears in a different city).

2 For changing civics, the AI would need some positive adder to its valuation of all state religion civics based on the benefits it gets for a state religion ... and of course this would need to be just strong enough to work in the right cases. That should also be possible to add.

3 I would need a save or screenshot to be able to comment on this specifically. The AI stores its attack units when its not using them in cities chosen based on a number of factors. The AI has a way to compute the threat level for any city and it prefers to store its units in more threatened cities, but its analysis of what is a threatened city may not align with the player's understanding. It also prefers to store its units in cities closer to where the unit started, which can mean it will store them in the center of its empire if it doesn't feel very threatened.

If anyone wants to look into this more, the too main functions are CvCityAI::AI_cityThreat and CvUnitAI::AI_moveToStagingCity.
 
I am looking at the AI improvement code in CvCityAI, and other than the previously mentioned oddities (happyness code) I noticed this gold nugget:

Code:
[COLOR="Red"]if( false && bOriginal )[/COLOR]
				{
					aiFinalYields[iJ] = 2*(pPlot->calculateNatureYield(((YieldTypes)iJ), getTeam(), bIgnoreFeature));
					aiFinalYields[iJ] += (pPlot->calculateImprovementYieldChange(eFinalImprovement, ((YieldTypes)iJ), getOwnerINLINE(), false));
					aiFinalYields[iJ] += (pPlot->calculateImprovementYieldChange(eImprovement, ((YieldTypes)iJ), getOwnerINLINE(), false));
					if (bIgnoreFeature && pPlot->getFeatureType() != NO_FEATURE)
					{
						aiFinalYields[iJ] -= 2 * GC.getFeatureInfo(pPlot->getFeatureType()).getYieldChange((YieldTypes)iJ);							
					}
					aiDiffYields[iJ] = (aiFinalYields[iJ] - (2 * pPlot->getYield(((YieldTypes)iJ))));
				}

The red line is key here. This if check will always be false. I understand that they might want the else code to run, but why keep this code if it is never executed?
 
The code in AI_getImprovementValue is not actually used by the AI ... it's a debug function I created so that the values the AI was assigning to improvements could be made visible. As it's a debug function only, I've tried a few things there and kept some old code around as a reference ... I should either clean it up or remove it.
 
The AIs attack tactics are questionable. A stack should know if it has a decent chance to take a city before it actually tries -- and I've had an attack stack that was cleary insufficient to kill more than 1 or 2 units attack a city over a river rather than move around it.

I think the attack tactics have been improved since this rather old post. What's still a problem, however, are rivers. The AI doesn't seem to have any logic to avoid the "-25% for crossing river" penalty. I can provide a screenshot later, but it's a nonspecific problem that I've seen over and over again across many games.

I can't think of many reasons why you wouldn't want to move the extra tile to be on the same side of the river as your target city before laying your siege. I suppose it provides some protection from the city defenders attacking you, but that's rarely the case since the defenders have enough movement points in their own territory to cross the river first and then attack.
 
[BBAI 0.90o developer] I've found out that the AI is still not tough enough to conquer a city in a short time. Maybe the broken river war AI is the reason. The following happened while using AI autoplay:

The AI has an overwhelming stack in front of the enemy city. Step1: Bombardment (which is acceptable). Step2: Waiting for other troops with THAT stack? :lol:














Next round the city gets conquered. Too late imo.
 
Top Bottom