K-mod Deity Fun -- Collaboration of SGOTM teams

Code:
int CvSelectionGroupAI::AI_compareStacks(const CvPlot* pPlot, bool bCheckCanAttack) const
{
FAssert(pPlot != NULL);

int	compareRatio;
DomainTypes eDomainType = getDomainType();

// if not aircraft, then choose based on the plot, not the head unit (mainly for transport carried units)
if (eDomainType != DOMAIN_AIR)
{
if (pPlot->isWater())
eDomainType = DOMAIN_SEA;
else
eDomainType = DOMAIN_LAND;
}

compareRatio = AI_sumStrength(pPlot, eDomainType, bCheckCanAttack);
compareRatio *= 100;

PlayerTypes eOwner = getOwnerINLINE();
if (eOwner == NO_PLAYER)
{
eOwner = getHeadOwner();
}
FAssert(eOwner != NO_PLAYER);

// K-Mod. Note. This function currently does not support bPotentialEnemy == false.
//FAssert(bPotentialEnemy);
int defenderSum = pPlot->isVisible(getHeadTeam(), false)
? GET_PLAYER(eOwner).AI_localDefenceStrength(pPlot, NO_TEAM, eDomainType, 0)
: GET_TEAM(getHeadTeam()).AI_getStrengthMemory(pPlot);
// K-Mod end
compareRatio /= std::max(1, defenderSum);

return compareRatio;
}

====

Code:
int CvSelectionGroupAI::AI_sumStrength(const CvPlot* pAttackedPlot, DomainTypes eDomainType, bool bCheckCanAttack) const
{
CLLNode<IDInfo>* pUnitNode;
CvUnit* pLoopUnit;
int	strSum = 0;
bool bDefenders = pAttackedPlot ? pAttackedPlot->isVisibleEnemyUnit(getHeadOwner()) : false; // K-Mod
bool bCountCollateral = pAttackedPlot && pAttackedPlot != plot(); // K-Mod

pUnitNode = headUnitNode();

int iBaseCollateral = bCountCollateral
? iBaseCollateral = estimateCollateralWeight(pAttackedPlot, pAttackedPlot->getTeam() == getTeam() ? NO_TEAM : pAttackedPlot->getTeam())
: 0;

while (pUnitNode != NULL)
{
pLoopUnit = ::getUnit(pUnitNode->m_data);
pUnitNode = nextUnitNode(pUnitNode);

if (!pLoopUnit->isDead())
{
// K-Mod. (original checks deleted.)
if (bCheckCanAttack)
{
if (pLoopUnit->getDomainType() == DOMAIN_AIR)
{
if (!pLoopUnit->canAirAttack() || !pLoopUnit->canMove() || (pAttackedPlot && bDefenders && !pLoopUnit->canMoveInto(pAttackedPlot, true, true)))
continue; // can't attack.
}
else
{
if (!pLoopUnit->canAttack() || !pLoopUnit->canMove()
|| (pAttackedPlot && bDefenders && !pLoopUnit->canMoveInto(pAttackedPlot, true, true))
|| (!pLoopUnit->isBlitz() && pLoopUnit->isMadeAttack()))
continue; // can't attack.
}
}
// K-Mod end

if (eDomainType == NO_DOMAIN || pLoopUnit->getDomainType() == eDomainType)
{
// strSum += pLoopUnit->currEffectiveStr(pAttackedPlot, pLoopUnit);

// K-Mod estimate the value of first strike, and the attack power of collateral units.
// (cf with calculation in CvPlayerAI::AI_localAttackStrength)
int iUnitStr = pLoopUnit->currEffectiveStr(pAttackedPlot, pLoopUnit);
iUnitStr *= 100 + 4 * pLoopUnit->firstStrikes() + 2 * pLoopUnit->chanceFirstStrikes();
iUnitStr /= 100;

if (bCountCollateral && pLoopUnit->collateralDamage() > 0)
{
int iPossibleTargets = pLoopUnit->collateralDamageMaxUnits();
// If !bCheckCanAttack, then lets not assume pAttackPlot won't get more units on it.
if (bCheckCanAttack && pAttackedPlot->isVisible(getTeam(), false))
iPossibleTargets = std::min(iPossibleTargets, pAttackedPlot->getNumVisibleEnemyDefenders(pLoopUnit) - 1);

if (iPossibleTargets > 0)
{
// collateral damage is not trivial to calculate. This estimate is pretty rough.
// (Note: collateralDamage() and iBaseCollateral both include factors of 100.)
iUnitStr += pLoopUnit->baseCombatStr() * iBaseCollateral * pLoopUnit->collateralDamage() * iPossibleTargets / 10000;
}
}
strSum += iUnitStr;
// K-Mod end
}
}
}

return strSum;
}

Trying to make organize stuff...
 
In a sketchy manner, from what I have understood diagonally read:

1) When no siege units by the stack, the comparison of both defending city stack strength over the invading one is 140. It means if the defending party has more than 1.4 of the attacking party, the last one will enter into pillage mode and wait for reinforcements.

