A Better AI.

I documented a similar situation a few weeks ago. What I noticed was that the AI doesn't attack if the cultural defenses are too high. It wants to use siege weapons first. In other words, I surmise the coding is something like this:

if cultural defenses > 30
if siege weapons
bombard
else
build siege weapons and/or send to join attacking stack
end if
if cultural defenses > 30
all units in stack pass turn
end if
end if

Anyway, if this is true, then the coding should be changed to check to see if there is a reasonable chance of attacking the city, probably on the second/embedded IF clause. e.g., "while any unit in attacking stack hit calculator > 75%, do attack" rather than a second check against the defense 30.

(BTW I picked the number "30" out of the air. It is probably something else, and may even be a function which varies depending on other factors.)

Wodan
 
I vaguely recall being able to bombard a cities defenses across cultural borders, but if you try it with the attached save it is not possible. I have to actually move into Egypt.

Darrell
 
I vaguely recall being able to bombard a cities defenses across cultural borders, but if you try it with the attached save it is not possible. I have to actually move into Egypt.

I'm having the same problem. I attributed it to some other graphics mod work I have going but if others are seeing it then its probably something new in the 1/8 build.
 
I have the same problem, cannot bombard across cultural borders. I use no other mods than BetterAI.
 
Another screenshot to show some strange AI behaviour (latest version, 8 jan. , but started the game with an older version). This time it has nothing to do with the governor. :)

There is a spot with 5 furs to the north of two AI and the spot has been unclaimed for a long time, a really long time. Now, I can understand it a bit as it isn't a great position, up in the northern tundra regions with no food resource in the neighbourhood. But then again, 5 furs! I would have claimed the area long ago just for the happiness (2 happiness with a market, 1 happiness without) and the trading options (4 furs to trade for other resources or gold per turn).

By the way, the cities close to the resource are better developed than it seems as I haven't viewed them in a long time. But I have seen the area with the furs very recently (2 turns ago or something like that).

So, it's 1220 AD, I'm about to develop paper (and going for printing press) and this resource is still unclaimed.

AI hates furs.JPG

I wouldn't have claimed that spot. I would have just made culture a priority for Nampor to get an extra border expansion soon so I could get the happyness from the fur.
 
I documented a similar situation a few weeks ago. What I noticed was that the AI doesn't attack if the cultural defenses are too high. It wants to use siege weapons first. In other words, I surmise the coding is something like this:

if cultural defenses > 30
if siege weapons
bombard
else
build siege weapons and/or send to join attacking stack
end if
if cultural defenses > 30
all units in stack pass turn
end if
end if

Anyway, if this is true, then the coding should be changed to check to see if there is a reasonable chance of attacking the city, probably on the second/embedded IF clause. e.g., "while any unit in attacking stack hit calculator > 75%, do attack" rather than a second check against the defense 30.

I specifically made a fix like this some time ago. Right now the check is pretty high, it will only avoid bombarding if the win odds are over 96%.

This has nothing to do with not attacking though. This is choosing to bombard before attacking. If there are no siege weapons in the stack, they should attack immediately.

If someone has a save game with it not attacking, I will look into it.

(There was a previous bug with a unit not attacking when it had to declare war to do so, but that bug was also fixed.)

-Iustus
 
I wouldn't have claimed that spot. I would have just made culture a priority for Nampor to get an extra border expansion soon so I could get the happyness from the fur.

But the AI didn't claim any of these 5 furs (and it doesn't have any other furs of its own or through trade). It's 1220 AD and the spot is something like 10-15 tiles from two AI capitals and they have more than enough production as it is an emperor level game. There are also no other spots for them to build cities.
It's also way better to have 5 furs than 1 fur in some outer border of one of your cities. The other furs can be used in trade for other resources or gold per turn.

