A Better AI.

It's not that simple as i see in the leaderheadsinfo file.
There are a lot attitude modifiers and numerous separate values for war decision among a lot others.
You can even set them to attack the cautious or pleased rivals too if they're in the position.
There are a mass of personality values there for a miriad things.
I'm afraid to mess them up. :)

Surely it's not necessary to restrict trade that much to make the game more warlike.
And it's not even THAT MUCH more warlike so i never use that option.

Oh, of course! I'd completely forgotten about the stuff that drives leader "personalities". I will take a look at the leaderheadsinfo file just to satisify my curiousity if nothing else.

I still believe that trade, war decisions, and U.N. votes are tied too closely together.
 
New version, 11/26 available from the Sourceforge Downloads page

changes:
- Governor bugfixes. All known bugs are fixed in the city governor:
* bug that removed a good high food tile, and added a good
low food tile
* bug that caused player cities to starve
* bug that caused AI cities to starve extensively
* emphasize commerce specialist behavior changed: it now looks
at slider settings, rather than just picking merchants. This
means if you are at 100% culture, the governor will
auotmatically select artists if you click emphasize commerce
* generic citizens are given 60% value, you should not get them
when another specialist is available (except possibly when
emphasizing production)
* even if at or over happy cap, if two tiles are equal except
for food, the higher food tile will still be chosen.
* if in slavery, cities are encouraged to go one over happy cap
* 4 commerce tiles are now slightly prefered over 1 production
* emphasize buttons have a stronger effect
*
- building a cheap building frequency lowered
- cultural victory tweaks, including tech choices and city builds
- once music discovered, cities will build culture to pop borders
- captured cities will choose a building first, not a unit
- national and world wonders should be built in an appropriate city
- buildings that increase great people rate are more likely to be built in cities that already have a high great people rate
- monastaries are more likely to be built
- once a civ gets far enough along a cultural victory, it will stop doing dagger if it was previously
- bug that prevented a war declaration when the attack stack
was inside friendly borders and next to the attack target
- AIs re-evaluate their city builds if they enter financial trouble or learn a new tech (wonders in progress are continued however)
- some chipotle cheat mode fixes, particularly with trade messages
- promotion choice fixes
- theocracy use in cultural victory strat adjusted
- improved boat building logic
- tweaked strategies (isn't that descriptive!)

Please report any issues you see with the city governor. I encourage everyone to use it all the time now. You should be able to get the tiles you want to work either by default, or by selecting one or more of the emphasize buttons.

Particularly, try emphasize commerce in cases where you going for a cultural victory.

Enjoy!

-Iustus
 
One thing that would help would be to reintroduce zone of control. As it is, my SOD can go around any forts you build, any units you put on hills or in forests, etc. on the way to your city or crucial resource, without penalty. If bypassing units in fortified positions meant you got free hits on me, I'd have to deal with those units, without the benefit of my City Raider bonuses, to get there, or else I'd arrive with a weakened stack at no cost to you.

This is outside the scope of this project. There are already mods out there that do this. I would encourage the makers of those mods to integrate the Better AI into their mods.

-Iustus
 
- once music discovered, cities will build culture to pop borders

Didnt it suppose to be Drama? Or its made on purpouse to wait untill Music? But then, what if they dont have Drama yet?



Anyway, great changes! But I still prefer to micromanage my cities myself :crazyeye: Call me pessimist or methodic :p But I can 'test' anyway hehe.
 
Didnt it suppose to be Drama? Or its made on purpouse to wait untill Music? But then, what if they dont have Drama yet?

I made this same mistake myself, when testing the change. Actually, Drama lets you change your culture slider. But it is not until Music that you can actually build culture in a city. In any case, it doesn't really look for "Music" it just looks for being able to build culture, so if someone changes the XML, it will react appropriately.

The main thing is building culture is a super fast way to pop borders, and you almost always should do it once you can. This works particularly well with captured cities.

But I still prefer to micromanage my cities myself Call me pessimist or methodic But I can 'test' anyway hehe.

Fair enough, thanks for testing. Instead of micromanaging the tiles, try just using a combination of emphasis buttons can give you what you want. If there is a case where it doesnt, I would like to see it, preferably with a save file attached, and a description of which plot/specialist you would prefer it work instead of which other plot/specialist you want it to not work.

I am going to tinker with it a bit more, so at least one more change to the governor is coming. I am pulling out the slowing down of working food as you get close to the happy cap. It will go full bore until you hit the cap and continue until the food level is almost full.

-Iustus
 
This is outside the scope of this project. There are already mods out there that do this. I would encourage the makers of those mods to integrate the Better AI into their mods.

-Iustus

I don't know if it's also outside the scope of this project, but it would be good to add the orders "Mass Fortify" and "Mass Delete". You can update ALL units of some kind, pressing ALT key + UPGRADE button on an obsolete unit. The next turn, all the upgraded units awake, and it's a real pain to fortify them ONE by ONE :cry:

My question is: can this behaviour be added modifying CvGameCoreDLL.dll? can it be modded, or it's hardcoded and we should wait for the next official patch (if there's a new patch ever...).
 
