Resource icon

AI+ v13.1

-- 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*!!
CB5D219CFC79E1FA2D8587816672D79A95E47424

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.
 
Wow, Siesta, thanks for quick update! What was the issue with the districts, was it pseudoyields balance?

It appears it was indeed just a balancing on yields. Some small iterative changes to other areas (like a small increase in desire for science) must've pushed it over some border where suddenly no one was interested anymore. It probably happened in one of the later changes before the release, and I didn't notice because I don't look at district counts every game (and cant see gpp counts in the AI only games). Just turned their desire for culture up a little again and all was fine.
In addition I also added a bit more of an extra desire for 'cultural civs'. In vanilla cultural civs were defined, but they had no extra preference for culture/tourism directly, they just had a preference to selecting the culture victory, which would then increase their desires. I think it makes more sense if they have a small base increase in desire too.

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.

Yeah I'm not sure what exactly they're supposed to have done that makes it better, it barely seems to make any difference. It's probably a tiny behaviortree change, since that's where most of the escorting logic takes place. It's so tiny I can't spot it though (wish I had saved the original somewhere). And since the whole behaviortree system is so limited, I doubt they could even make the behavior perfect with changes there.
 
It's so tiny I can't spot it though (wish I had saved the original somewhere). And since the whole behaviortree system is so limited, I doubt they could even make the behavior perfect with changes there.

What files do you need? I have my entire games directory backed up with Crashplan, so I have any file before update saved on the cloud.
 
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.

I've played 3 half games (to renaissance) on Emperor / Standard map / Marathon speed / Low sea level / Abundant resources.
  • Fall patch enabled
  • Smoother difficulty mod enabled
  • AI+ NOT enabled
In all 3 games, by the time I'd hit renaissance, I knew I'd "won" whatever victory condition I fancied (except religion - cba)

Here are my findings in all 3 games
  • AI builds lots of cities and builds lots of units
  • AI quite aggressive at attacking City States / each other
  • AI sometimes upgrades units
  • AI sometimes declares surprise war and attacks me with handful of units. I defend and they sue for peace after 10 turns with a lucrative deal. After building up my military, I counter attack AI . At times the AI should wipe my units out. What happens? Timid AI retreats most units and let's me pick off some stragglers. 2 turns later, they dance their units back, I think "aghhh", and again they retreat letting me pick a few off. Eventually I wipe out all their units, then proceed to take their (undefended) cities.
Now I know I am playing on marathon and that production times are slow. But when AI military is a LOT stronger than mine, I wish AI wasn't so chicken and just danced units around the battlefield. I've noticed the same issues with Birth of the federation, AOW3 and a host of other 4X games I've played over the years. The AI has a shed tonne of units and they split them up allowing us to take them out. The only game which had "intelligent" AI was Sins of a Solar Empire; AI amassed it's forces in a "safe" place then attacked en masse - that game was fun.

Do you know?
  1. Are there any settings to make the AI more aggressive when attacking my cities and defending their own?
  2. Do we know if AI changes cities' production to military when at war or does it carry on building wonders, theater and entertainment districts?
 
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.

It shouldn't be your mod that's doing this, I saw this as well in a game I just finished where the only AI mod I'm using is Quo's Fewer AI Tantrums. This is a game that I started before the official patch, then it got patched half way through so I don't know if it was there before or if it was because of the patch. But either way, small pangaea map on immortal difficulty, a spy in Brazil's capital showed 7 or 8 settlers just lazing around. Brazil had been aggressively expanding but the only places left were distant barbarian infested tundra.
 
Back
Top Bottom