BobTheTerrible
Just Another Bob
Not sure what you meant by "Planet Generation"
There's a map script called Planet Generator, maybe that's it.
Not sure what you meant by "Planet Generation"
Hmmm ... very odd. The asserts from your first post will go away if you use the new 0.60 release (it's revision N), not sure what's causing the freeze in the second post. I'll see if I can reproduce them and figure out what's going on.
// * Damaged AI attack planes may choose to continue attacking if no defending interceptors are around
if (([B]currHitPoints() / maxHitPoints() * 100[/B]) < 40)
{
getGroup()->pushMission(MISSION_SKIP);
return;
}
if (([B]100 * currHitPoints() / maxHitPoints()[/B]) < 40)
jdog, I just want to make you aware there is still a bug in the governor (or room for A LOT of improvement) when sliders are maxed out. You'll remember the one I posted a while ago where I maxed out the culture slider and it picked very very suboptimal tiles...
Now I'm sending the esp splider to 100%, and it picks suboptimal tiles. I actually make more esp points in this city if I put it back to 90%, something which should not happen at all.
Last time the only difference was a coast tile and ocean tile. This time it's the difference between working a 1 cottage and 2 cottage vs. a 4 village and 3 hamlet.
Is there any chance you can fix the bug here?
I think last time DanF or you found what the problem was...
This bug really concerns me because it forces me to micromanage the slider, unless I want to micro manage every city.
Spoiler :
There's a map script called Planet Generator, maybe that's it.
I found what I think is a bug while going over the changes in the Unofficial Patch 0.21, and the comment claims the code is from BetterAI, so here goes. My apologies if this has been fixed in the latest BAI version (it's very late and I don't want to forget to post this after getting a chance to verify it).
CvTeamAI::attackAirMove() has a check designed to make bombers with less than 40% health heal instead of attack, but it looks incorrect. Here's the code:
Code:// * Damaged AI attack planes may choose to continue attacking if no defending interceptors are around if (([B]currHitPoints() / maxHitPoints() * 100[/B]) < 40) { getGroup()->pushMission(MISSION_SKIP); return; }
The problem is that both currHitPoints() and maxHitPoints() return ints, forcing the result to 0 for any unit without full hit points, and 0 * 100 = 0 is always < 40, so it will wait until fully healed.
The fix is to multiply by 100 before dividing:
Code:if (([B]100 * currHitPoints() / maxHitPoints()[/B]) < 40)
This assumes that currHitPoints() returns a number in [0, maxHitPoints()] for [Dead, Full Health].
Haven't forgotten ...
iTheirDefense *= ((((pDefender->firstStrikes() * 2) + pDefender->chanceFirstStrikes()) * ((GC.getDefineINT("COMBAT_DAMAGE") * 2) / 5)) + 100);
iTheirDefense /= 100;
iTheirDefense *=
(
(
(
(
pDefender->firstStrikes()
*
2
)
+
pDefender->chanceFirstStrikes()
)
*
(
(
GC.getDefineINT("COMBAT_DAMAGE")
*
2
)
/
5
)
)
+
100
);
iTheirDefense /= 100;
int iTwiceAverageFirstStrikes = (pDefender->firstStrikes() * 2) + pDefender->chanceFirstStrikes();
int iTwiceGlobalAverageCombatDamage = 2 * GC.getDefineINT("COMBAT_DAMAGE");
iTheirDefense *=
(
(
(
iTwiceAverageFirstStrikes
)
*
(
(
iTwiceGlobalAverageCombatDamage
)
/
5
)
)
+
100
);
iTheirDefense /= 100;
I've found an AI Autoplay bug: After being killed under AI Autoplay, you can switch to another civilization, but you cannot 'end turn'. Therefore you cannot play anymore after beeing killed under AI Autoplay.