Personally, I would even build a city there without the resources. The coastal areas and trade routes will make it profitable after it reaches size 2 or 3 depending on upkeep (how many cities have you already build and what difficulty level is this game). It will always be a lousy city, but it will make a profit. Without the resources, it would of course have a very low priority for me to build a city there, but eventually I would build it.

I'm going to claim the spot now even if I have to build a city in the middle of AI territory. I will get +2 happiness in my main cities (very nice) and a lot of trade oppertunities. But the AI should have gotten them. It feels almost like cheating.
 
I believe Iustus was asking for anyone with game errors to post the saves. Here are 4 files from the same game where OOS errors happened twice over 30 minutes time with the 1/1 build. Once at 1676 AD and another at 1694 AD. It was a 2 Human player, 6 AI player game over a Direct IP Internet connection. I don't know if the problems have been fixed in 1/8 since I didn't see any mention of OOS issues, but for what it is worth, here they are. We did have a few OOS problems back in November, though when the 12/12 build came out, it seemed pretty solid and we didn't have them again. Never had a chance to try the 12/21 build. The 1/1 build is when we noticed them happening again.

Many thanks to all of you that have worked on this. It is awesome!

The OOS errors continue to exist in the 1/8 build. I resumed a game with someone online (see above post) and the OOS error showed up after about 15 minutes of playing. We both then dropped back down to the 12/12 build and we had no problems for the remainder of the night, about 3 hours worth. All of the saves are from my earlier post (page 73 of this thread). Hopefully Blake or Iustus or someone can take another look at the code to see what might be happening.
 
In a similar fashion to Roland (good work on the tests you do btw :goodjob:), I have 3 examples here of some weird city governor behaviour. I used the 1/8 build of BetterAI, on Warlords.

In the first screenshot, the governor has chosen a 2F1C tile where there are a number of tiles which would be better. The odd thing with this one was, the following turn, that citizen working the 2F1C tile had been switched to one of the 4F1C tiles, and somehow 3 food was collected in that time. It should have been 2 (8-6), or if it had somehow changed to the other tile first then it would collect 4 instead. Anyone know how on Earth it would collect 3 food?

In the second screenshot, Persepolis is building a settler. Instead of working the forested hill, it would be better to work one of the riverside tiles that have 1C extra.

In the third and fourth screenshot are my selection and the governor's selection (respectively) for another city. The governor has chosen two forested grass hills instead of the mine and river forest. It doesn't matter what I want emphasized - this is not optimal. My selection gets 1H and 1C extra. I've noticed things like this many times before when not using the mod.

Hope these help! Let me know if any saves are needed - I might be able to dig them up.

 
Ok. I am experiencing an oddity with 1/8. It is a Pangea game/warlord difficulty/marathon. Bismark built a HUGE army. 75-100+ and attacked me with it. Not something I would expect on a Warlord difficulty game. None of the other AI's are doing this. Is this just related to his "personality"?

I was going to include a save, but it was waaay to big. so here is a screenie. Look at the scroll bar. ITS TINY!!!!
 
AIs should be a bit more aggressive when they just got their unique unit. It's often a good time to attack.
I would like to see the militaristic spiritual leaders go on a spiritual expansion phase or something. So that would mean, Monty would go on a Jag rush, Brennus rushing with Gallic Warriors, Saladin with his (resource free) Camal Archers, Isabella with her Conquistadors, etc. Would be cool.

Sorry if this has been said, a week later and 5 pages of 40 posts per page were there to catch up on ^.^ ... man this thread flies...
 
I definately think the AIs are build too many units now. In my last game I was barely able to complete the Space Race with 12 years to spare (so 2038) and many of the AIs were still using Musketmen/Riflemen/Cavalry and whatnot as their main armies. Looking around after the game, I'm seeing piles of about 15+ units PER CITY for most of the AIs. That is just far too many IMO and unless the AI is going to go balls out attacking every game (bad idea), its just not going to be as successful building that many units.

