A Better AI.

New 1/1 Version available for download from SourceForge.

changes:
Start Points:
- Close starts should no longer happen on any map script.
- Polar starts should be less likely.

AI Empire Management:
- The AI can now distinguish between Buildings and Wonders.
- Brand new Wonder Building Logic, should be more human-like.
- New "economic" building logic, should reliably choose the best economic building.
- Slightly better worker/settler training logic.
- AI uses "emphasis" buttons more selectively and less to it's detriment.
- Situational tweaks to the value of commerce vs production for governor.
- Governor should prefer hamlets over cottages (and etc).
- Whipping has been fixed - it was broken.
- Smarter chopping - less likely to chop when the health is needed.
- Fixed minor issues with route-building.

Strategy and Tactics:
- Promotion lines will now be followed to a greater degree.
- Fewer mismatched promotions.
- AI will build barracks earlier (especially if aggressive).
- AI will train and use more pillagers, hopefully to greater effect.
- Rudimentary awareness of which cities are most and least threatened added.
- AI will place more defenders in threatened cities.
- AI will train more defenders.
- AI will train even more defenders in a defensive war.
- Better mix of defenders.
- Intelligent use of defenders - will leave cities to kill off weak interlopers.

Declaring Wars:
- The AI now better takes distance into account.
- An AI with Vassals becomes more aggressive.
- Should be more likely to actually declare a planned war.
- Should be more likely to abort a planned war when backstabbed.

Happy New Year!

-Iustus
 
you can blast most of your world into ocean ... All I need is that one city.
Ahh, a cunning plan.

A save with the offending city (Orleans) attached. Note: emphasizing food also favours the village over the town.

I've created 3 test cities as well, one for each combo (cottage/hamlet; hamlet/village; village/town), the city governor correctly favours the hamlet over the cottage; the village over the hamlet but incorrectly favours the village over the town (as per Orleans). The governor also favours a combo of corn/hamlet; corn/village; corn/village when emphasizing commerce rather than cottage/hamlet; hamlet/village; village/town.
 
Hi Blake

Since the 21/12 build I feel the AI is definetely warring much better especially when warring between its self.

I was playing a game where alexander built up a large army but nor much infrastructure. He declared war against churchill and resfused to give in, which in this case was good because he had no other way of winning.

He did well initially but was slowly worn down but churchills better econonmy / technology. Just as it looked like churchill was going to win Brennus pilied in easily took some cities and then London, forcing churchill into capitulation.

Mean while isabella attacked the most technologically advanced nation the ottomans and slowly reduced them to two cities before they capitualted.

The ottomans were attacullay closer to the celts than the Spanish. Brennus's culture was pushing on isabellas cities until one of them culuturally converted.

Isabella declared war (i dont know if it was random but it looked like she did it because she knew she was going to lose all her gains to culture).

Unfortunaltely one of the old ottoman cities flipped back to them as well, meaning the spanish were only left with 1 city in this area. Due to the distances Brennus then resonably easily conquered all of the ottoman lands from isabella and destroyed the ottomans.

At this point Brennus still had the biggest military and isabella the second.

However all of isabella's terrrtory now was on the other side of the persians terrortory. Both sides had open borders with him.

All both sides did was destroy each others units in his empire, eventually Brenus got through and destroyed one of isabellas cities but it did little to tip the balance, it was stalemate.

Basically both sides refused peace and this war which started in the middle ages has continued to 1942.

This has led both sides from being the strongest to seriously fall behind.

I do like your code which allows wars to go on longer, but the AI does nt recongise when peace would be an advantage to it. Once Brenus had taken the ottoman lands, the geography of the landscape dictated he needed peace. He needed to attack one the other small nations which he could of done and vasseled them before heading back to Isabella. Or even just pillaged her lands, the AI doesnt seem to do this at all any more, even when it would be a better plan.

I know this is hard to do but the AI needs to realise when peace would be advantageous to them.

Also the naval attacks now work much much better.

Thanks very much for the good work. The game seems to be much more interesting to me now. With the AI successfully building up empires and vassellising other nations.

I think people are forgetting how dull the games could be when CIV IV first came out sometimes there were no wars at all. This never seems to be the case any more.
 
Thank u guys! This mod rocks. I am attaching a new handicap xml file that scales down the advantages given to AI and player. (And no handicaps -really no this time- for both sides at Noble level) I think we need this to realign the handicaps with new improved AI. (Otherwise we all have to go back to Settler level :))

