upgrading your army: how?

Crown of Glory: Europe in the Age of Napoleon, the player controls one of the crowned potentates of Europe in the Napoleonic Era, wielding authority over his nation's military strategy, economic development, diplomatic relations, and social organization. It is a very thorough simulation of the entire Napoleonic Era - spanning from 1799 to 1820, from the dockyards in Lisbon to the frozen wastes of Holy Mother Russia.

Moderators: Gil R., ericbabe

User avatar
ericbabe
Posts: 11848
Joined: Wed Mar 23, 2005 3:57 am
Contact:

RE: upgrading your army: how?

Post by ericbabe »

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);
}
}
}
Image
ian77
Posts: 634
Joined: Tue Apr 27, 2004 12:05 pm
Location: Scotland

RE: upgrading your army: how?

Post by ian77 »

ORIGINAL: ericbabe
ORIGINAL: Mynok
I have a used-once 12-cup coffee maker sitting idle in my attic. Send my your address and its yours. Put it right in the basement next to the water cooler and 20 pound bag of java beans.

[:)] LOL -- I think I need an I.V.

I have a used once catheter needle and tube, along with an old milk bottle....Send my your address and its yours. Put it right in the basement next to the water cooler and 20 pound bag of java beans.
[:D]
marirosa
Posts: 56
Joined: Wed Jul 06, 2005 3:04 am

RE: upgrading your army: how?

Post by marirosa »

I think i know what is happening. The key is

Code: Select all

mil+=PlayerDev[hPlayer]/2
As mil is an integer, if you divide an odd number, the result is truncated. For example, if you have a level 3 culture, the result of the function is 9, divided by 2 is 4.5, but as mil is integer, it only adds 4.

This can explain the inacuracies in my results and makes me wonder.... 3*SSB is exactly the same as SSB/50 + (SSB/2)/50 so it seems the call to

Code: Select all

 Info_CountDevelopmentSquaresForPlayers(PlayerDev, TCity::Cultural_Dev);
 mil+=PlayerDev[hPlayer]/2
 

do not reset the value of PlayerDev[hPlayer], so instead of counting the squares of culture, it ADDS the squares of culture to the squares of barracks.
Joram
Posts: 3206
Joined: Fri Jul 15, 2005 5:40 am

RE: upgrading your army: how?

Post by Joram »

As mil is an integer, if you divide an odd number, the result is truncated. For example, if you have a level 3 culture, the result of the function is 9, divided by 2 is 4.5, but as mil is integer, it only adds 4.

Ahh, makes sense. I missed that it was an integer. Indeed, you won't get the fraction if you divide into the integer!

Post Reply

Return to “Crown of Glory”