Now that we all can change up values in the AIC files I thought it's a good opportunity to get more people into testing and finding out more of the yet unknown parameters. I created an excell file that showcases all unknown parameters, their values for each AI and the surrounding known parameters. The latter could help getting a clue what an unknown parameter could be about, e.g. the parameters 141 and 142 are located between the "list of engines used on any siege" and the "number of engineers send to sieges" so it's possible to be connected with siege engineering. (fixed formatting)
I also colored some fields that could be connected to each other, e.g. when many or all AI share the same value on something or only few AI show a difference from the rest. There are e.g. many parameters that look like being copy-pasted when creating the latter 8 AI that were added later to the game. Sheriff seems to be mostly excluded from that however.
Updated:
SHC_AIC_Unknown_Parameters.xlsx
@Truetobi91 You can write how to correctly find the variables. I am not good at it. But I want to help you.
P.S I think it's better to create a table here https://docs.google.com/spreadsheets. Because you can see to when something changed. And this table is more convenient.
Unknown153 instead seems to be the counterpart of Unknown156 (read below) as it tries to divide the group of AttUnitRangedPush into up to 3 sub-groups that attack one after another. If you only give an AI the entry of AttUnitRangedPush, there will still be at least one group of units left behind without attacking. This is not a backup group but just one AttUnitRangedPush sub-group that is not send out to attack properly.
Our current believe is that this function is bugged and doesn't work properly. The second (and further) sub-group does not attack which causes the attack to draw out for a very long time. The attack will then be canceled from time out instead. That's why the time it takes to cancel the attack is basically always roughly the same, with parameters of 4; 10; 20 or even 100 - it doesn't change anything.
Therefore our theory is that Unknown153 is some sort of group splitting or wave creating tool for the ranged push that was not finished working on time for release (as other features). One should be ok with setting this parameter to 0.
~@Sh0wdown Update on the matter.~
~I did some testing with my modded Rat and and wasn't satisfied by their usage of archers on attacks: despite having a mixture of 80 max ranged push and 20 max backup archers the rat desperately prioritized backup before ranged push.~
~In the AIC file I noticed the parameter Unknown153 right below the ranged push parameter so I tested different values there. My observations are pretty much side effects of what I tried to test, but I did notice some meaningful change in their behaviour.~
~I raised the value to 100 and noticed the following:~
~- the AI didn't return their Backline (consisting of siege engines/engineers and backup units) immediately after the Frontline was killed in the attack~
~- it took the AI roughly 75 seconds on a speed of 500 (!) to retreat their units~
~>###### the AI was of course not recruiting new attack troops in that time~
~>###### sortie units were recruited as normal~
~>###### the AI heavily hoarded gold in that time (side effect of paused recruitment)~
~TL;DR~
~The parameter Unknown153 is the delay between the point where the front line died entirely and the backline retreats to base. Proposed name:~
~### BackupRetreatDelay~
@Sh0wdown Parameter Unknown156 Update!
After doing tons of tests I'm finally confident to say that I identified what the parameter does. All tests were done with my modded Rat so confirmation for other AI is required.
156 manages the assignment of shields to the group of AttUnitBackup(Max) and can have the values {0, 1, 2, 3}. The group will split into [number] smaller groups and one shield will be assigned to each of these sub-groups. This of course requires the AI to build the required amount of shields (and engineers) in the first place.
With increasing numbers one won't really notice the sub-groups.
Setting the value of 156 over [3] causes the AI to not stock their backup group properly. AttUnitBackup will then ever only consist of 3 groups of UP TO 3 units each and one shield per sub group. Setting the value even higher (testing done with {10, 20, 100}) caused the AI to only fill the backup group with 3x1 unit accompanied by 1 shield each. Proposed name:
Unknown115 to Unknown122 represents a list of up to 8 different harassing siege engines (type).
Unknown123 is a (max?) count. And Unknown124 is kinda related to Unknown123 I think.
Edit: Problem is, that the IDs here for catapults and fire ballistae (190 and 358 respectively) do not match those we have defined for siege engines.
Unknown127 to Unknown132 probably relates to the army composition. But idk here.
It was not updated in the wiki yet but in the AIC file Sh0wdown already identified "123" as max number of raid catapults (or raid engines alltogether) called RaidCatapultsMax
Using the UCP version 2.12 and exporting the vanilla AIC file from the AIC tab creates an AIC file that contains the line "RaidCatapultsMax" where Unknown123 would otherwise be.
Did some testing with Unknown115, Unknown116, Unknown117 and Unknown118. I agree that they're "HarassEngineType" fields. 190 in the field = Catapults, while 358 = Fire ballista. I also think that Unknown123 is "HarassEngineMax", it limits both raiding catapults and ballista.
EDIT: For clarification, Unknown123 seems to be an absolute engine max of all raiding siege engines. Setting to say, 5, doesn't mean the AI will build 5 catapults _and_ 5 ballista for raids, just 5 engines total.
Unknown153 represents a variable, which links to a function which does not seem to be fully implemented into the game.
It makes the RangedPushUnits split into groups (the amount is the number you specify, and best used with values up to 5). That sounds good, but problem is, only the first group will actually attack, the others will stand behind and never move until they are killed or the siege is over.
Unknown156 works nearly the same, but better and seems to work as intended.
The number specified here (max should be 8) represents the number of groups the RangedBackupUnits are split into. If there are shields in the army, the AI will try to send one shield to each group.
This is actually awesome.
Suggested names:
Unknown153: RangedPushGroups (Count)
Unknown156: RangedBackupGroups (Count)
UNTESTED:
Unknown072 probably is the threshold, above which the AI will build harassing siege engines.
Unknown073 is the delay between those (in AI routines probably).
Suggested names;
Unknown072: HarassingSiegeEngineThreshold
Unknown073: HarassingSiegeEngineDelay
@Sh0wdown Harassing or Raid? I would vote for Harassing, but I have seen you already named the Max count "Raid" something. Can you change that to harassing?
UNTESTED:
Unknown049 might be the threshold above which the AI builds workshops.
Suggested name:
WorkshopThreshold or WorkshopGoldThreshold (last one would not meet our naming conventions)
Edit: One of my testers said, that it might have to do with a general delay for trading?
Edit2: Nope. Has nothing to do with trading directly at least. It is a threshold. An AI won't recruit units for a siege force until it is above that (gold) threshold. Raiding units will still be recruited. Don't know for certain about defensive units. Sortie will be build.
Tested with Saladin, Sultan, Rat, Snake, Wolf.
Suggested name: AttRecruitThreshold
I tested the variables Unknown093, Unknown094 and Unknown095 on the Ai Saladin.
Unknown093 is very much the amount of patrols(2 with Saladin) defending the outer economy buildings.(sortie units doesnt count).So a higher Unknown093 means more groups(but less big) wandering around. the Patrol-Army consists of the DefUnit Array.
The Saladin defUnit is the following
DefUnit1 = ArabSwordsman
DefUnit2 = ArabArcher
DefUnit3 = ArabArcher
DefUnit4 = ArabArcher
DefUnit5 = FireThrower
Saladin has 2 Patrols. Each patrol contains every DefUnit.
But something weird happens, when i give him 5 patrols. Instead of having mixed patrols he will get 3 patrols full of arabian Archer, one Army of Swordsman and one with only Fire throwers. This means the DefUnit and patrols are getting iterated together.
It would be:
DefUnit1 = ArabSwordsman-> 1. (patrol1)
DefUnit2 = ArabArcher-> 2. (patrol2)
DefUnit3 = ArabArcher-> 3. (patrol3)
DefUnit4 = ArabArcher->4. (patrol4)
DefUnit5 = FireThrower-> 5. (patrol5)
--repeat--
Unknown094, when i set this variable to 0 then the AI will start sultan-dumping the patrols outside the base. ~This might be a trigger to move the patrols around. a low amount causes the patrols to change position faster.(more testing needed)~
Unknown095 Basically the amount of patrol-troops which Saladin saves up in the base, before releasing them to defend outside.
Example: Having 4 patrols and unknown095 set to 60: Saladin will release 4x 15~ patroltroops after some time
Note: The Patrol size is dependent to DefTotal and DefWalls and amount of patrols.
DefTotal-DefWalls=DefPatrol. DefPatrol/amountOfPatrols= trueSizeofOnePatrol.
I think Sortie doesn麓t count into this equation
@berkay1000
will definately test those later today, good job!
I've played around with the siege variables and found some interesting stuff and this is how I would describe them in short;
AttUnit2: Type of unit that is deployed when besieging. Units move forward in waves; rally point = in front of siege engines.
The rally point is the important bit here, these units push forward like the AttUnitRangedPush units, they do however stand infront of the walls to rally and then attack the walls in waves. Both ranged and melee units work here, the ranged ones will melee attack the walls (although thats more or less fine since they mostly do so after all enemy units have been killed). Ranged ones do however work better than melee ones since they can actually fire back so I'd name this variable AttUnitRangedPush while renaming the current Push one to AttUnitRangedPatrol since they patrol in front of the keep instead of actually pushing into the keep.
AttUnit5: Type of unit that is deployed when besieging. Units move towards enemy units outside the keep.
These ones are.. interesting. They rally next to backup troops but do not attack enemy walls. They immediatly move towards enemy units outside the keep and engage those, how far these units are away doesn't seem to matter though. The only AI that uses these units is the wazir with 10 fire throwers and I can see why - it doesn't seem that useful. In my testings these units prefer groups of units even if they are literally at the other end of the map instead of a single fire ballistae next to the walls so I'm not sure one would properly use them. Both melee and ranged units work here. Not sure about the name of this one, maybe AttUnitEngange?
AttUnitSiegeDef: Type of unit that is deployed when besieging. Units move forward in waves, rally point = far behind siege engines.
I've tested these units alot and they aren't really defending the siege engines. At least not that I can see, they immediatly swarm the walls and ignore units that are destroying the engines behind them. They rally behind the backup units and send waves to attack the walls. I've tested both ranged and melee units and both work the same. Renaming these would be appropriate but I dunno about a more fitting name, AttUnitBackupPush?
I'm currently playing around with Unknown127 - 132, will post results in a bit! And good job to the others, love reading the results you guys have found!
@berkay1000 @Zer0oZ have you tested that with multiple AI lords? If not please try at least 4 different ones.
Edit: Please test with those AI lords: Rat, Sultan, Saladin, Wolf
Edit: About AttUnitSiegeDef: They are. Look at the Wolf for example. He has these 3 or 4 swordsmen patrolling between his siege engines (even goes to harassing ones if the others have been destroyed)
@berkay1000 I think Unknown094 is a bool. Can that be? I only see the AI in vanilla having values of 0 or 1s. And probably everything that is not 0 will be true.
Only The Rat and The Sultan have the 0 value, and they are the only ones that dump their units to their quarries and not move around with them. All others have a 1 there and move their units.
https://github.com/ByBurton/UnofficialCrusaderPatch
I updated the aic variables there already. You can check them out.
@ByBurton Maybe. It accepts non-binary numbers. And i think i saw a difference in the patrols, how often they changed their places/how long they remain in one place. But I definitely have to verify that. When i am home i will test again and count the ingame-months and look for outside influences(Maybe raids/nearby enemy troops are activating the patrols to move around more often).
And i will test all variables again with different AIs besides Saladin.
For Unknown095 maybe you could name it
OuterPatrolUnitBuildUp: The Amount of Units the AI recruits before assigning them to each patrol
@berkay1000 I really doubt that it influenced the delay before they move to the next spot. They always wait until all their units are around the place they have been sent and then move on to the next point.
About Unknown095, what happens if the AI does nto have that many patrols as units to wait for?
Unknown164 & Unknown165 might be AttMainUnit3 & AttMainUnit4 respectively.
I am pretty certain about Unknown164.
My testers tested it, and that is indeed the case.
Prioritizes recruiting units higher up. If not enough gold is available, the lower ones will be recruited.
@ByBurton I saw Observations about Unknown094 which refutes my point. You were right.
I dont understand your question. Do you mean unknown095 being higher than OuterPatrolGroupsCount? Nothing special happens. I see one-man-patrols for some months before they get bigger
extra notes: Filling the towers with units has priority over filling up the patrols
AttUnit2: Type of unit that is deployed when besieging. Units move forward in waves; rally point = in front of siege engines.
The rally point is the important bit here, these units push forward like the AttUnitRangedPush units, they do however stand infront of the walls to rally and then attack the walls in waves. Both ranged and melee units work here, the ranged ones will melee attack the walls (although thats more or less fine since they mostly do so after all enemy units have been killed). Ranged ones do however work better than melee ones since they can actually fire back so I'd name this variable AttUnitRangedPush while renaming the current Push one to AttUnitRangedPatrol since they patrol in front of the keep instead of actually pushing into the keep.I did some testing with Frederick, Rat, Lionheart and Pig using melee units in this field. I've noticed that melee units in AttUnit2 are also sent to attack industry buildings. You can effectively turn attack forces into massive raiding parties by using AttUnit2 extensively, it's pretty neat actually. When sent to attack buildings, they'll eventually go for the castle walls when no other buildings can be targeted. AttUnit2 definitely is an aggressive attack force parameter, whereas AttUnit5 is more defensive it seems.
I did some testing with Frederick, Rat, Lionheart and Pig using melee units in this field. I've noticed that melee units in AttUnit2 are also sent to attack industry buildings. You can effectively turn attack forces into massive raiding parties by using AttUnit2 extensively, it's pretty neat actually. When sent to attack buildings, they'll eventually go for the castle walls when no other buildings can be targeted. AttUnit2 definitely is an aggressive attack force parameter, whereas AttUnit5 is more defensive it seems.
I've noticed the same but I'm pretty sure they just share the targeting algorithm with the main part of the army. I haven't tested it with that many AIs (mainly rat and snake) but I'd say ~2 out of 10 units go after buildings even when having like 20 wood cutters right outside the walls so I'm not sure if they're solely a raiding type of unit - especially since they rally infront of the walls + they, along with RangedPatrol, are the first ones to receive fire from the defenders so they more or less die on "impact" lol.
AttUnit5 also attacks buildings though and act like raiding units in my tests.
A question :
There is a Parameter : AttMaxAssassins , those assasins will climb the walls and eventually go for the gatehouse to open them for your own units
But if you send assasins in your AttUnitMain they will only attack the wall.
My Question is now:
If you use laddermen for an ai, not all units will climb those ladders, but sometimes you see some units climbing them, maybe because those units are not asigned to AttUnitMain, but rather in AttUnit2 or AttUnit5, do you think those parameters might have other functions aswell as only go for industry buildings?
Good questions! Why don't you go ahead and try it out yourself? ;)
Wanted to give some of my own insight on the parameters AttUnit2 and AttUnit5:
I did testing with Wolf and removed Pikeman from his main army (for clarity); added them as AttUnit2 and added ArabSwordsman as AttUnit5. I later switched them around.
In these tests none of both units really targeted economy buildings outside the walls but they liked to attack both workers and enemy troops nearby.
AttUnit2 were set aggressive, following the units they were targeting for long distances. AttUnit5 however were set "defensive" and did often return to their last rally point when their target moved too far away or was slain before reaching them.
AttUnit5 also moved in weird angles, going back and forth sometimes before finally taking action.
Both groups rarely joined their main army's attack on the castle.
I also did tests with Rat who got to have Macemen as AttUnit2 and AttUnit5.
Both groups barely acted differently. They were also attacking economy buildings most of the time before joining their main army's attack on the castle.
So after some testing i think, Unknown 167 is the number of groups the Ai splits their Main attack units, befor they start to attack
Unknown 128 seems to be the Percentage (or time) of troops gathered befor the siege begins, the higher the longer they wait, 100 seems to be the max, if set any higher the Ai just waits and doesen`t attack.
Unknown 130: seems to be the delay of the Main attacking Units befor they attack the Walls.
Not sure about 127, but I think it is the gathering distance of the troops (befor they siege) and the enemy castle.
Dont know the variables of, 131 and 132 yet.
Edit:
Unknown 129: seems to be the time the ai waits till it retreats its back up units, the lower the faster.(0 = instant retreat)
I can confirm Unknown128 is definitely some sort of timer for army gathering. 20 or below is usually an instant attack once the fastest unit makes it to the staging area. 80 and above the AI waits until all units are gathered before attacking. I'd suggest the name "AttForceGatherTime"?
I did testing with Unknown167 as well and I also believe it is the number of groups AttUnitMain1&2 split into. I did testing with AIs like Lionheart and Abbot (aka AIs that attack in huge numbers) and I believe 4 is the maximum amount of groups. Could be my end but I can't get an AI to use groups larger than 4. Seems to be the same as the patrol group count. Maybe the name "AttMainGroupCount"?
I can confirm those two as well. Unknown167 splits all AttUnitMain1 to AttUnitMain4 into groups, max. 4.
Unknown128 seems to be percentage based.
Unknown129 does not have any effect for me, the same with Unknown127.
Unknown130 does not seem to work for me I think.
Could you guys do some more testing please?
I am pretty sure that unknown 129 is the delay of the Backupranged units, in which they retreat after the complete (the swarming units to)main siege got killed.
But it sometimes fails, if tunnelers or ladderman are with them and dont do anything
UNTESTED:
Unknown049 might be the threshold above which the AI builds workshops.Suggested name:
WorkshopThreshold or WorkshopGoldThreshold (last one would not meet our naming conventions)Edit: One of my testers said, that it might have to do with a general delay for trading?
Edit2: Nope. Has nothing to do with trading directly at least. It is a threshold. An AI won't recruit units for a siege force until it is above that (gold) threshold. Raiding units will still be recruited. Don't know for certain about defensive units. Sortie will be build.
Tested with Saladin, Sultan, Rat, Snake, Wolf.
Suggested name: AttRecruitThreshold
I tested this and defensive troops are definitely not recruited below that threshold. I can confirm the rest.
So the name "AttRecruitThreshold" doesn't fit here.
I tried to establish some kind of strategic money reserve for the AI for defense purposes, but that doesn't work when defensive troops are not recruited below. Any other ideas to do that?
@FurorGermanicus are sortie troops recruited below that threshold value?
Yes they are @heroesflorian
Edit: those are always recruited
Does anyone have any thoughts on Unknown124? I'm trying to figure out if it has anything to do with harassment siege engines since it comes after the "harassment siege engine count" field. My only theory is that perhaps its a time delay between when a destroyed harassment engine is rebuilt? However, I'm noticing little to nothing when changing the field from 0-8.
Any ideas about Unknown124, Unknown164 and Unknown165?
@Rakso69 Unknown164 & Unknown165 have been identified already.
what about build variables like the build range for each player? is this already known?
Question, are these parameters originally found in this order? Or is this order from Sh0Wdown?
If they aren't in order could Unknown002 -> Unknown005 be related to Meat, It's odd that there is nothing in any of the lines of the AIC that relate to Meat.
Also the only way I have gotten units to climb ladders is if they are the Attackunit Engage. If they choose to chase a enemy on the wall they will climb the ladder to get to them. Otherwise nothing else I have tried gets units to climb the ladders yet.
And no having stairs on the wall so attacking units can "see" the enemy lord doesn't make a difference in what I've tried.
Unknown161 is weird in that only Richard has a value of 2, everyone else is either 0 or 1.
Hello @Xebenkeck, if you wanna help with finding out variables feel free to join my discord: https://discord.gg/T7HkeP
As about meat: There will be no variables for meat. The AI does not know about meat. Simple as that.
Edit: We've already figured out a lot more variables than the ones you see on this repository here.
Unknown161 is the amount of groups the siege def units split into.
@ByBurton Sure love to only that link is broken for me. Says the invite may be expired.
Here, use this one. Set to expire tomorrow, so you've got some time: https://discord.gg/U9UCYc
seems like discussion has been taken somewhere else, and these values be resolved?
If not, and discussion has to go on in here, reopen... else just search in closed for reference!
Most helpful comment
I tested the variables Unknown093, Unknown094 and Unknown095 on the Ai Saladin.
Unknown093 is very much the amount of patrols(2 with Saladin) defending the outer economy buildings.(sortie units doesnt count).So a higher Unknown093 means more groups(but less big) wandering around. the Patrol-Army consists of the DefUnit Array.
The Saladin defUnit is the following
DefUnit1 = ArabSwordsman
DefUnit2 = ArabArcher
DefUnit3 = ArabArcher
DefUnit4 = ArabArcher
DefUnit5 = FireThrower
Saladin has 2 Patrols. Each patrol contains every DefUnit.
But something weird happens, when i give him 5 patrols. Instead of having mixed patrols he will get 3 patrols full of arabian Archer, one Army of Swordsman and one with only Fire throwers. This means the DefUnit and patrols are getting iterated together.
It would be:
DefUnit1 = ArabSwordsman-> 1. (patrol1)
DefUnit2 = ArabArcher-> 2. (patrol2)
DefUnit3 = ArabArcher-> 3. (patrol3)
DefUnit4 = ArabArcher->4. (patrol4)
DefUnit5 = FireThrower-> 5. (patrol5)
--repeat--
Unknown094, when i set this variable to 0 then the AI will start sultan-dumping the patrols outside the base. ~This might be a trigger to move the patrols around. a low amount causes the patrols to change position faster.(more testing needed)~
Unknown095 Basically the amount of patrol-troops which Saladin saves up in the base, before releasing them to defend outside.
Example: Having 4 patrols and unknown095 set to 60: Saladin will release 4x 15~ patroltroops after some time
Note: The Patrol size is dependent to DefTotal and DefWalls and amount of patrols.
DefTotal-DefWalls=DefPatrol. DefPatrol/amountOfPatrols= trueSizeofOnePatrol.
I think Sortie doesn麓t count into this equation