With this xml and Blake AI, Prince level feels like the unmodded Prince level for me.

Note:
This file is not my production. Just found it on google.
 

Attachments

Since the 21/12 build I feel the AI is definetely warring much better especially when warring between its self.

That´s kinda hard to imagine... ;) j/k
 
Thank u guys! This mod rocks. I am attaching a new handicap xml file that scales down the advantages given to AI and player. (And no handicaps -really no this time- for both sides at Noble level)

At Noble handicap level i think the supply and warweariness bonuses could remain to help AI in warring. They need it ;)
AI extra bonuses against barbarians i dunno. It has to be tested. Blake says they handle barbarians better now with the new build (still have not tried).
Upgrade bonuses also dunno. Their upgrade logic is that much better now? It needs testing before taking away this bonus IMO.

I'm quite eager to try out the new build. Thank you guys you're true fanatic modders :D
I just have SO little time (why don't you mod pacman? :))
 
Some general comments on the new build:

1) Its MUCH better with production and keeping up. In fact, I in my first of 2 games I was behind for much of the game and eventually overrun.

2) AI cities are certainly much better defended. Border cities seem to have 5-7 units in them with a good mix of unit types.

3) AI attacks seem more coordinated. In my first game the Incans actually launched a multi-pronged assault at scattered cities rather than the usual piling on one location. It was much harder to defend against the broader front.

4) Unfortunately, its starting to take a long time to process the turns by the Middle Ages. In some cases it was upwards of 45sec to a full minute just to process a turn. Hopefully this can be optimized a bit as the build is refined, but if not its still worth it as a trade-off for the far superior AI opponents.

I am likely going to start chopping away at the AI's bonuses soon. The WW and Supply bonuses are pretty 'harmless' IMO, but the massive upgrade bonus really tells in this build. Since armies across the board are far larger (and the player has to follow suit or die), this AI cheat is a HUGE swing now. A player can easily go bankrupt having to upgrade large piles of units, but the AI's 70%-75% discount on upgrades makes it very easy for them. I dont believe the entire bonus should disappear, but I'm likely going to start reducing it quite a bit now that the AI doesnt waste units left and right like it did before.
 
A couple of thoughts.

The (practically) free upgrades that the AI gets have never been a fun part of Civ 4 and I would be happy to see them moderated. However, that's out of the scope of this project. :(

One thing about the improved AI is that the other leaders are becoming (even) more predictable. I'm pretty sure I don't like that. On one hand, it's very good that the tendencies of the different leaders are expressed more clearly and efficiently. On the other, though, it's kind of dull.
 
I think people are forgetting how dull the games could be when CIV IV first came out sometimes there were no wars at all. This never seems to be the case any more.
IMO what was (and still is) dull is when a continent of a half dozen civs remains completely stable and somehow relatively at peace, while I'm on another continent constantly being nibbled at by some AI that declared war on me, has no hope of gaining territory from me or even pillaging a tile, but which for 100s of turns won't accept peace without me offering some random border city.

How do Hannibal and Monty stay at peace (and pleased) with one another for an entire game, when they share a large border, are both powerful, and have different religions? ?!? And one of them is Monty?
 
- Smarter chopping - less likely to chop when the health is needed.

Whoa! You mean there's a chance I might get to conquer some territory that hasn't been clearcut?
 
Close starts should no longer happen on any map script.

Mmm...this is from a Pangaea:

civ4screenshot0002vv1.jpg


Darrell
 
The (practically) free upgrades that the AI gets have never been a fun part of Civ 4 and I would be happy to see them moderated. However, that's out of the scope of this project.

Absolutely. I certainly dont think the 'better AI' mod should be tweaking things such as this. Players can do it themselves quite easily if they want. And if the AI is ever picked up by Firaxis 'officially' for the next patch or whatnot, then they can tweak the handicapping according to what they feel is appropriate.

But for me, it certainly seems over the top for the AI to get that big of a discount now that is it playing quite well economically and getting better every build militarilty. So, I'm simply tweaking the handicaps myself to 'season to taste'.
 
HardCoder said:
Whoa! You mean there's a chance I might get to conquer some territory that hasn't been clearcut?

