A Better AI.

Another old factor is that the AI is obsessive about placing cities 5 tiles away from existing cities, 5 tiles is the non-penalized distance, any distance closer or further than 5 is penalized. I recently fudged this factor so that 4 and 5 are both neutral - with closer and further being penalized. I also added a general distance penalty to make the AI more eager to found cities close where they can be made productive earlier.

I don't mind a little overlap, just like you. If a city can only use 16 tiles instead of 20 (not counting center tile), then it is still an excellent city and you will notice the lack of those 4 tiles only late in the game. Of course it is better to not have overlap and still use most of the tiles, but that is not always possible. In the vanilla civ4 game, I was often placing minor cities inbetween the old captured AI cities to use the land that they left unsettled.

My guess is that the way that the AI can get a big amount of overlap is by first settling a city at distance 6 or 7 to get close to some great cluster of food tiles and other great tiles. This leaves a small strip of land inbetween this new city and the rest of the cities. This strip will not be settled immediately because of it's relatively low value, however after the better sites have been settled, this site becomes an option again resulting in a city placed inbetween the great cities and at distance 3 (or 4) to both. I think it is a good decision by the AI to settle this minor city inbetween the great cities to get those left over tiles, however it would have been better if the situation of such a small strip of land could have been avoided.

On the other hand, you normally don't want the AI to settle a city at a distance of 1 from the coast in an attempt to stay within 5 tiles of the old cities.

Would it maybe be an option to reduce the value of food resources on cities settled at distance 6-7 from (your) present cities? That might sometimes have a similar effect as your anti-greedy food code.
 
I'm probably going to rework the overlap stuff because it's not all working as it should. Also some of the other factors may be too strong or not strong enough...
All very appreciated, Blake. Thanks for all the hard work.

Wodan
 
The 'quick combat setting' solution to the buggy AI stack attack Iustus suggested for the previous build still aplly for this one too?

No, that bug should have been fixed, are you still seeing a problem? There is a different issue, where a huge stack might be defending a city, so it will not attack out (if even one unit of the stack is needed, then the whole stack will stay).

That different issue should be addressed in the new 12/21 build. (Using the 12/21 build, under chipotle, hold ctrl down while mousing over the stack in a city, to see if it thinks it is defending the city).

-Iustus
 
For your holiday pleasure, new 12/21 build on sourceforge

Sea Assault changes:
- cities build transports and escorts more often when in a sea war, also building units to load onto the transports when they are empty
- fleets are generally created larger, with proper escort ships
- target city for a sea assault should be slightly more random
- transport fleets will now stop to bombard after they have dropped off their units, prior to returning home for more troops
- dagger AIs should not build sea units when in a land war

Governor Changes:
- if any specialists are forced, then all future specialists will attempt to be assigned at the same ratio as the forced specialists
- emphasize buttons should never stagnate a city that wants to grow to its happy cap except under the most extreme conditions
- changed the way non-starving food is forced, more likely to work lower food plots if they are good plots and sufficient to prevent starvation (eg: three 1f3h plots will be worked rather than two 2f0h0c plots and a specialist)
- multipliers returned, cities with high relative multipliers (production, etc), should again prefer these
- commerce value slightly increased in comparison to hammers, this is offset by situational increases to production value.
- governor understands building gold/research/culture (to recongnize when a mine or specialist is best)
- merchants are no longer discriminated against compared with scientists

City Changes:
- true AI city specialization implemented
- workers use city specializtion to decide which improvement to make
- cities in serious danger will panic and abuse population to build defenders
- Wonders should be built more frequently
- Dagger AIs will build settlers more often
- tweaks in the AI city production choices
- AI worker training changes
- Build governor tweaks
- AI uses emphasize buttons less, using new city specialization functions which provide greater precision.
- cultural victory AIs should be less likely to stagnate when expansion-limited.
- city production choices utilize specialization
- limited wonders should be built in the correct specialized city

Misc Changes:
- AI values gold more in trade (known issue with rounding to 10g broken)
- Fixed crash bug, as seen with some mods combined with BetterAI
- Misc Crash bug fixed (as reported on apolyton)
- land units will not bombard a city with zero defenders or when they have attack odds over 95%
- AI will upgrade units more smartly.
- AIs should build more defenders for cities, particularly in wartime
- The AI is more flexible in breaking up large stacks (such as to defend cities).
- Starting point refinement (both placement and normalization), close starts should REALLY be gone.
- Workboat automation changed, so they will camp a presently-unconnectable bonus they are automated near.
- The AI should build more mines and enjoy stronger production
- under chipotle, ctrl mouseover units gives grouping information
- under chipotle, now displaying detailed (declare) war/peace status

