Resource icon

AI+ v13.1

This mod does seem to improve the war AI a little bit but not by much.

I wanted to make sure the AI had a relatively fair time about it so I played the game twice. The first game I made sure my military stats were the highest and in the second game I made sure that they were the lowest.

In both games I started a war on every single civ in the later ancient era. My units consisted of chariots, slingers and warriors in equal number. In both games I had four cities on a small map. Two cities were 'functioning' and two were empty 'just settled'; easy targets. The civs I declared wars against were Gorgo, Japan, Rome and America.

In the first game

-- Gorgo (my neighbor of 5 tiles) did nothing. at. all.

-- Rome (across the map) took three turns to attack a scout in the middle of nowhere (with legions no less) - Rome waited until there were two legions before it attacked the defenseless scout.

-- Rome went after the empty city BUT it displayed an interesting behavior that is that Rome would only attack the city after the legion regained full health. It never tried to reinforce it's attack. It did eventually take the city, but only because I wanted to see if it would. With the amount of time it spent healing I could have overwhelmed the area with units.

-- Japan (my neighbor of 5-7 tiles) attacked the same empty city and displayed the same exact behavior, it would not attack the city again until it's unit was fully healed and did not reinforce it's unit.

-- Japan did try to attack one of the two main, productive and protected, cities. However it did little more than cycle in a lone unit - attacked by my archers - and then cycled in another unit -- attacked by my archers. Japan made no attempt at a unit rush - even though it had the capability and numbers to do so.


The second game was more or less the same even with me having a much lower military capability. One thing I noticed with this mod (or maybe it was just random) is that the AI was much more willing to accept peace deals, and pay very well for them even when they were much stronger than I was militarily.
---------

I think the mod (if possible) needs to make the AI less timid in attack. Now, do not get me wrong it's better to have timid units who actually do something than a rush that just sits around doing nothing -- but they should take a risk when it's in their interest to do so.

P.S I have also noticed that when playing on my old core2duo instead of my desktop's i7 that the AI tends to behave better - especially when deciding what units to produce. I know that's in the source code and you cannot do anything about it... but I wonder if this game gets confused or something with too many threads going...
 
Still seeing a problem with the AI building tons of settlers and then doing nothing with them. Here is France with *7*!!
 
Okay so I don't know if this is just a weird coincidence or not but I've been playing a game with v5 on a huge map, and for the entirety of the game not a single AI has built a theater district at any point. There are literally hundreds of cities on the map yet not a single one. All of them are still at 0 writer/artist/musician points. I can't help but find this rather suspicious

I can confirm this behaviour in my previous two games. No great artist/writer/musician points after over 100 turns into the game.
 
Okay so I don't know if this is just a weird coincidence or not but I've been playing a game with v5 on a huge map, and for the entirety of the game not a single AI has built a theater district at any point. There are literally hundreds of cities on the map yet not a single one. All of them are still at 0 writer/artist/musician points. I can't help but find this rather suspicious
this is same for me too but i have disabled cultural and science victory and i thought that was the reason.
in my games AI always builds commercial districts first then industrial then if they have nothing else to do maybe just maybe a rare campus district. which should be the other way i think and campus should be first excluding districts like harbor and encampment which are situational buildings.
this might be why im always a whole eras ahead. i thought it was cuz i abuse eurekas.and wonders with builders.
 
-- Japan did try to attack one of the two main, productive and protected, cities. However it did little more than cycle in a lone unit - attacked by my archers - and then cycled in another unit -- attacked by my archers. Japan made no attempt at a unit rush - even though it had the capability and numbers to do so.
Interesting test, thanks for the effort! Without having any real experience modding, I suspect the core of the issue is that the AI is implemented entirely on a per-unit basis with absolutely no kind of unit coordination (outside of the fact that each unit knows if its at war or not).

If this is the case, I doubt a mod is going to be able to make any serious in-roads on military strategy. One way or another, units need to be able to take "orders" from an algorithm or process in charge of a coordinated strategy. Regardless of how smart each unit may be, I don't think an "every unit for itself" implementation is ever going to work out well.
 