2) Since two months, Karadoc included an impact in stacks comparison of first strikes. Our archers will have more points for the defending party.

3) Ignoring the bunch of functions in cascade for evaluation units strength individually taken, when comparing, those parameters are took into account:

Defendants Modifiers
  • Health bar
  • Fortification bonuses
  • City Defense Modifiers
  • Hill Defense Modifiers
  • Feature Modifiers
  • Unit Class Modifiers

Attackers Modifiers
  • Health bar
  • City Attack Modifiers
  • Hills Attack Modifiers
  • Feature Attacks Modifiers
  • Terrain Attacks Modifiers
  • A malus if crossing a river

For strength modifiers:
Code:
	if (iModifier > 0)
{
iCombat = (baseCombatStr() * (iModifier + 100));
}
else
{
iCombat = ((baseCombatStr() * 10000) / (100 - iModifier));
}

===============

For the present situation, important parameters of evaluation:

1) Sury is an @sshole.
2) His attacking units are all Combat 1.
3) Some Archers will have full fortification to none (latest ones).
4) Archers first strikes (inherent+protective) important for evaluation in some manner
5) Our protective promo modifiers
6) 50% for archers in city.
 
Thanks for the code. Manco Capac.

As I can see that we could have 5 archers ready by the time of being DOWed, which is enough to defend the city. However, can we defend the gold mine as well? 3 and 2, or 4 and 1? I'll stop before making the decision.

Here's the adjustment next:

1. Switch the build in gold city to an archer
2. let a worker to road the hill tile 1S of the capital so that the archer could arrive the battle field in time
 
Can't see the game...

Have we opened border with Persia?
Can we send a scout (warrior) in Persia, in hope of meeting other AIs?
 
Tough break.
I don't think we can protect the gold without heavy losses. All of those troops will get decent winning odds (esp. Axe).
 
Tough break.
I don't think we can protect the gold without heavy losses. All of those troops will get decent winning odds (esp. Axe).

Why the need of protecting the gold tile? What we needs is to have the max threshold to ensure the stack both attacks and lose at maximum odds to us We need that stack to suicide itself to avoid roam/pillage.
 
I agree with Manco. We need to kill the stack. Letting them attack gold should be the way to go.

the other way is to try to get copper ASAP. So that we may counterattack.

Worse thing that can happen is that the army just walks past gold/shanghai and threaten Beijing. Having 5 archers in every city will starve our economy and we will loose all improvements we are not standing on top of. We need to kill the army.
 
Oh boy, it's good we caught that wandering bachelor party (Darius does the same and we're done). If Sully is in a sort of dagger mode, might it be possible to have enough Archers in Shanghai to deter him from actually DoWing us?


Can't take the set for the next following days but I probably can next week or maybe sooner.
 
Why the need of protecting the gold tile? What we needs is to have the max threshold to ensure the stack both attacks and lose at maximum odds to us We need that stack to suicide itself to avoid roam/pillage.

Excellent. And exactly how many archers with what fortification bonuses (boni?) would that be? :mischief: And I assume that by this plan we move the archer guarding the gold into the city, right?
 
Played to T78

We got Darius' religion in the new city, I did not switch since we want the archer in gold city out in time. I also OB with Darius in the last 2 turns as our next settler will be able to claim the double fish site safely. You can see that Darius settler is coming right after OB. The good thing of playing conservatively is that we say that we were lucky that Darius's expansion was too slow, but not that his expansion is too fast to take our great sites.;) Whether to OB with DG leaves to next set.

Spoiler :




At the same time, I also did this resource trade, just to please Darius sooner.

Spoiler :




Sury's SoD is knocking the door of our gold city. Time to decide how to defend.

Spoiler :




I'm not sure who could or will take the torch next, pomthom(is UP in SGOTM19 now), soundjata(will be ready in a few days), or kossin? :wavey:
 

Attachments

  • Roland BC-0925.CivBeyondSwordSave
    115.1 KB · Views: 95
I was going to suggest our city should go on top of copper. But I seem to have been to slow.

Darius is sending a settler now. That is to bad. He also has quite an army on our border.

I suggest we leave one or two archers on the hill.
 
Lurker's comment: this just got very interesting.
 
I just noticed this game going on, and boy it looks exciting! Are lurkers allowed to post advice/recommendations (as long as they don't spoil) or would that kind of ruin the spirit? I'm still an etiquette newbie.
 
I suggest we leave one or two archers on the hill.

How many archers are available? I'd also agree to leave a few on the hill.

According to Manco Capac code interpretation, we want just enough units inside the city (4 of them should be plenty enough, bar crazy RNG)

@ Duckweed: I'm glad to take the play after next, around Monday or so...
Beware of not spoiling too much from SGOTM btw ;)

Exploration: let's move the warrior out of Guangzhou and toward the north in order to find new AIs.
 
Top Bottom