Hi Blake/Iustus,

I've been following this thread and your AI developments with keen interest. Before I decide whether or not to take the plunge and try the recent version of the Better AI (currently using 2.08), one thing I wanted to ask is whether anything has been done to tweak the likelihood of the AI declaring war on other AI?

In most of my previous games the AI tends to live it very peacefully with other AI on the same continent. This is all fine and well but it seems to be like this every game I play and this can result in rather repetitive, boring tech races.

The known psychos like Montezuma are quite happy to declare war on me, (probably a result of playing at Monarch level and lagging behind in the power rating), but they always seem reluctant to fight it out with the other AI for whatever reason.

Anyway, I'm interested to hear what you guys think on this, and indeed whether anything's been done in your Better AI to focus the AI's war ambitions a little more when it comes to sharing close proximity with other AI?

Cheers

Edit: I also really like the change to making the AI build culture on freshly conquered cities. I do this as a matter of course and therefore I'd hope the AI would too.
 
Playing a game on Prince, using the build prior to todays.

Small pangea, 4 AI, Prince, no tech trading, my modified game speed (sloooow tech, slow culture growth, normal build speed).

I randomly got Japan, so choose to be aggressive, my only neighbour was Hannibal (I started on a peninsular), Roosevelt and Saladin the other side of him, and Asoka the other side of Saladin.

I went straight for Bronze working, while the others squabbled for the religions (first two went to Asoka and Roosevelt).

The only copper was in unclaimed areas near me (3 bits on the whole map) - I pump a couple of settlers to grab them, and start building axemen.

Asoka declares war on Hannibal! Asks me to join in - I agree and absorb all his cities, crippling my economy and putting me well back on tech. I still continue to build troops....

I have to concentrate on economic techs.

I notice the Americans must of researched Iron working, and they come and stand on a wooded hill near my capitol with a massive stack (which then does not move)

I then research catapults and declare war on America - I have some big mean stacks come into me, but he didn't have cats at the beginning of the war, and I have loads of Elephants and axemen - one city changed hands several times, but I take half his empire while researching Iron working and realise I have captured his source of Iron, I have a small stack sitting on his horses (which is a good job as I realised he had a few knights scattered about).

I will easily finish him off in my next sitting, especially as I have just got my samurai building.


In conclusion - much more fun - the AI fights more intelligently - The AI techs horrible fast (I used to outpace it in Prince) - you say you have solved the 'AI large stack sitting in someone elses territory' problem

Interesting point:
The first war was AI v AI, declared by the WEAKER AI in power.
 
Not sure that this is the same stack-won't-attack issue that's reportedly fixed in the 11-26 build. I'll mention it anyway...

Using the 11-18 build, I had captured a city from Mansa. He rolled up a huge stack of city-defender infantry and parked them on a hill next to the captured city, but inside his cultural boundary. I wasn't strong enough for a few turns to take them on. They didn't attack. Once my artillery healed, I wiped them out.
 
11-26 build.

Here's what I was getting at with the AI prioritization of food resources in regard to city placement. It's not just on archipelago maps.