this is same for me too but i have disabled cultural and science victory and i thought that was the reason.
in my games AI always builds commercial districts first then industrial then if they have nothing else to do maybe just maybe a rare campus district. which should be the other way i think and campus should be first excluding districts like harbor and encampment which are situational buildings.
this might be why im always a whole eras ahead. i thought it was cuz i abuse eurekas.and wonders with builders.

I see exactly the same, AI builds faith, commercial and industrial districts, very rare science districtsand encampment and no culture districts at all! I think there is a problem with either pseudoyields numbers in the file or preferences towards great people generation. It is also possible that because of insane settlers spam AI doesn't have time to build many districtrs. I am trying to remove/change part of the code in modfiles and see how it impacts the results.
 
FYI they just released the first official patch. On paper it has many "AI fixes" so for now will have to give it a try w/ this mod disabled.
 
I'd be very interested to hear anyone's experience playing the new patch without AI+ to see how much they really improved the AI.

Not to be a cynic, because I am greatly supportive of Firaxis and their work, but I'm assuming the AI is still 90% broken. They mention some AI changes in passing, but they seemed too general and secondary in the notes to really represent the complete AI overhaul that is needed.
 
FYI they just released the first official patch. On paper it has many "AI fixes" so for now will have to give it a try w/ this mod disabled.

Yeah it's nice they're at least tying to do some stuff. Looking at the xml some of the changes seem to sadly be rather limited. But I'm excited about the potential of some of them (especailly the ones I couldn't do any work on)
Edit: I've tested it out with both v5 and v6 now, there don't seem to be any real compatability issues, so it's safe to use both.

Spoiler modding.log :



That is whole modding log, hope it helps :)

Looks like Ai+ isn't being loaded. Make sure you reselect it in additional content when upgrading versions. The crash probably relates to it expecting AI+ stuff to be there, and without it present, it dosn't know what to do and crashes.


Okay so I don't know if this is just a weird coincidence or not but I've been playing a game with v5 on a huge map, and for the entirety of the game not a single AI has built a theater district at any point. There are literally hundreds of cities on the map yet not a single one. All of them are still at 0 writer/artist/musician points.
I can confirm this behaviour in my previous two games. No great artist/writer/musician points after over 100 turns into the game.
this is same for me too but i have disabled cultural and science victory and i thought that was the reason.
in my games AI always builds commercial districts first then industrial then if they have nothing else to do maybe just maybe a rare campus district. which should be the other way i think and campus should be first excluding districts like harbor and encampment which are situational buildings.
this might be why im always a whole eras ahead. i thought it was cuz i abuse eurekas.and wonders with builders.

I see exactly the same, AI builds faith, commercial and industrial districts, very rare science districtsand encampment and no culture districts at all!

Hmm, interesting, thanks for the feedback guys. Will have a good look at this. I don't recall changing anything about theatres recently, so it probably emerged from other changes somewhere. Will try to get on this right away.

This mod does seem to improve the war AI a little bit but not by much.

I think the mod (if possible) needs to make the AI less timid in attack. Now, do not get me wrong it's better to have timid units who actually do something than a rush that just sits around doing nothing -- but they should take a risk when it's in their interest to do so.

P.S I have also noticed that when playing on my old core2duo instead of my desktop's i7 that the AI tends to behave better - especially when deciding what units to produce. I know that's in the source code and you cannot do anything about it... but I wonder if this game gets confused or something with too many threads going...

Thanks for the detailed feedback! As you said I've been trying to make it less timid, and send more of its units over, but without the dll its hard to get much further. I think the cpu difference, and the 'more peace deals' are probably just random though. The buiding decision mechanism is almost certianly run on one core so there shouldnt be any differences. When it comes to peace deals, that's not something I can change at all. At the most, it could be that the AI sends more units in, so that if it suffers a crushing defeat by your hands, it'll be left with less units than it used to. Possibly making it more eager to make peace.


Still seeing a problem with the AI building tons of settlers and then doing nothing with them. Here is France with *7*!!

Do you happen to know if there were barbs around that player? If so, it's something I'm working on. Sadly not too easy to get right..

Interesting test, thanks for the effort! Without having any real experience modding, I suspect the core of the issue is that the AI is implemented entirely on a per-unit basis with absolutely no kind of unit coordination (outside of the fact that each unit knows if its at war or not).