Well chopping is increased a lot in a war, they figure better to chop to help win the war than lose it :P. SO no, you probably wont get to conquer stands of pristine forest ;). (but it's YOUR fault for invading!)


Uncle_Joe said:
4) Unfortunately, its starting to take a long time to process the turns by the Middle Ages. In some cases it was upwards of 45sec to a full minute just to process a turn. Hopefully this can be optimized a bit as the build is refined, but if not its still worth it as a trade-off for the far superior AI opponents.
I'm fairly sure that it's not so much a result of the more cpu intensive algorithms but more due to the increased unit counts. A save of a laggy environment would be useful so I can do some comparisons (you can email the save to betterai@gmail.com)


darrelljs said:
Mmm...this is from a Pangaea:
That's not really close. Close especially means when one player founds it prevents another founding!

It is possible that some starts will be closer than that of the the older version, here's an example:

closerstartssv0.jpg


Say there's a somewhat circular landmass, the map generator decides to put 2 players on it (technically it decides to put 1 there and then later on comes along and decides to place another), the first player gets put in the middle because that's the best spot (RED dot). Now it happens that the entire bulk of the island is closer than 10 tiles - the old algorithm (when functioning correctly) then expressly FORBIDS any start within 10 tiles of an existing start, if a start futher away (ANY start) can be found, hence it sticks the 2nd player on some silly little bit of land jutting out (PURPLE dot).
My algorithm doesn't force anything, it just greatly encourages not-too-close starts, this makes it possible for some closeness to offset by (avoiding) a lot of crappiness - it will find a compromise between closeness and crappiness rather than just choosing *anything* which isn't too close. So it goes with something like YELLOW Dot, which is technically closer than the minimum allowed but is nowhere near as crappy - and is more fair than being stuck on a jut of land while the other player enjoys the rest of the land.

My "crusade" against close starts has ALWAYS included preventing unfairness-by-anti-close-start starts which is a large part of the reason why the solution is complicated to get right.

In your Rome screenshot it is likely that Rome would've been placed between the pigs and goldmine, but got moved over to include the oasis, stone and Clams since it was a much nicer spot - despite being close to Monty. Presumably there isn't an all-around fairer spot on the map (there may be more distant spots, but they'd be like tundra or desert deadzones).

I'm also staying away from too much fairness... you might still be quite crowded or get barbarian problems. It'd be possible to make considerably fairer starts but players have expressed that that is not what they want.
 
I'm fairly sure that it's not so much a result of the more cpu intensive algorithms but more due to the increased unit counts. A save of a laggy environment would be useful so I can do some comparisons (you can email the save to betterai@gmail.com)

I use a graphics mod and I've edited the handicap files for my game. Would a save still help you? If so, I'll fire it off.
 
The AI is much, much better at Defense. All players be warned. It actually sends a defensive stack to threatened cities, and will use it offensively. I'm impressed, this build is making us warmongers cry.
 
I'm impressed, this build is making us warmongers cry.

Yeah, I find it interesting that a lot of folks were concerned that the Better AI means that you have to warmonger to win. IMO, with this build warmongering just got a whole lot harder! ;)

I usually play somewhere in the middle and peacefully build unless I see a target of opportunity or unless I dont have a critical resource and my neighbor does. But with this build I'm struggling just to 'keep up with the Joneses' in terms of military and the thought of actually inviting a war is daunting. I've successfully done so, but its no longer the easy land grab that it onces was, thats for sure!
 
The Better AI mod has made me into more of a warmonger, not because it's needed to win but because I now use automated workers and the city governors more now. With that micromanagement gone I have more time to devote to warring (and I like it).
 
Well chopping is increased a lot in a war, they figure better to chop to help win the war than lose it :P. SO no, you probably wont get to conquer stands of pristine forest ;). (but it's YOUR fault for invading!)

aha! so you're the one i should blame when the silly bad guys put a city right up on my borders and then resent ME cuz 'our close borders spark tension'. you told them it was my fault! :nono:

i keep reading about your mod but i'm a total chicken so i don't think i'll be trying it any time soon. the part about the AI going for cultural victory, that sounds like a completely fun addition.
 
1/1 build with my normal game set up.

1st game for a long time where I have not got one of the 2 early religions

1st game for a long time where I have not built the oracle

lots of good AI v AI wars still going on, but no easy rolling over as there was before

My gut feeling so far is that this build is VERY good
 
Good to hear the positive feedback :b:.

It looks like this building is reasonably good meta-balance wise (as in the AI doesn't play a severely disbalanced game). I suspect that this build will be the basis for the first stable release - bugfixes and minor tweaks only. There are problems with city attacking and there are problems with naval invasions and there are still problems with declaring war, no doubt, but gotta draw the line somewhere.
 
Back
Top Bottom