-Iustus
 
Wow, I just played my first game with the new build....I got annihilated. Granted I didnt have a fantastic starting area, but I still was just totally outpaced and eventually overrun by the AIs.

Great job!
 
Great Iustus/Blake!
You are constantly working on this project?
You make amazing advance. :goodjob:
 
> - AI will upgrade units more smartly.

Does this mean we can drop the AI upgrade bonuses now or should we still keep them?
 
> - AI will upgrade units more smartly.

Does this mean we can drop the AI upgrade bonuses now or should we still keep them?

Lets wait and test first :) After all its just a beta version!

Great job on the new one, I will try that one when I can!
 
Thanks a lot for this new build, it looks great ! I will test it this evening.

I played a lot with the 12/12 build, and the things I see which could still be improved and which are not in your release notes are :

- The AI should be more aggressive and start more wars (like humans do to win) : even on aggressive setting, I won peacefully on monarch.
- The AI should try more to stop whoever is about to win (by domination, conquest, space race, culture or diplomacy)
- The AI should protect more its stacks and attack with better odds. Right now it looses many units by either attacking without good odds or by just wandering in front of an enemy more powerful stack.

Keep up the good job ! :goodjob:
 
- The AI should be more aggressive and start more wars (like humans do to win) : even on aggressive setting, I won peacefully on monarch.

Can you give some more details about this? What map type? How did the religions fall out?

Did you nab some important early wonders and have a tech lead the whole game? The 12/12 build was a bit low on building wonders, so it was too easy to grab the early ones, allowing you to become the tech leader too easily.

- The AI should try more to stop whoever is about to win (by domination, conquest, space race, culture or diplomacy)

How did you win? How was your power relative to the AIs? It is hard for an AI that is behind in tech and behind in power to do anything to stop the tech and power leader from winning.

One thing that I think could definitely use some refinement is to make 'limited' wars more pillage and harrasment wars, rather than just the same as total wars with the AI more willing to accept peace.

- The AI should protect more its stacks and attack with better odds. Right now it looses many units by either attacking without good odds or by just wandering in front of an enemy more powerful stack.

Can you give some examples? Large stacks should not be attacking with poor odds. The wandering in front of a more powerful stack is a different issue. Unfortunately, we do not have a lot of control over the pathing algorithm, we can choose where to go, but not how to get there.

-Iustus
 
Thanks a lot for your reply. Sorry for my poor English.

- Can you give some more details about this? What map type? How did the religions fall out?

It was on custom continents, 3 continents, large map, 14 opponents, monarch, aggressive AI, 12/12 build. The thing is I had enough space to develop and leverage Asoka's and India traits... The AI didn't attack early enough, maybe because I had luck (there were no very close enemies until some time, they were something like 10/15 squares away).

