Jakcie A.I (Actual AI improvements)

I’m from the UK, and I know as much as you do.
Though I have had certain success in some areas the AI is progressively becoming how I wanted to have them function.

My current test seems to cause AI to show up with a scouting squad around 3 minute mark but this is with high resources. I’m testing default resource starts to see if they still to the same

I usually do resource mods and population mods, i also know how to edit unit stats, weapons etc.
I created the 300 pop and more ores mod (i had to delete it as the original file was corrupted) it was the 7th most popular mod. But i have 0 knwoledge on how to mod AI

I’ll send you my discord link.

My name on discord is Nacoid

Atm i can’t join on discord. How did you manage to set this AI behavior?

Attributes > AI:

AI Settings
AI Personality
AI Strategizer Personality

Those are the main locations I have been looking in to and have found progressive developments with tuning the AI.
It is limiting but still gets at the very least, something to happen.

I found something that could be useful, but I’m not able to modify it. Under ai\ai_statemodel_tunings, you can find skirmish_difficulty_easy, skirmish_difficulty_standard, and skirmish_difficulty_expert, where you can adjust settings like the delay between villager production times and the villager population. Could you help me figure out how to edit this?
Now that I’ve checked, what changes did you make to the three folders you mentioned?

That folder you have mentioned I cannot tweak I can only look inside. I would want to use it myself since there are things in there I want to change.

However in the other 3 I have been able to increase AI build ratios for defensive structures vs economic.
I can limit how many villagers they make in total so they do not pump out workers non stop.
I can define how the AI engage a battle by tweaking the strength of their behaviour in certain situations.
I can get the AI to use their abilities more often. You can also increase the resource catchup strength or change how much resource they gain entirely.
There is a handfull of things you can do but to me it has still been limited as what I specifically want them to build like walls for intsance, I cannot get them to do it as of now.

Hey @Nac024id, @Major.White.
I assume that the basic question that you two are asking is the limits of my control or the mod’s control over the ai.

What a tuning pack (my mod) can change about the ai is quite limited to specific things that the ai folder contains. It does not contain hard coded actions that the ai does.

An example can be in what it makes. If you want the ai to build more military, the economy file can be modified to make the ai prioritize military more by increasing its value. But its only because its corresponding lua_binding also tells it what is important in association. Just buffing its value does not really change what is important, it just makes it pronounced. If the ai thinks building military is only important because the other side has military, then increasing the value would do nothing if the other side also does not builds military. It is also a big note that I don’t know what any of the lua_bindings do/what is in them to make the ai calculate importance.

My point is that There is a specific barrier that prevents me from making the ai all that much better than it currently is.

I’ll also go over the various files you two mentioned and try to explain them.

AI settings is mostly full of leftover from other Relic games (I see company of hero related things lol) but it also contains ai cheats, fallback (maybe CoH , thus useless or actually used idk) and other minor things that don’t really improve the ai. You can try to edit and see if any of the CoH sounding values actually change something but I dont think its useful beyond what is already there.

statemodel_tunings is something else though. When I first made the mod, I was able to clone it but now its disabled for some reason, nonetheless it does change the ai quite a lot and honestly I won’t be surprised if I may have broken something while editing it myself. It dictates how the ai behaves when it is in its specific fighting objective related to its statemodel. For specifically the difficulty statemodels it seems to mostly give a base in terms of when to fallback, if the difficulty should micro, and the cap on villigers/delay in villigers. You can make your own statemodel still by copy pasting the first entry on a file, making a new statemodel file, pasting the information and renaming the new file to its old name. One thing that should be stated is the family structure of the statemodel tunings, which make it so that its kinds easy to set up for a tuning pack. The ai personality file connects to their statemodel tuning difficulty

AI Personality just enables the family hierarchy that connects the attacking from statemodel tunings and economy to that the mod functions

Strategizer Personality is related to its economy, putting a bonus depending on what buildings have their own associated value connected to the personality. Its not super important is not every building is affected by this number

If you would like more insight I can give it but I think the real question is if I can completely control if the ai can stop doing either all in age ups, or feudal all ins with no aging up, or even if they can just build walls again (I SWEAR A YEAR AGO THEY WERE ABLE TO DO THAT). The simple answer is no. I don’t know what is happening with the ai enough to tell them that what they are doing is dumb, and even if I did pronouncing specific parameters would not fix something that the ai already cannot do. all I can really do is try to guide them to at least build better stuff and fight better. There were times where I built really messed up fixes that would kinda fix the ai but would break the mod by the next update.