I think the game is a LOT harder to win now, but mainly because the AI is so deadly in the early game. If you make it through the Medieval Age intact you are likely to win because most of the AIs choke themselves to death building too many units. There are exceptions like Gandhi who has threatened to win two of my last three games with a Cultural or a Score Victory but many of the AIs are just stagnating too much under the weight of trying to maintain their armies at decent level (and constantly building new units).

To make the situation worse, if the AIs on a continent are all sharing a religion and singing Kumbaya they are still building units after units and rarely if ever using them. If the AIs have been at mass peace and have good relations with their neighbors, they should drastically reduce unit production IMO. If they aren't going to be fighting, those extreme numbers of units are a horrible waste of efficiency (something the mod is intended to be fixing).

A few builds back (early December) the AI was VERY good at keeping up in the mid and late game technologically. Its production was substandard, but it finances were great. Now, the AI is getting its production OK but it is being spent on incredible piles of units.

My dimestore suggestion would be to cut unit production across the board a bit unless at war. Then maybe the militaristic AIs might be able to keep up into the late game rather than building units en masse that are very marginal (ie, I dont care how many Cavalry and Riflemen you have you arently likely to make much progress into the teeth of Gunships, Tanks, and Artillery). Its even worse with piles of lightly escorted (and often obsolete) siege weapons.
 
This is mighty fine work here, and I thank you.

I have a question. Would it be possible to consider being able to play with all 24 civs at the same time, in a future version of this project?

I have played with this mod - http://forums.civfanatics.com/showthread.php?t=192620 - which allows you to play with all 24 civs in any single game (instead of just 18).

Unfortunately, this mod seems to be incompatible with the better AI (as both are contained entirely in the CvGameCoreDLL.dll file?). Even when the better AI file is put in the customassets folder to be used in *all* games, it is overridden when I load the 24 civs file as a mod.

Cheers.
 
In a similar fashion to Roland (good work on the tests you do btw :goodjob:), I have 3 examples here of some weird city governor behaviour. I used the 1/8 build of BetterAI, on Warlords.

In the first screenshot, the governor has chosen a 2F1C tile where there are a number of tiles which would be better. The odd thing with this one was, the following turn, that citizen working the 2F1C tile had been switched to one of the 4F1C tiles, and somehow 3 food was collected in that time. It should have been 2 (8-6), or if it had somehow changed to the other tile first then it would collect 4 instead. Anyone know how on Earth it would collect 3 food?

In the second screenshot, Persepolis is building a settler. Instead of working the forested hill, it would be better to work one of the riverside tiles that have 1C extra.

In the third and fourth screenshot are my selection and the governor's selection (respectively) for another city. The governor has chosen two forested grass hills instead of the mine and river forest. It doesn't matter what I want emphasized - this is not optimal. My selection gets 1H and 1C extra. I've noticed things like this many times before when not using the mod.
It's a problem as old as Civilization (every version of Civ has had absolutely inferior governor workforce placement problems), it comes down to the algorithm used - it places each population separately rather than looking at the final configuration. With a governor rewrite I can mostly eliminate this phenomena and generally force it to pick optimal configurations. It is however not a trivial task - as I said it's been in every version of Civ (and SMAC) so it's not an easy thing to fix.
The main problem is performance - any kind of brute force approach (ie comparing every possible configuration) will just be far too slow. Extremely clever techniques are needed...



So far as the unit oiverbuilding problem goes, it's still a pretty new feature and yeah at the moment the AI does overbuild defenders a bit I think there's a bit of a bug leading it to conclude it doesn't have enough defenders. It's definitely too inflexible in choosing the number of defenders needed, I'll be enhancing that so there's more diversity in army sizes rather than every AI basically building the same sized army.
 
It's definitely too inflexible in choosing the number of defenders needed, I'll be enhancing that so there's more diversity in army sizes rather than every AI basically building the same sized army.
Just finished a Monarch/Space win and this was one of a few remarks I had. Every so often the first AI to a keystone miltary tech would shoot in to a lead but the others soon caught up. Even Ghandi, who was without metals, kept up pre-Feudalism.

