Added new option AI_PATH_TWEAKS which controls various experimental path tweaks for AI: avoid gas, deep water, light at night.

Added experimental path tweak: AI tanks prefer moving in straight directions to avoid sliding effect.
Set default value for options AI_EXTRA_SUPPRESSION, AI_NEW_MORALE, AI_BETTER_COVER, AI_MOVEMENT_MODE to TRUE.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8737 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2020-01-24 09:14:38 +00:00
parent 77f5a7770d
commit 352a344308
3 changed files with 17 additions and 25 deletions
+11 -21
View File
@@ -3832,18 +3832,25 @@ if(!GridNoOnVisibleWorldTile(iDestination))
//nextCost = gubDiagCost[nextCost];
nextCost = nextCost * 14 / 10;
//nextCost++;
}
}
if ( bLoopState == LOOPING_REVERSE)
{
// penalize moving backwards to encourage turning sooner
nextCost += 50;
}
// sevenfm: tanks prefer moving in straight directions to avoid sliding effect
if (gGameExternalOptions.fAIPathTweaks &&
TANK(s) &&
(iCnt & 1))
{
nextCost += 50;
}
newTotCost = curCost + nextCost;
// sevenfm: experimental path tweaks for AI
if (s->bTeam != gbPlayerNum &&
if (gGameExternalOptions.fAIPathTweaks &&
s->bTeam != gbPlayerNum &&
!(s->flags.uiStatusFlags & SOLDIER_BOXER) &&
!AreInMeanwhile() &&
IS_MERC_BODY_TYPE(s))
@@ -3867,25 +3874,8 @@ if(!GridNoOnVisibleWorldTile(iDestination))
}
}
/*
// no diagonal bias - straightforward costing regardless of direction
newTotCost = curCost + nextCost;
// NOTE: ON JAN 6TH, 1995, IAN COMMENTED OUT THE DIAGONAL BIAS AND
// UNCOMMENTED THE "NO DIAGONAL BIAS"
//diagonal bias - this makes diagonal moves cost more
if (iCnt & 1)
// diagonal move costs 70 percent
//newTotCost += (nextCost/PATHFACTOR);
newTotCost += 1;
// newTotCost = curCost + ((prevCost+nextCost)*7)/10;
// else // non-diagonal costs only 50%
// newTotCost = curCost + (prevCost+nextCost)/2;
*/
// have we found a path to the current location that
// costs less than the best so far to the same location?
if (trailCostUsed[newLoc] != gubGlobalPathCount || newTotCost < trailCost[newLoc])