if (!isNative() && !isHuman() && GC.getGameINLINE().getGameTurn() > 100 && getNumUnits() < 5 && AI_getNumAIUnits(UNITAI_SETTLER) == 0 && GC.getDefineINT("KI_RESPAWN_OFF") == 1)
Hm, you might be right.
With this logic a Colonial AI will always be respawned (by generating new "Staring Units) if it still has a Settler sitting in Europe.
(Which is in fact a problem for "eliminating another Colonial AI" if it does not transport it to the New World because the queue in Europe got too long and it has too few ship
Also, when I think about it the check
for the UNITAI_SETTLER
should be completely removed
Because if AI has less then 5 Units after turn 100
it is chanceless anyways
and should be removed from the game
- even if it still has a Unit as "Settler" (in Europe or New World does not matter).
Also, the main problem
is if AI does not have the Ship Capacity
for transportation anymore to catch up with the other Players. Thus a check for "Transport Ships" still being available should be included as well.
Otherwise a Colonial AI with long queue in Europe
will also never be eliminated
if a player desimates its ships. (The check will allow to eliminate a Colonial AI by destroying its ships.)
So I think the piece of code we are talking about should be changed to this
(Removing the "Settler Check" and instead including a "Transport Ship Check" with an OR
Generally this will result in the 2 cases that can remove a Colonial AI from the game:
if (!isNative() && !isHuman() && GC.getGameINLINE().getGameTurn() > 100 && GC.getDefineINT("KI_RESPAWN_OFF") == 1 && (getNumUnits() < 5 || AI_getNumAIUnits(UNITAI_TRANSPORT_SEA) == 0))
bKill = true; // signals logic that player is dead
bRespawnDeactivated = true; // deactivates respawning
(Of course only after turn 100
and only for KI_RESPAWN_OFF - which is default setting though.)
- Colonial AI lost all Cities and has less than 5 Units total
- Colonial AI lost all Cities and has no more Transport Ships (that can cross the Ocean) <--- New (to prevent AIs being kept alive simply because they can not properly transport Units from Europe to New World anymore)
After turn 100 for a Colonial AI that lost all its Cities it would not matter anymore if that Colonail AI still has a "Settler".
(It is chanceless anyways, if it has either less than 5 Units or no Ships. Thus it would simply be removed from the game.)
Before turn 100, it will always respawn its Starting Units - which have a Settler - if it lost all its Cities and Settlers.
(The current normal behaviour.)
Still need to think about this potential change a bit because it is still early here in Germany and I just had my first coffee.
(I usually try to think through such changes a bit before I implement them.)
BTW If someone could help me set up the compilation environment, ...
Could one of you guys give @jooe
a helping hand with setting up his IDE?