RE: upgrading your army: how?
Posted: Fri Jul 29, 2005 11:35 am
ORIGINAL: Joram
It is not working as described. The real data is more or less* 3 times the sum of the squares of the barracks, plus the sum of the squares of the cultural developements, all divided by 100.
So it's easier to compare ...
Erics formula is equivalent to (2*SSB + SSC)/100
While Mari is saying it's (3*SSB + SSC)/100
[:)]
I admit I've never hand calculated the sums of the squares of my barracks/culture. The code seems to follow 2*SSB:
float TGame::Info_Calc_No_Upgrades(PLAYER_HANDLE hPlayer)
{
int mil = 0;
int PlayerDev[NoPlayersWithTreaties];
zap(PlayerDev);
Info_CountDevelopmentSquaresForPlayers(PlayerDev, TCity::Martial_Dev);
mil += PlayerDev[hPlayer];
Info_CountDevelopmentSquaresForPlayers(PlayerDev, TCity::Cultural_Dev);
mil += PlayerDev[hPlayer]/2;
return (float) mil/50.0f;
}
The above is the method that is called when calculating the number in the Upgrade Report from the Econ Advisor.
and
void TGame::Info_CountDevelopmentSquaresForPlayers(int* pPlayerDev, int dev)
{
assert(dev<TCity::eoDev);
TPieceLoop Loop(PTProvMap);
GAMEPIECE pPiece;
for (Loop.Reset(); Loop.Continue(); Loop.Next())
{
pPiece = (GAMEPIECE) Loop;
if (pPiece->IsACity() && pPiece->GetPlayerId()<NoPlayersWithTreaties)
{
pPlayerDev[pPiece->GetPlayerId()] +=
pPiece->GetCityDevelopment(dev)*pPiece->GetCityDevelopment(dev);
}
}
}