I set up a good site for two cities. That's the first screenshot. (If anything, it might be a good spot for 4 cities, but definitely at least 2.) Gave Saladin 2 settlers there, already put them where the 2 cities would go. What does he do? Moves one settler to the dead middle, founds a city, and fortifies the second settler inside the city!

I can see the AI prioritizing resources, making a "mega city" while other cities get nothing. Personally, I would spread them out and make two very decent cities instead of one awesome and one crappy city. But, I can see how this can be a strategic choice, so that's fine.

However, this also ignores city spread... spacing cities out so that they aren't either "wasting tiles" by leaving useless gaps between cities, and aren't crowding cities by making them too close together. I took at look at my last game (using the 11-22 build) and most of the AIs had a ton of cities exactly 3 apart. My suspicion is that they founded cities to nab all the resources, and then filled in the gaps whereever possible later on in the game. City crowding used to be the old Civ3 culture-victory tactic, and is still sometimes a good idea to do a mega-whip strategy churning out units, but I don't think it should be the norm, standard choice for AI placement.

My suggestion is to have the AI look at the "spread" of city sites. For example, it's usually better to site a new city 5 or 6 tiles away from previous cities. Yes, there might be more resources just a bit further. No problem, the next city will get them. In addition, the AI should look at where coastlines fall, spreading out cities so that the maximum territory will eventually be occupied.

Wodan
 

Attachments

  • city placement test 10000.JPG
    city placement test 10000.JPG
    121.4 KB · Views: 148
  • city placement test 20000.JPG
    city placement test 20000.JPG
    121.3 KB · Views: 134
Warmorder Brothehood is logical.
One warmonder will avoide to attack an other - too expencive and go after softer targets first.

There is a power check before war so it won't attack a twice as strong civ whether it's warmonger, peacemonger or anything.
A warmonger could also be much weaker and a racionalist or even peacemonger could be stronger.

It's another thing.
It's the anomaly that warmongers actually like each other more which is incorrect.
But as i understand the AI attitudes system in the leaderheadinfos file there's no way to change this. But you can change warmongers to attack cautious rivals too without pardon as i have done.
 
I agree with you Mutineer.

Forest/Hills attack promotion would be very logical and useful.
Maybe someone should create a mod for this.

ZOC idea is also cool.
But we can see it's a big challenge to tweak the AI even for default rules so putting in new rules is a quite unfair towards Blake and Co.
I appreciate the Blake teams work very much.
I can imagine how hard is to program a good AI i just learn VERY basic AI programming knowledge in school and it's very damned difficult to understand even the most basic things :)
 
one thing I wanted to ask is whether anything has been done to tweak the likelihood of the AI declaring war on other AI?

You can do this yourself.
Change the 'nowarattitudeprobs' values in leaderheadsinfo file and they will declare war more often.
By default it's too shy for my taste too.

Try to clear the values for annoyed and cautious for all leaders that will do the job :groucho:

I haven't go that far just done that (left some mercy for the cautious ones with some softer warmongers like Catherine) for the 'warmongers' (basepeaceweight 0-3) and cleared annoyed for the 'racionalists' (basepeaceweight 4-6)

Also the more different religions in effect as state rel the more religious hatred and war.

AI doesn't take into decision whether you're human or another AI when declaring war but evaluates a lot other things look at the leaderheadsinfo file.
 
Wouldn't it be good to increase max civs in game to 24 for all civs on a huge map to be possible?
Or would it cause conflicts (interface whatever)?
 
Wouldn't it be good to increase max civs in game to 24 for all civs on a huge map to be possible?
Or would it cause conflicts (interface whatever)?

As far as I know there is mods out there already doing so!
 
11-26 build.

Here's what I was getting at with the AI prioritization of food resources in regard to city placement. It's not just on archipelago maps.

I set up a good site for two cities. That's the first screenshot. (If anything, it might be a good spot for 4 cities, but definitely at least 2.) Gave Saladin 2 settlers there, already put them where the 2 cities would go. What does he do? Moves one settler to the dead middle, founds a city, and fortifies the second settler inside the city!

I can see the AI prioritizing resources, making a "mega city" while other cities get nothing. Personally, I would spread them out and make two very decent cities instead of one awesome and one crappy city. But, I can see how this can be a strategic choice, so that's fine.

