Skip to content

Commit

Permalink
Merge pull request #436 from ByBurton/master
Browse files Browse the repository at this point in the history
MERGE new ai parameters
  • Loading branch information
Sh0wdown authored Aug 4, 2019
2 parents 287b89d + 890a833 commit 7670fc0
Show file tree
Hide file tree
Showing 5 changed files with 3,385 additions and 3,387 deletions.
2 changes: 2 additions & 0 deletions IDAParser/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ static void Main(string[] args)

string ucpPath = Directory.GetCurrentDirectory() + "../../../../UnofficialCrusaderPatch/AICs";
UpdateAICs(Path.GetFullPath(ucpPath));
if(Directory.Exists(Path.GetFullPath(ucpPath) + "/KimberlyAICs"))
UpdateAICs(Path.GetFullPath(ucpPath) + "/KimberlyAICs");
}
catch (Exception e)
{
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Special thanks go to:
[Evrey](https://github.com/Evrey) for his AI castles
[Tatha](https://www.youtube.com/channel/UC4BrhBzHp1ymnczlkdKcSkg) for his AI castles
[PitchNeeded](https://github.com/PitchNeeded) for his AI castle edits
[ByBurton](https://github.com/ByBurton/AI_Character_Editor) for the AICE and help with identifying the AIC parameters
[ByBurton](https://github.com/ByBurton/AI_Character_Editor) AKA Kimberly for help with identifying the AIC parameters

 
 
Expand Down
90 changes: 61 additions & 29 deletions UnofficialCrusaderPatch/AICharacters/AIPersonality.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,14 @@ public int GetByIndex(int index)
public int HighestPopularity;

// Index: 9 Hex: 0x24
public int Unknown009;
[RWNames("Unknown009", "TaxMin")]
[RWComment("Ranging from 0 (being +7 gifts) to 11 (being -24 taxes)")]
public int TaxesMin;

// Index: 10 Hex: 0x28
public int Unknown010;
[RWNames("Unknown010", "TaxMax")]
[RWComment("Ranging from 0 (being +7 gifts) to 11 (being -24 taxes)")]
public int TaxesMax;

// Index: 11 Hex: 0x2C
public int Unknown011;
Expand Down Expand Up @@ -115,19 +119,24 @@ public int GetByIndex(int index)
public int PopulationPerPitchrig;

// Index: 25 Hex: 0x64
[RWComment("Setting this to zero will not disable building! Set PopulationPerQuarry to zero instead!")]
public int MaxQuarries;

// Index: 26 Hex: 0x68
[RWComment("Setting this to zero will not disable building! Set PopulationPerIronmine to zero instead!")]
public int MaxIronmines;

// Index: 27 Hex: 0x6C
[RWComment("Setting this to zero will not disable building! Set PopulationPerWoodcutter to zero instead!")]
public int MaxWoodcutters;

// Index: 28 Hex: 0x70
[RWComment("Setting this to zero will not disable building! Set PopulationPerPitchrig to zero instead!")]
public int MaxPitchrigs;

// Index: 29 Hex: 0x74
[RWComment("The maximum amount of farms the AI builds. HopFarms are excluded from this! (Also check PopulationPerFarm)")]
//[RWComment("The maximum amount of farms the AI builds. HopFarms are excluded from this! (Also check PopulationPerFarm)")]
[RWComment("Setting this to zero will not disable building! Set PopulationPerFarm to zero instead!")]
public int MaxFarms;

// Index: 30 Hex: 0x78
Expand All @@ -139,23 +148,26 @@ public int GetByIndex(int index)
public int ResourceRebuildDelay;

// Index: 32 Hex: 0x80
[RWComment("includes flour?")]
[RWComment("Includes wheat. Applies to each kind of food.")]
public int MaxFood;

// Index: 33 Hex: 0x84
[RWComment("Reserves that are only consumed if current popularity < LowestPopularity. If the AI has less than this amount it will prioritize buying the missing food.")]
public int MinimumApples;

// Index: 34 Hex: 0x88
[RWComment("Reserves that are only consumed if current popularity < LowestPopularity. If the AI has less than this amount it will prioritize buying the missing food.")]
public int MinimumCheese;

// Index: 35 Hex: 0x8C
[RWComment("Reserves that are only consumed if current popularity < LowestPopularity. If the AI has less than this amount it will prioritize buying the missing food.")]
public int MinimumBread;

// Index: 36 Hex: 0x90
public int MinimumWheat;

// Index: 37 Hex: 0x94
[RWComment("unclear")]
[RWComment("Unclear")]
public int MinimumHop;

// Index: 38 Hex: 0x98
Expand All @@ -168,10 +180,14 @@ public int GetByIndex(int index)
public int Unknown040;

// Index: 41 Hex: 0xA4
public int Unknown041;
[RWNames("Unknown041")]
[RWComment("If the AI would have less than this amount of a good after sending them it won't send them to the requesting player.")] //Includes ResourceVariance?
public int MinimumGoodsRequiredAfterTrade;

// Index: 42 Hex: 0xA8
public int Unknown042;
[RWNames("Unknown042")]
[RWComment("Above this value of food the AI will give double rations out.")]
public int DoubleRationsFoodThreshold;

// Index: 43 Hex: 0xAC
public int MaxWood;
Expand All @@ -183,6 +199,7 @@ public int GetByIndex(int index)
public int MaxResourceOther;

// Index: 46 Hex: 0xB8
[RWComment("Applies to each type of weapon or armour.")]
public int MaxEquipment;

// Index: 47 Hex: 0xBC
Expand Down Expand Up @@ -252,10 +269,13 @@ public int GetByIndex(int index)
public Resource SellResource15;

// Index: 68 Hex: 0x110
public int Unknown068;
[RWNames("Unknown068")]
[RWComment("The amount of time for castle patrols set up in the AIV to move from one rally point to the next. (Remark: Only spearmen, horse archers and macemen currently do)")]
public int DefWallPatrolRallyTime;

// Index: 69 Hex: 0x114
public int Unknown069;
[RWNames("Unknown069")]
public int DefWallPatrolGroups;

// Index: 70 Hex: 0x118
[RWComment("This one makes no sense. In code: [if (Gold + Threshold > 30) then RecruitEngineer()], maybe it was supposed to be minus...")]
Expand All @@ -274,7 +294,7 @@ public int GetByIndex(int index)
public int Unknown073;

// Index: 74 Hex: 0x128
[RWComment("The probability with which this AI reinforces missing defense troops.")]
[RWComment("The probability with which this AI reinforces missing defense troops. Note: These are ignored at the beginning of the game, as there are only sortie and defensive units being recruited.")]
public int RecruitProbDefDefault;

// Index: 75 Hex: 0x12C
Expand Down Expand Up @@ -302,17 +322,21 @@ public int GetByIndex(int index)
public int RecruitProbAttackStrong;

// Index: 83 Hex: 0x14C
public int SortieUnitRangedMax;
[RWComment("These units are only sent out if more than this amout of them has already been recruited.")]
[RWNames("SortieUnitRangedMax", "Unknown083")]
public int SortieUnitRangedMin;

// Index: 84 Hex: 0x150
[RWComment("Type of ranged units that go to the last attacked farm or building, and guard it until another is attacked.")]
[RWComment("Type of ranged units that go to the last attacked farm or building, and guard it until another is attacked. Setting it to None may cause buggy recruitment behavior.")]
public Unit SortieUnitRanged;

// Index: 85 Hex: 0x154
public int SortieUnitMeleeMax;
[RWNames("SortieUnitMeleeMax", "Unknown085")]
[RWComment("These units are only sent out if more than this amout of them has already been recruited.")]
public int SortieUnitMeleeMin;

// Index: 86 Hex: 0x158
[RWComment("Type of melee units to attack enemy units shooting at the AI's buildings or workers.")]
[RWComment("Type of melee units to attack enemy units shooting at the AI's buildings or workers. Setting it to None may cause buggy recruitment behavior.")]
public Unit SortieUnitMelee;

// Index: 87 Hex: 0x15C
Expand Down Expand Up @@ -350,10 +374,10 @@ public int GetByIndex(int index)
public bool OuterPatrolGroupsMove;

// Index: 95 Hex: 0x17C
//[RWNames("Unknown095")]
[RWNames("Unknown095")]
//[RWComment("The amount of patrol units the AI saves up before sending them out to do their duty.")]
//NOT SURE HERE YET, NEEDS TESTING!
public int Unknown095;
[RWComment("The delay after which the AI sends out patrols to defend the outer economy. 4 is approximately one month, 24 being half a year.")]
public int OuterPatrolRallyDelay;

// Index: 96 Hex: 0x180
public int DefWalls;
Expand Down Expand Up @@ -463,9 +487,9 @@ public int GetByIndex(int index)
public int AttForceRandom;

// Index: 127 Hex: 0x1FC
[RWNames("Unknown127")]
[RWComment("The distance variance an AI will add to the default rally distance for sieges.")]
public int AttForceRallyDistanceRandom;
[RWNames("Unknown127", "AttForceRallyDistanceRandom")]
[RWComment("If the AI has more than this amount of units in the attack force, it will help their allies or siege an enemy if commanded to do so.")]
public int AttForceSupportAllyThreshold;

// Index: 128 Hex: 0x200
[RWComment("The %-amount of units of the attack force that the AI will rally before attacking. (0 - 100)")]
Expand All @@ -476,14 +500,16 @@ public int GetByIndex(int index)
public int Unknown129;

// Index: 130 Hex: 0x208
[RWComment("The %-amount of (siege engines? engineers? laddermen? tunnelers? siege def?) that need to be destroyed / killed before the main units attack.")]
[RWNames("Unknown130")]
public int AttForceCasualtiesPercentageBeforeAssault;
//[RWComment("The %-amount of (siege engines? engineers? laddermen? tunnelers? siege def?) that need to be destroyed / killed before the main units attack.")]
[RWNames("Unknown130", "AttForceCasualtiesPercentageBeforeAssault")]
//public int AttForceCasualtiesPercentageBeforeAssault;
public int Unknown130;

// Index: 131 Hex: 0x20C
[RWComment("The %-amount of units of the attack force that will rally (at the bested enemy's keep location) before retreating or attacking again.")]
[RWNames("Unknown131")]
public int AttForceSuccessRallyPercentage;
//Maybe a delay instead of a percentage
//[RWComment("The %-amount of units of the attack force that will rally (at the bested enemy's keep location) before retreating.")]
[RWNames("Unknown131", "AttForceSuccessRallyPercentage")]
public int Unknown131;

// Index: 132 Hex: 0x210
public int Unknown132;
Expand Down Expand Up @@ -513,7 +539,10 @@ public int GetByIndex(int index)
public SiegeEngine SiegeEngine8;

// Index: 141 Hex: 0x234
public int Unknown141;
//Maybe the amount of stones thrown by all catapults until a cow is thrown instead
[RWNames("Unknown141")]
[RWComment("The amount of stones needed to be thrown until the AI throws a diseased cow instead (catapults & trebuchets). Value 0 disables cows and -1 makes the AI not throw any bolders, only cows.")]
public int CowThrowInterval;

// Index: 142 Hex: 0x238
public int Unknown142;
Expand All @@ -522,16 +551,19 @@ public int GetByIndex(int index)
public int AttMaxEngineers;

// Index: 144 Hex: 0x240
[RWComment("This unit is only recruited if the target enemy has moat and used preferably to dig enemy moat.")]
[RWComment("This unit is only recruited if the target enemy has moat and used preferably to fill up enemy moat.")]
public DiggingUnit AttDiggingUnit;

// Index: 145 Hex: 0x244
public int AttDiggingUnitMax;

// Index: 146 Hex: 0x248
[RWNames("Unknown146")]
//Not without improved attack waves: [RWComment("These units split from the main attack force to destroy enemy buildings. If the enemy walls are nearby those may be attacked.")]
public Unit AttUnit2;

// Index: 147 Hex: 0x24C
[RWNames("Unknown147")]
public int AttUnit2Max;

// Index: 148 Hex: 0x250
Expand Down Expand Up @@ -589,7 +621,7 @@ public int GetByIndex(int index)
public int Unknown161;

// Index: 162 Hex: 0x288
[RWComment("AttUntiMain1 to AttUnitMain4 is a list of the main strike force the AI recruits for sieges. Priotizes in order of the list, but only recruits untis for which they have enough gold. So try to place expensive units higher up.")]
[RWComment("AttUntiMain1 to AttUnitMain4 is a list of the main strike force the AI recruits for sieges. Priotizes in order of the list, but only recruits units for which they have enough gold. So try to place expensive units higher up.")]
public Unit AttUnitMain1;

// Index: 163 Hex: 0x28C
Expand Down
Loading

0 comments on commit 7670fc0

Please sign in to comment.