If this is the case, I doubt a mod is going to be able to make any serious in-roads on military strategy. One way or another, units need to be able to take "orders" from an algorithm or process in charge of a coordinated strategy. Regardless of how smart each unit may be, I don't think an "every unit for itself" implementation is ever going to work out well.

There's a per unit basis sytem and an 'operations' system. I cannot touch the unit-basis system at all, but it's honestly not the worst of . It's the operations, the more coordinated thing where most of the issues arise. And while I can change those, the tools are extremely extremely limited. The main reason they're so bad is that you have almost no access to data (like, are there enemy units around? what is the health of the city were attacking), and commands are basically given to all units at once. One thing you often see is that it has a city at 1 turn from capturing, but then sees a unit within range, and decides to move all of its units towards that single unit to attack it.


That is whole modding log, hope it helps :)

Looks like Ai+ isn't being loaded. Make sure you reselect it in additional content when upgrading versions. The crash probably relates to it expecting AI+ stuff to be there, and without it present it just ends up crashing.
 
Last edited:
I was never too great at this game but the AI has gotten noticeably better in the noncombat aspects of the game with this latest patch. I was actually surprised to see that no senseless war declarations came my way in the early game. However when a war was started they attacked me with a good amount of forces and they actually prioritized trying to take one of my better cities. I offered them various different cities while trying to negotiate for peace (including returning the city I took) but the AI was dead set on getting one of my better city or wasn't at all interested in my minor cities. Overall the AI might still not be challenging enough for some veterans but it has provided a very nice challenge for me.
 
I was never too great at this game but the AI has gotten noticeably better in the noncombat aspects of the game with this latest patch. I was actually surprised to see that no senseless war declarations came my way in the early game. However when a war was started they attacked me with a good amount of forces and they actually prioritized trying to take one of my better cities. I offered them various different cities while trying to negotiate for peace (including returning the city I took) but the AI was dead set on getting one of my better city or wasn't at all interested in my minor cities. Overall the AI might still not be challenging enough for some veterans but it has provided a very nice challenge for me.

Were you able to gain vision on many/any of their cities? I'm curious to hear about their settling patterns and habits, and what districts they seemed to be prioritizing, if any.
 
What if I would want a mod that would raise strategic AI units aggressivity by 500% (more or less^^) when at war but doesn't change any other aspect of AI atm?

Is it easy (how?) to remove most of the features of this mod keeping just that aspect?

Reason : It's not really kind I know :( but atm I feel like it has too many collateral issues (recent cultural issue is one, settlers idle is another), I know some of them might be vanilla based. It also has too many changes that honestly I feel are not needed. I'd rather be able to pinpoint those issues myself than having a mod that tries to correct too many aspect of AI at once. Anyway, not trying to argue, do your thing the way you want it, but if you could provide a "limited" version of the mod, you would make a happy man.

Digression : I know some aspects are linked in AI but some also aren't. Why not make separate mods when doable? Like "AI+ - Strategic warfare" and "AI+ - Settling, - Builders & improvements" and "AI+ - Leaders behaviors" etc. Ok might be too much work I admit :p

EDIT : I realize my post might seem a little harsh, especially since you do it for community on your own free time. I'm starting a new game (with fall patch and AI+ v5), will post results when/if applicable. Note : I setted "smooth difficulty" mod feat science and culture from +15 to +12 (vanilla is +8) so this deity game will be + 48%, still harder than vanilla, but gold and prod from +30 to +50 (vanilla is +20) so this deity game will be +200%! I hope there won't be too much issue and AI will attack with units when at war, not needing being 50 techs ahead in science which no amount of prod/gold could correct.
 
Last edited:
Is it easy (how?) to remove most of the features of this mod keeping just that aspect?

Reason : It's not really kind I know :( but atm I feel like it has too many collateral issues (recent cultural issue is one, settlers idle is another), I know some of them might be vanilla based. It also has too many changes that honestly I feel are not needed. I'd rather be able to pinpoint those issues myself than having a mod that tries to correct too many aspect of AI at once. Anyway, not trying to argue, do your thing the way you want it, but if you could provide a "limited" version of the mod, you would make a happy man.

