Immigrants are hurting the AI quite badly

Koshling

Vorlon
Joined
Apr 11, 2011
Messages
9,254
An AI stack I just spotted in my game leads me to believe that UNIT_IMMIGRANT is seriously hurting the AI once it gets access to them.

For some reason they have a default AI of UNITAI_CITY_SPECIAL (which is fine), BUT also list UNITAI_SETTLE as a supported AI. The net result is that the AI is building them to satisfy requests for UNITAI_SETTLE, and then treating them like settlers...with the fatal flaw that when they get to the place they want to found a city...they can't found cities!

I suspect this is preventing the AI creating any new cities once it gets access to immigrants. As far as I can see having UNITAI_SETTLE on them I not really serving any purpose - just removing this and leaving them with their default AI (UNITAI_CITY_SPECIAL) should resolve the issue.

@DH - is there some special reason they have UNITAI_SETTLE on them?
 
An AI stack I just spotted in my game leads me to believe that UNIT_IMMIGRANT is seriously hurting the AI once it gets access to them.

For some reason they have a default AI of UNITAI_CITY_SPECIAL (which is fine), BUT also list UNITAI_SETTLE as a supported AI. The net result is that the AI is building them to satisfy requests for UNITAI_SETTLE, and then treating them like settlers...with the fatal flaw that when they get to the place they want to found a city...they can't found cities!

I suspect this is preventing the AI creating any new cities once it gets access to immigrants. As far as I can see having UNITAI_SETTLE on them I not really serving any purpose - just removing this and leaving them with their default AI (UNITAI_CITY_SPECIAL) should resolve the issue.

@DH - is there some special reason they have UNITAI_SETTLE on them?

That is the setting in the original mod (by Orion Veteran) and the latest version also.

Would it not be better to get rid of the UnitAI and just leave the DefaultAI?

Edit There is some Python code associated with the mod one bit of which includes AI for when a non-player city builds an Immigrant. Now I have replaced some of the code with C2C xml values but I have not removed the code. Also it has code for automating the immigrant and sending them off to a new city but that is not firing for all players and needs danger avoidance code added. The AI code is basically the same as what I assume the automate code is for a missionary or corporate exec; ie find a suitable city, set the unit to go there and then carry out the mission (join city) when it gets there.

Edit2 The code deciding what unit to build has the probability at 33% for Expansive and 25% otherwise.

I will remove all the excess code as well. That way it should only be the mission that is assigned in python.
 
That is the setting in the original mod (by Orion Veteran) and the latest version also.

Would it not be better to get rid of the UnitAI and just leave the DefaultAI?

Edit There is some Python code associated with the mod one bit of which includes AI for when a non-player city builds an Immigrant. Now I have replaced some of the code with C2C xml values but I have not removed the code. Also it has code for automating the immigrant and sending them off to a new city but that is not firing for all players and needs danger avoidance code added. The AI code is basically the same as what I assume the automate code is for a missionary or corporate exec; ie find a suitable city, set the unit to go there and then carry out the mission (join city) when it gets there.

Edit2 The code deciding what unit to build has the probability at 33% for Expansive and 25% otherwise.

I will remove all the excess code as well. That way it should only be the mission that is assigned in python.

Ok, sounds good. Also take off UNITAI_SETTLE and just leave the default AI and everything should be fine I think.
 
Top Bottom