Siesta Guru
Prince
And Siesta Guru, can you check your mod (AI+) to make sure the AI players are using Bombers, Jet Bombers, Fighters and Jet Fighters correctly (I see them building them but not using them for anything). Right now the default fall patch AI is using them (not that good but is using them).
Will test this, thanks for letting me know.
I am sorry to keep asking for help but where in the “BehaviorTrees.xml” and “Operations.xml” files or just wherever files would I go to fix the AI players units getting stuck around a city and late game wars not getting launched by the AI players? I have really looked and just do not know what I need to change.
So these fixes are already in AI+. But if you want to mimic them, you need to:
For the 'stuck around cities fix'
You can just rip the code in behaviortrees.xml out of AI+, but you'll get some other small changes along with it. So if you don't want that, here's a bit of an explanation that hopefully helps you figure out how the behaviortrees works
Find the <BehaviorTreeNodes> corresponding to : NodeType="Operation Move" for the relevant behaviortree. In particular, the one node thats relevant for city attacks is:
<Row NodeType="Operation Move" NodeId="39" TreeName="Siege City Assault" />
As its executed right before the bulk of the actual attacking logic
Then find the <TreeData> corresponding to the nodes you want to change. Which should be:
<Row DefnId="0" NodeId="39" TreeName="Siege City Assault" DefaultData="1" />
<Row DefnId="1" NodeId="39" TreeName="Siege City Assault" DefaultData="2" />
<Row DefnId="2" NodeId="39" TreeName="Siege City Assault" DefaultData="false" />
<Row DefnId="3" NodeId="39" TreeName="Siege City Assault" DefaultData="2" />
In the NodeDataDefinitions we can see what these mean:
<Row DataName="Move To (enum)" DefnId="0" DataType="int" NodeType="Operation Move" Required="False" UserData="True" />
<Row DataName="Range to goal" DefnId="1" DataType="int" NodeType="Operation Move" UserData="True" />
<Row DataName="Validate new units" DefnId="2" DataType="bool" NodeType="Operation Move" Required="False" UserData="True" />
<Row DataName="Unit distance" DefnId="3" DataType="int" NodeType="Operation Move" Required="False" UserData="True" />
<Row DataName="Leader Tag" DefnId="4" DataType="string" NodeType="Operation Move" Required="False" UserData="True" />
The node with id 3 (Unit Distance) is the one that determines the distance within which units need to be. As we can see it's currently set to 2. So all you need to do is change it to 3.
So turn
<Row DefnId="3" NodeId="39" TreeName="Siege City Assault" DefaultData="2" />
into
<Row DefnId="3" NodeId="39" TreeName="Siege City Assault" DefaultData="3" />
You can do this either by updating it, or by deleting it and creating a new one or by using sql. I like doing the latter on the entire tree in AI+ because it minimizes the risk that a civ patch causes everything to crash (if ids ends up changing, an update would override data of the wrong node). Its also pretty easy in case of behaviortrees. Just delete all nodedata and all behaviortreenodes inside some tree, then copy paste the original tree in while altering what you want.
For the 'operationtypes' fix, note that these operations:
<Row OperationName="City Defense" TargetType="TARGET_FRIENDLY_CITY" TargetParameter="1" BehaviorTree="Simple City Defense" Priority="4" MaxTargetDistInRegion="-1" MaxTargetDistInArea="-1" MaxTargetDistInWorld="0" />
<Row OperationName="Civilian Builder Capture" TargetType="TARGET_FRIENDLY_CITY" BehaviorTree="Escort Worker To Camp" Priority="1" MaxTargetDistInRegion="-1" MaxTargetDistInArea="-1" MaxTargetDistInWorld="0" />
Don't have an OperationType set, while all other (non-barb) operations do have something set there.
Strangely enough, the xml does provide two defined operationtypes which were supposedly intended for these two:
<Row OperationType="OP_ESCORT" Value="2" />
<Row OperationType="OP_DEFENSE" Value="4" />
So just set the operationtypes to these. You can do this through a delete + new create or an update or by using sql
In AI+ I'm using an update here. Basically just add these lines to your mod inside of an AiOperationDefs xml block:
<Update>
<Set OperationType="OP_ESCORT"></Set>
<Where OperationName="Civilian Builder Capture"></Where>
</Update>
<Update>
<Set OperationType="OP_DEFENSE"></Set>
<Where OperationName="City Defense"></Where>
</Update>