However, this also ignores city spread... spacing cities out so that they aren't either "wasting tiles" by leaving useless gaps between cities, and aren't crowding cities by making them too close together. I took at look at my last game (using the 11-22 build) and most of the AIs had a ton of cities exactly 3 apart. My suspicion is that they founded cities to nab all the resources, and then filled in the gaps whereever possible later on in the game. City crowding used to be the old Civ3 culture-victory tactic, and is still sometimes a good idea to do a mega-whip strategy churning out units, but I don't think it should be the norm, standard choice for AI placement.

My suggestion is to have the AI look at the "spread" of city sites. For example, it's usually better to site a new city 5 or 6 tiles away from previous cities. Yes, there might be more resources just a bit further. No problem, the next city will get them. In addition, the AI should look at where coastlines fall, spreading out cities so that the maximum territory will eventually be occupied.

Wodan

Thanks for the screenshots. I understand what you are getting at here, but in reality, I think the choice of city locations is pretty good right now, good enough for our 1.0 release. What you are talking about would involve huge changes in how city placement works.

How does it work? (This is in 1.61 all the way through 2.08 and Better AI)

Each plot on the map is scored for 'Founding a City' value for each player. Locations that are not revealed yet get a zero score. Bonus resources that are not revealed by techs do not count for that player.

When an AI has a settler, it basically does the following (danger issues aside):

  1. If a civ has zero cities, and it can found on its current plot, it does so, always.
  2. If there is a plot with a non-zero value within 6 in any direction, it sends the settler to the best spot (once it gets there, it will check again)
  3. If it is on the best spot within 6, then it founds a city
  4. If there is no non-zero score within 6, it checks everywhere on the map it can path to, and picks the best spot, weighted by the distance to get there, and sends the settler there. (once it gets there, it will make all the checks again)

Now, what Blake did, is make some huge improvements in how plots are scored. If you think this score is off, we can look into it. But at least for 1.0, I do not think we are going to change the logic of going for the best score.

If you set cheatcode = chipotle in your .ini file, you can check these values out yourself. Hold down the alt-key and mouse over a plot to see the found value for every player. If you think these values are wrong, give us a screenshot and/or a save file. Note, the blue circles do not always pick the best value, I have not looked into what craziness they are doing.

Getting back to your example, if the AI had no cities, it will always found in its current location (that is to ensure that cities get placed where the map script wanted them placed).

-Iustus
 
Not sure that this is the same stack-won't-attack issue that's reportedly fixed in the 11-26 build. I'll mention it anyway...

Using the 11-18 build, I had captured a city from Mansa. He rolled up a huge stack of city-defender infantry and parked them on a hill next to the captured city, but inside his cultural boundary. I wasn't strong enough for a few turns to take them on. They didn't attack. Once my artillery healed, I wiped them out.

When you say city defender infantry, they were given the UnitAI of CITY_DEFENDER? If so, they wont attack, ever on their own. They need to be grouped with a city attack stack, lead by a city attack unit, before they will attack.

Now, its possibly they may have got stuck, because they were sent to the city to reinforce, before you took it. But i do not think that is the case. They were more than likely just sitting around because there was no where useful for them to go to defend a city.

Stacks will just sit around if there is no friendly city nearby to sit in, if there is nothing else to do.

-Iustus
 
HiI've been following this thread and your AI developments with keen interest. Before I decide whether or not to take the plunge and try the recent version of the Better AI (currently using 2.08), one thing I wanted to ask is whether anything has been done to tweak the likelihood of the AI declaring war on other AI?

There have been a few tweaks in both this, and the likelyhood of accepting peace after war is declared.

There is a bigger change that may make it into 1.0 involving AIs that are in financial trouble. Right now, any AI in financial trouble will not declare war. Well, this is really backwards. Warmonger AIs should declare war when they are in financial trouble, to take cities for the cash to fund themselves. If this works out, it may actually drive warmonger AIs into domination victories. Peacnik AIs would of course try to find other ways to come up with cash.

-Iustus
 
Back
Top Bottom