Digression : I know some aspects are linked in AI but some also aren't. Why not make separate mods when doable? Like "AI+ - Strategic warfare" and "AI+ - Settling, - Builders & improvements" and "AI+ - Leaders behaviors" etc. Ok might be too much work I admit :p

EDIT : I realize my post might seem a little harsh, especially since you do it for community on your own free time. I'm starting a new game (with fall patch and AI+ v5), will post results when/if applicable. Note : I setted "smooth difficulty" mod feat science and culture from +15 to +12 (vanilla is +8) so this deity game will be + 48%, still harder than vanilla, but gold and prod from +30 to +50 (vanilla is +20) so this deity game will be +200%! I hope there won't be too much issue and AI will attack with units when at war, not needing being 50 techs ahead in science which no amount of prod/gold could correct.

Your comments are fair, no worries! This mod is still in the alpha version while I try to make big steps, and so things do go wrong sometimes. Should be able to launch a 'stable' version relatively soon that just has improvements without any of these weird settler/culture issues.

Anyway, as to oyur question. It's sadly not as simple as a one line change. The one thing that comes close is that if you find the behaviortree associated with a type of attack, find the 'defend units' node, and set its defend-limit to much lower. If you do that, units will just keep fighting instead of running back to heal.
But really, they'll be wusses in terms of actually sending units to the front, which was one of the areas I felt aI+ had the biggest improvements on so far. Doing that is not easy though, took me many many hours of tinkering and testing. If you want you can try removing everything in the mod, except for the military.xml and behaviortrees.xml. And in those try removing everything that looks like it relates to non-military aspects. I'm not sure what the results will be though since everything is so incredibly interconnected.
 
Thought I'd mention that I'm playing a game (pre-patch, AI+ v5) with settlement radius set to 4 tiles, and settler spam has been nonexistent. I would suspect that the limited availability, lower production capacity (from fewer cities), and subsequent lower traffic all factor into better behavior. AI city locations are decent, again probably due to fewer opportunities to squeeze into dumb spots. If only they'd prioritize aqueducts (where appropriate), I'd say they were doing really well.

I'm also using Horem's slower pace mod (Sloth, Tortoise and Snail) with it's staggered tech tree. However, I've used this combination previously, without adjusting CITY_MIN_RANGE, and settler overproduction was a problem.

One game is a very small sample, but it seems a useful test scenario.
 
Thought I'd mention that I'm playing a game (pre-patch, AI+ v5) with settlement radius set to 4 tiles, and settler spam has been nonexistent. I would suspect that the limited availability, lower production capacity (from fewer cities), and subsequent lower traffic all factor into better behavior. AI city locations are decent, again probably due to fewer opportunities to squeeze into dumb spots. If only they'd prioritize aqueducts (where appropriate), I'd say they were doing really well.

I'm also using Horem's slower pace mod (Sloth, Tortoise and Snail) with it's staggered tech tree. However, I've used this combination previously, without adjusting CITY_MIN_RANGE, and settler overproduction was a problem.

One game is a very small sample, but it seems a useful test scenario.
Do you plan on trying this same scenario but post-patch? I'd be interested to see how it goes.
 
Is the mod working with the new patch - they changed something you are also working on...
 
Gwydion62
Yep, on top of the fixes here, I did a lot of testing and made sure it's compatible with the new official patch. There were no real issues with anything.

I've not been able to reproduce the 'settler buildup' issue now even once in about 6 testing games, so it may be fixed now (did some small changes that might help it more against barbs). Not entirely sure yet though, that issue has a habit of popping up rarely. Too bad it takes me so long to do these test-runs.

For those curious, the lack of walls issue is not completely gone yet, and I'm not sure how to fix it. The issue is that they're not teching masonry if they don't have a lot of spots that need quarries. Which kind of makes sense as the followup techs of construction and military engineering don't do all that much for most AIs. And teching preferences are heavily impacted by the followup techs (which is why archery is so rarely teched). I've already increased their desire to make fortifications and set masonry to be a 'favored' tech, but unfortunately the teching 'favoreds' do either nothing or almost nothing, certainly not enough to make up for the significantly lower desires on these techs. So unfortunately I can't think of any solutions right now.
 
without this mod ,my first try after the new patch,the first settler i see was alone. NO escort and no other unit around 8 plots.
 
Top Bottom