I used my advantage by building cities far away from my capital to block the enemy progression in the north and in the south, it worked well and allowed me to fill the empty space later. The AI declared a few wars between AI (2/3 vassals created in the whole game, 4/5 wars, that's not muxh for an 'aggressive' AI), but nobody really tried to stop me to win. Alexander who was second finally invaded from another continent with 4 transports, but with obsolete unit (riflemen vs my infantry), he got crushed immediately. He should have made alliances (there were none in the game, though the option was on) and attacked earlier, when the technology he had was on par with mine.

The religions were similar on my continents, confusianism for me and all the northern part of my continent (Hatshepsut, Hannibal, Mehmed). It allowed me to become quickly friendly with Egypt and Carthage, though they never accepted even a defensive pact (maybe because I was first). Mehmed was pleased because 'our close borders sparked tensions', but none of them tried anything against me.

The southern part was hinduist (Roosevelt and Bismarck). Bismarck attacked early but the stack was a bit too small (I think it's a good idea you had with this small earlier stack attacks, anyway) to be dangerous, then no attack either though they didn't like me. Roosevelt could have attacked earlier. He finally did, but too late and I crushed him too. I vassalized both, ultimately. I used the AI bonuses by giving a few money and military techs to them when Alexander invaded, and they immediately upgraded to infantry (good thing)

My success wasn't dependant on wonders, I built only the later ones, but I totally agree with your changes, early wonders must be built a bit more again by the AI.

- How did you win? How was your power relative to the AIs? It is hard for an AI that is behind in tech and behind in power to do anything to stop the tech and power leader from winning.

One thing that I think could definitely use some refinement is to make 'limited' wars more pillage and harrasment wars, rather than just the same as total wars with the AI more willing to accept peace.


I won by space race but a conquest would have been easy considering my advantage (4000 points vs 2000 for the second), just a bit boring (when I know it's won, I just finish as quickly as possible).

I was 4th or 5th in power, usually not so far from the first, except at the end when I had only 2/3 of Alex power, but maybe he added my 2 vassals' power and that's why he didn't attack more (?) I agree with you it was hard to stop me at the end, but earlier it would have been possible with an alliance. Overall the AI did a relatively good job, but it whould have been more aggressive, and earlier. I agree with you on the limited wars, when the AI sees the stack won't allow him to take cities, or that he won't win the war, maybe it should pillage instead (?) Bringing someone else (or even 2 more AI) in the war is a must too, especially when you're weaker. Had 3 AI attacked me simultaneously and if possible no too late, I would have been in real trouble because of the sheer number of units (if they're not too outdated).

- Can you give some examples? Large stacks should not be attacking with poor odds. The wandering in front of a more powerful stack is a different issue. Unfortunately, we do not have a lot of control over the pathing algorithm, we can choose where to go, but not how to get there.

Well more often than not I see one or two (or three) units from his stack attack my cities or my stacks, often they die and when they die it probably thinks it won't work and stops attacking. The question I asked myself is why did it attack in the first place. The odds were apparently relatively low since it rarely / never works. Aren't there a bug in its odds calculation ? 80 % win is a minimum to attack in my opinion, except if it can force the win by sacrifiing a great number of units (for example because he has 3 times the number of defending units). The process of bombarding then sacrifiing siege units then attacking is ok, but it doesn't apply to all the cases, sometimes it's just better to attack immediately (for example when you can force the win because of the number of units...)

One of the things which kill him is the lack of medic in his stacks (a Medic 1+2+3 you can make with a great general does wonders in a stack to allow them to heal quickly and attack again), another is the lack of defense (bad stack position, lack of tile defense and so on). Is there a way to analyze the danger around the stack (for example my own stack approaching to destroy his) ? In attack, is there a way to evaluate the whole stack attack like humans do by comparing units, promotions and odds, like humans do ? It would allow to know if it will probably work before the first unit attacks. I mean when a human attacks a city with a stack, he does it because he knows he has 80 or 90 % chance to take the city in this turn or the next... otherwise he doesn't attack. And usually he's right. Can the AI do the same complex calculation ?

Controlling the path used would allow us to make the AI stacks use hills and forest to protect while moving.

Last thing, the units chosen are sometimes too generic, I saw too many mounted units with combat 1 and 2 promotions, not enough city raiders 1/2/3 melee (macemen...). For cats and trebs, city raiders 1/2/3 are a must I think, they will still do collateral damages and bombard well anyway, so...

Overall, the AI did a good job, and I already see all your improvements. Make them more aggressive, make them use their stacks better, and make them really try to win (by attacking and checking who wins), it will be great ;)
 
Can you give some more details about this? What map type? How did the religions fall out?

Did you nab some important early wonders and have a tech lead the whole game? The 12/12 build was a bit low on building wonders, so it was too easy to grab the early ones, allowing you to become the tech leader too easily.
A few notes, not to you as much as to the poster you responded to.

In honor of builders - you know, those people who used to crush the computer in previous versions of Civ - I don't think that the AI should behave with unusual aggression unless the Aggressive AI switch is set. There are enough leaders who behave aggressively. A variety of mostly peaceful wins should be possible given reasonable circumstances (not starting between Monty and Napoleon for example) and some player skill with diplomacy.

Having the AI play "spoiler" in a self-destructive manner, just to keep a player from winning, is a generally unfun thing that should be reserved for people who want that kind of experience. The peaceful leaders should remain peaceful in reasonable circumstances (the human player has reasonable power, and so on) and the warlike leaders shouldn't embark on human wave assaults that are doomed to fail - unless, of course, that's what the player asks for.

Limited war, I think, would be a great concept. Already there are "limited" wars resulting when AIs insist on flinging troops at well defended positions for dozens of turns. (In other words, pointless battles.) I have noticed that some AIs focus on attacking a single city so single-mindedly that they don't bother to pillage. It's one thing to defend a city with walls and longbows; it's another to keep knights from tearing up all the farms. But in any event, when the AI is having no success with its attack, not even coming close to breaking even, maybe it should lose interest in its effort sooner.

I wonder if there could be an addition to diplomacy along the lines of "You must make peace with me, or my friend XXX will attack you." Or perhaps "You must make peace with my friend XXX or I will attack you."
 
I understand what you say but I don't totally agree. I think at least the warmongers (Napy, Monty, Alex, Shaka...) should attack more, even if not on 'aggressive AI' settings, because that's their game, that's their chance to win.

I mean they must leverage their traits (agressive, charismatic, imperialistic). They MUST try to win this way, because that's their hope to beat Mansa or the other builders. I agree with you that builders should continue to try to build, and attack only when necessary.

For me what is unfun is a game like the one I played when everybody just sat looking at me building and winning without even trying anything... Now I must admit that there were few warmongers in my latest game (except Alex and Stalin). But even there, Alex and Stalin were far too quiet.

On 'aggressive AI', I think even the builders should consider attack more because that's what the setting mean after all.
 
I understand what you say but I don't totally agree. I think at least the warmongers (Napy, Monty, Alex, Shaka...) should attack more, even if not on 'aggressive AI' settings, because that's their game, that's their chance to win.

To an extent, yes, I agree. If attacking will give them a legit shot at winning or improving their position, then by all mean they should attack. But what I really wouldnt want to see is having AIs 'taking one for the team' and throwing themselves at the player just to slow them down and let someone else win. That begins to destroy the feeling of the 'Civilization' IMO.

I'd prefer that without 'Aggressive AI' on that the AIs still more or less respond 'in character'.
 
They could team up on the AI who is winning too... And you could team up with them. In a way it's logical to try to win. The humans generally play Civ to win, and the AI don't, so what is the point ? Of course you win if they don't try to stop you... Where is the challenge ?
 
In honor of builders - you know, those people who used to crush the computer in previous versions of Civ - I don't think that the AI should behave with unusual aggression unless the Aggressive AI switch is set. There are enough leaders who behave aggressively. A variety of mostly peaceful wins should be possible given reasonable circumstances (not starting between Monty and Napoleon for example) and some player skill with diplomacy.

Yep, this game isn't only for us warmongers. The AI should not create an RTS always war feel. That said, it'd be great if agressive AI made it so the AI was alot more willing to war. I'd like to see a domination win or two with this setting clicked. It'd be great to have Ragnar or Brenus build a vassal juggernat that they roll in a perpetualy building global war, taking out civs 1 by 1 until I see "you have been defeated" in the middle of an expected spaceship victory. I have yet to see the AI do this. And while it'd be tuff to program I'm sure, the amazingly awesome better AI team was able to program Cultural victory, a feat I thought was impossible when first proposed. So quite possibly the AI could under the Agressive AI setting be programmed to have the warmonger civs go to war simply to vassilize a neighbor and then roll on to the next target as a human often does when going for a domination win.

Having the AI play "spoiler" in a self-destructive manner, just to keep a player from winning, is a generally unfun thing that should be reserved for people who want that kind of experience. The peaceful leaders should remain peaceful in reasonable circumstances (the human player has reasonable power, and so on) and the warlike leaders shouldn't embark on human wave assaults that are doomed to fail - unless, of course, that's what the player asks for.

Couldn't agree more. This'd just be lame.

Limited war, I think, would be a great concept. Already there are "limited" wars resulting when AIs insist on flinging troops at well defended positions for dozens of turns. (In other words, pointless battles.) I have noticed that some AIs focus on attacking a single city so single-mindedly that they don't bother to pillage. It's one thing to defend a city with walls and longbows; it's another to keep knights from tearing up all the farms. But in any event, when the AI is having no success with its attack, not even coming close to breaking even, maybe it should lose interest in its effort sooner.

I do this when I find myself in a war I don't expect to win easily. I ignore the cities and pillage to my hearts content. I usually do this when I need money, and have even started wars with no intent to take cities (at first) just for the Gold from pillaging. Deffinatly if "limited war" could be taylored to make the Agressor Money, that'd improve the proficiency of the AI, espcecially the warmongers. Sometimes you just want to take Mansa's economy down, and give yourself some nice deficit spending gold rather then conquer

If you want to make this super strong. It'd be best to have limited war do this, and allow the AI to switch midwar to total war if it can percieve it has acheived a large advantage (either through tech or shear production) and then begin conquering after the finances are settled and the pendulum has surely swung in the favor of the aggressor.
 
They could team up on the AI who is winning too... And you could team up with them. In a way it's logical to try to win. The humans generally play Civ to win, and the AI don't, so what is the point ? Of course you win if they don't try to stop you... Where is the challenge ?

That's just plain wrong. There's a huge difference between trying to win (which the AI does... though maybe not enough yet) and actively preventing others from winning (which the AI thankfully does not). The former is fun, the latter is a cheesy and frustrating exercise. "Oh great, all of a sudden all my friends and allies loathe me and attack me... what a fun game... NOT". And every 4x game that worked with the latter idea invariably ended up on the "really bad" pile of gaming history. And rightfully so.
 
Iustus said:
- AI values gold more in trade (known issue with rounding to 10g broken)

Are you sure you haven't gone too far with this one? Playing with the 21.12.06 version, Frederick of all people won't give me anything for my techs (guilds, paper) despite him having 670 gold in the bank.

Another question: have you changed the speed at which the +4 fair trade relations wear off? Maybe it's just me on that one, just curious.
 
For your holiday pleasure, new 12/21 build on sourceforge
-Iustus

Excellent. I see that dealing with production-crippled AI civs was worked on in this build. Hopefully I won't have to raze so many food tiles to convert them to production tiles after taking an AI city. (Which was common with the Dec 12 build.)

I'm also thrilled by the idea that workers will take their clues from the city governor when improving tiles.

I'm also looking forward to better defense by the AI.

...

Now, on the "AIs should go after the current leader" idea proposed. Personally, I'm in favor of it as long as they're not aiming at the human player all the time.

The "vassal juggernaut" is a good example of why this is needed. Once you start absorbing vassals and get twice as large as any single civilization, it's pretty much only a matter of time before you win. (I tend to play with only domination/capitulate turned on.)

I'd like to see civs being less willing to capitulate as the oppressor gets closer to the domination win. Either you'll have to beat them down farther before they give in or they should try to bring in other war enemies against the oppressor.

Maybe some civs need to be more fanatical about suiciding every possible defender against the oppressor rather then capitulating. Especially if the oppressor has a different state religion. If you're going to go down anyway, may as well try to do as much damage as possible?
 
That's just plain wrong. There's a huge difference between trying to win (which the AI does... though maybe not enough yet) and actively preventing others from winning (which the AI thankfully does not). The former is fun, the latter is a cheesy and frustrating exercise. "Oh great, all of a sudden all my friends and allies loathe me and attack me... what a fun game... NOT". And every 4x game that worked with the latter idea invariably ended up on the "really bad" pile of gaming history. And rightfully so.

You don't understand what I say. I don't say that EVERY AI should team up vs the number one civ, which is a bit cheesy, but I think they should act more like a human by effectively trying to win, which is very different. My latest game, I just built quietly, no civ dared to make embargo against me, no civ dared ally against me, no civ (except Alex once) attacked me. What is the point then ? I want a challenge.

What do you do when you loose the game, when other civs are about to win ? Personnally I try to form alliance with other civs, I try to make embargos against them. And if I can, of course I attack. I don't ask for more, juste a realistic 'human-like' behaviour.

It's not 'The Sims' it's Civilization. There are many games where you can play a sandbox game...

Look at other great TBS : in Galactic Civilizations 2, races are able to form alliances to be able to resist more to the leader since the latest patches... And it's a great game (it was elected TBS of the year on a game site).

It's not about 'teaming up against the number one', it's about 'making at least something to try to win'.

The minimal solution would be to have an 'aggressive' behaviour at least when 'aggressive AI' is on.
 
Back
Top Bottom