I guess the only hope is if the vanilla ai would build walls. I swear its random if they ever do it.

In better news, I finally got the ai to attack walls in my testing! Hope it works in actual games.

Hi Jackie, thank you for the explanation. Still, what values should i change on the AI economy to prioritize military units?. And also if you managed to find where to tell the AI to attack more often. I modified the strategizer applying an age up -1 and offense, combat +1, defense -1. And they are harassing a bit on feudal, but then just stop to attack and rush straight to imperial

what values should i change on the AI economy to prioritize military units?

In the ai/ai_economy/complete/default_economy.xml, searching up ScoringFunctions_infantry and ScoringFunctions_RangedInfantry will give 5 production group sections focused on how important units are, separated on broad types. Simply increase the number to have them want to make more units. Search up ScoringFunctions_MilitaryProductionBuilding to find the section focused on building production buildings

And also if you managed to find where to tell the AI to attack more often.

I have no 100% answer to this. It seems just making the ai build more troops leads to them just using them more.

I modified the strategizer applying an age up -1 and offense, combat +1, defense -1. And they are harassing a bit on feudal, but then just stop to attack and rush straight to imperial

I can go more in depth in the strategizer personality. In the economy file, there various sections whether it be default utility or production groups that get added weight based on what the personality has. For example, an ai with a full 1 on combat will have a big boost in wanting to make units. Of course putting a negative would slightly push them away from the associated utility but not 100% make them never do those things. You can see the weights if you search offense, age_up etc. and you can also put your own weights if you want.

Why does the ai still rush to imperial though? I ask that question every day. Why does the ai hard stuck in feudal? I think theres still an importance to sticking to aging up that is too strong for a mere personality weight to affect. Personally I think the weights are pretty weak compared to the economy file itself when the ai wants to calculate importance and its better to change the economy values upfront if you want to see big changes.

1 Like

Could you re-explain the method to clone files that cannot be cloned again?
Statemodel_tunings specifically as alot of the things I want done show up in there.
Same with Formation_coordinator I assume the same method would be used to just copy the file.

I cant make a new file, unless I need to do it in the actual folder outside of the Content Editor.

if you want I think you can just download my own mod from my github and just paste my files. Then you can edit them to whatever you want. GitHub - JakcieChan/Jakcieai

3 Likes

@JakcieChan1178 The new update 15.1.6970 includes new improvements to AI behavior :slight_smile:

AI Update

  • AI is now more effective in Full Moon game mode.

  • AI players will now take more conservative paths towards their enemies’ Wonders.

  • AI fishing boats will now attempt to flee or garrison when threatened.

  • AI villagers will not go idle anymore if two or more fishing boats go idle.

  • AI players will now trade more efficiently on naval maps.

  • Fixed a rare issue for AI units oscillating between attacking landmarks and buildings around them.

  • AI players will now progress more smoothly when spawned close to enemies.

Looking forward to the new DLC :slight_smile:
I’m really looking forward to the new version of the AI ​​mod, but for DLC :slight_smile:

1 Like

I hope this mod isn’t abandoned, cause the base AI of the game it’s pretty bad and the only mod that make it challenging and fun was this one, but as time pass I always see less updates from the mod and from the author..

1 Like

Unfortunately, you are right, and without this mod, the AI ​​poses almost no danger to the average player.

But still, vanilla AI has been greatly improved in recent times.

Hey guys. im not dead yet, and even better, I got a compatibility patch for the dlc ready. I’ll release it when it comes out but it overall just makes all the new civs able to be played.

Honestly, the AI has indeed improved a ton since this mod was made and the purposes of the mod (make sure the ai does not break in any means possible) get more and more fixed as the game gets updated, which is great but it gets hard to update the mod with good changes.

If there are still problems when I get to updating the mod, please tell them, I suspect that a few things are missing but playing a few games with the ai they can still play decently well.

idk if I should just push the changes before the dlc releases so I will try to get it out as soon as the dlc becomes public.

One thing I would like to add too is that this mod update flat out takes from the current ai for the new civs and pastes them to be compatible with the general directives for my ai (make more units, only have 2c, focus a bit more on age up etc.)

2 Likes

Thank you for your work!
I’m very glad to see you :slight_smile:

I have a couple of questions.
Are there many new hidden AI changes in files? I’ve noticed that the AI ​​is getting better with each patch.
Are there any particularly significant changes in the files?
How well does the AI ​​perform on the new Civilizations?

Thanks again.
I’m looking forward to the new version of the mod.