Fixed (?): passive AI[message #330930]
|
Sat, 01 March 2014 04:36
|
|
Flugente |
|
Messages:3509
Registered:April 2009 Location: Germany |
|
|
Not a feature, just a fix, but likely very interesting to some people:
One can observe that the AI is very inactive, it doesn't send out that many groups. This is especially baffling on Insane. A likely reason is this gem:
BOOLEAN GarrisonRequestingMinimumReinforcements( INT32 iGarrisonID )
{
INT32 iAvailable;
INT32 iDesired;
SECTORINFO *pSector;
Ensure_RepairedGarrisonGroup( &gGarrisonGroup, &giGarrisonArraySize ); /* added NULL fix, 2007-03-03, Sgt. Kolja */
if( gGarrisonGroup[ iGarrisonID ].ubPendingGroupID )
{
return FALSE;
}
pSector = &SectorInfo[ gGarrisonGroup[ iGarrisonID ].ubSectorID ];
iAvailable = pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites;
iDesired = gArmyComp[ gGarrisonGroup[ iGarrisonID ].ubComposition ].bDesiredPopulation;
if( iDesired - iAvailable >= gubMinEnemyGroupSize )
{
return TRUE;
}
return FALSE;
}
This looks innocent enough, but is very evil. The desired population of a sector is determined in TableData/Army/ArmyComposition.xml and is independent of difficultylevel or ini settings. This has the nasty effect that if one increases the difficulty-dependent enemy min group size (MIN_ENEMY_GROUP_SIZE_INSANE etc.), you are VERY likely to be to high for that condition to ever fulfilled! :scary: In effect, this hampers the army tremendously. So I've added this bit
// Flugente: The above check is insufficient. if we increase gubMinEnemyGroupSize (to, say, make the game harder), this check will never evaluate to true. Congratulations, you've broken the AI!
// Instead, if we have nobody here, but want someone to be here, then a minimum-sized group is in order.
if( iDesired > 0 && iAvailable == 0 )
return TRUE;
which results in destroyed garrisons being replaced.
Another error is in
//The maximum number of reinforcements can't be offsetted past a certain point based on the
//priority of the garrison.
iMaxReinforcementsAllowed = //from 1 to 3 times the desired size of the normal force.
gArmyComp[ gGarrisonGroup[ iDstGarrisonID ].ubComposition ].bDesiredPopulation +
gArmyComp[ gGarrisonGroup[ iDstGarrisonID ].ubComposition ].bDesiredPopulation *
gArmyComp[ gGarrisonGroup[ iDstGarrisonID ].ubComposition ].bPriority / 50;
if( iReinforcementsRequested + ubNumExtraReinforcements > iMaxReinforcementsAllowed )
{
//adjust the extra reinforcements so that it doesn't exceed the maximum allowed.
fLimitMaxTroopsAllowable = TRUE;
ubNumExtraReinforcements = (UINT16)(max(0, iMaxReinforcementsAllowed - iReinforcementsRequested));
}
iReinforcementsRequested += ubNumExtraReinforcements;
. In effect, groups are again cut down, with no regard for the minimum enemy group size. This can have nasty effects, as there are instances where groups aren't moved because they are too small. I#ve adjusted the group size in that case.
I also looked into the problem that the enemy stops attacking if one stacks enough elite militia in towns. The AI does consider attacking those sectors, but deems its chance of success to low. It thus considers a bigger group size the next time it evaluates. I fear that, in extreme cases, an overflow might be present here, but my fix had... sideeffects, so I#m not touching that for now.
If someone wants to further increase the difficulty, I strongly advise to lower BASE_DELAY_IN_MINUTES_BETWEEN_EVALUATIONS_INSANE and EVALUATION_DELAY_VARIANCE_INSANE (or respective difficulty level modifiers), as these determine the frequency with which the queen sends out attack forces (she can only send out one per evaluation, apart from one-time events, like counterattacks). Also, edit the ArmyComposition.xml to increase the number of troops the queen wants in a town - if you increase the size for cities you already conquered, the enemy forces should be bigger. The compositions are basically forceloadouts that are then linked to sectorsin GarrisonGroups.xml.
The above fixes are committed in r6999.
Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|