Sitting at the north of my continent I got declared on by the southernmost Civ ca 1100AD, but I was the only reasonable target. Only survived by using my huge tech lead to trade in military techs and bribe other AIs into the war. Also enjoyed the rarity of Ghandi declaring a modern war (pointlessly, it seemed).

The only other oddity was a very late Great Lighthouse: I claimed it in AD700. The AI all had a few coastal cities, but maybe this was a one-off: it certainly went a lot earlier in previous builds.
 
In the second screenshot, Persepolis is building a settler. Instead of working the forested hill, it would be better to work one of the riverside tiles that have 1C extra.

It wouldn't, since Cyrus is Imperialistic, you'd build the settler more slowly if you weren't working that 3h hill :)

With your first screenshot, you are right ofc. I think the reason for this is because the city is over its happy cap, so the governer ignores the value of food?
 
In the 1-8 game I'm playing, Alex and Napoleon declared on me simultaneously -- probably one bribed the other. Nice, as I was just about to attack Alex anyway. Hadn't counted on Nappy joining, so looked for someone else to drag in. Asoka was willing to war with Nappy, which I found surprising. They weren't neighbors, yet Asoka was able to take at least one city from him before they reached an accord. This is not what I'd expect from a war between those two.

In my battle with Alex, I came upon a city with 5-6 troops of various types and at least as many Catapults, all with two collateral promotions. Did they attack my stack as it sat there for multiple turns bombarding and then attacking? No. Instead, I had an easy time killing all those Cats as they defended against my Maces, Knights, Pikes and Cho-Ko-Nus. If they had attacked me, most still would have died, but I would have suffered more damage. I believe that's the whole point of the collateral promotion on siege units.
 
In my battle with Alex, I came upon a city with 5-6 troops of various types and at least as many Catapults, all with two collateral promotions. Did they attack my stack as it sat there for multiple turns bombarding and then attacking? No. Instead, I had an easy time killing all those Cats as they defended against my Maces, Knights, Pikes and Cho-Ko-Nus. If they had attacked me, most still would have died, but I would have suffered more damage. I believe that's the whole point of the collateral promotion on siege units.

Jups, I think there is a problem where cities with catapults inside dont suicide this against the impending SoD waiting outside the city.
 
The OOS errors continue to exist in the 1/8 build. I resumed a game with someone online (see above post) and the OOS error showed up after about 15 minutes of playing. We both then dropped back down to the 12/12 build and we had no problems for the remainder of the night, about 3 hours worth. All of the saves are from my earlier post (page 73 of this thread). Hopefully Blake or Iustus or someone can take another look at the code to see what might be happening.

I too had an OOS error in a game I was playing last night. Unfortunately I don't have any saves, as we started another one immediately and it over wrote the auto saves. I hope you guys can fix this error. My OOS occurred around 1500ad. Next time it happens I'll make an effort to have the save game to upload.
 
In the first screenshot, the governor has chosen a 2F1C tile where there are a number of tiles which would be better.
I can see why it would have chosen the 2F1C tile over the 4F1C tile as you have +1 unhappy. However, that's not the whole story, since there are 1H1F1C and 2H1F tiles available which would still leave the city at +1 food. Plus, I figure even if your city is unhappy, all else being equal, the governor should accumulate maximum food without growing, so that if you fix the unhappiness, you can grow as soon as possible thereafter. It also makes it easier to step in and grow an extra pop for rushing. So it sounds like it's kind of sort of doing the right thing, but not.

Anyone know how on Earth it would collect 3 food?
That's pretty strange.

In the second screenshot, Persepolis is building a settler. Instead of working the forested hill, it would be better to work one of the riverside tiles that have 1C extra.
Cyrus is Imperialistic. I don't have Warlords, but I recall reading that there's a bonus to hammers when building Settlers. Maybe that's what's making the difference here.
 
Back
Top Bottom