Decimals and rounding?

This sequel to the award-winning Crown of Glory takes Napoleonic Grand Strategy to a whole new level. This represents a complete overhaul of the original release, including countless improvements and innovations ranging from detailed Naval combat and brigade-level Land combat to an improved AI, unit upgrades, a more detailed Strategic Map and a new simplified Economy option. More historical AND more fun than the original!

Moderator: MOD_WestCiv

Post Reply
and2
Posts: 79
Joined: Sat Jan 17, 2009 7:51 am

Decimals and rounding?

Post by and2 »

Hi all new gamer here.

Ive been playing some games by now and Im wondering in the development screen when I fiddle with the sliders if COGEE works with decimals and where a rounding takes place.

Do ressources get produced in decimals, summed up and then rounded down?

Or in other words is it in a given province or at national level that rounding down takes place?

If at provincial level my inclination to tweak would increase quite a bit :)

Anyone playtested or better know the algoritm/can look under the hood?

Chindits
Spanish Player in "1792 no frills"
French Player in "Westphalian Discord"
User avatar
06 Maestro
Posts: 3997
Joined: Tue Oct 11, 2005 10:50 pm
Location: Nevada, USA

RE: Decimals and rounding?

Post by 06 Maestro »

Welcome and2

There was some very good info posted about the sliders and production. Here is a link to one.

tm.asp?m=2161079

and, and2

tm.asp?m=2161062

and one more
tm.asp?m=2146882
Banking establishments are more dangerous than standing armies.

Thomas Jefferson

and2
Posts: 79
Joined: Sat Jan 17, 2009 7:51 am

RE: Decimals and rounding?

Post by and2 »

Thanks Ill look them through once I'm back from work
Spanish Player in "1792 no frills"
French Player in "Westphalian Discord"
User avatar
morganbj
Posts: 3472
Joined: Sun Aug 12, 2007 1:36 am
Location: Mosquito Bite, Texas

RE: Decimals and rounding?

Post by morganbj »

For each province, decimals are retained throughout the resource production calculations, then become probablities for getting an additional unit of the resource at the end.  So, if the final value is 3.25, you have a 25% chance of actually getting 4.  BUT, the development advisor screen always seems to round the numbers down, so you're very likely so see more than you expect from viewing that screen (but not very many more, especially when you subtract levy reductions).  Remember the development advisor screen figures are only "low-side" estimates; they're very close, but not always exact.

Don't forget that there are many things that can modify what the provice provides: enemy units, weather, unrest, waste, etc.

The adjusted numbers for all the provinces are then added up, the effect of levy level is considered, and the final resource amount is completed. (Well, there may be additions/subtractions for trade and privateers and such, but these are usually very small.)

Occasionally, and randomly, problems and solutions collide. The probability of these collisions is inversely related to the number of committees working on the solutions. -- Me.
User avatar
ericbabe
Posts: 11848
Joined: Wed Mar 23, 2005 3:57 am
Contact:

RE: Decimals and rounding?

Post by ericbabe »

We got rid of the probabilities late in development.  The randomness of production was a source of confusion, and lead to too much variance in production.

In general, fractions are dropped at most of the discrete stages of economic calculations.  For instance, after feudal production loss is calculated, fractions are dropped.  In a few places, we do round to the nearest integer instead of dropping fractions.  We decided these on a case by case basis, with one eye on the final economic numbers to decide which way to do the rounding.
Image
User avatar
morganbj
Posts: 3472
Joined: Sun Aug 12, 2007 1:36 am
Location: Mosquito Bite, Texas

RE: Decimals and rounding?

Post by morganbj »

Well, that's news to me.
Occasionally, and randomly, problems and solutions collide. The probability of these collisions is inversely related to the number of committees working on the solutions. -- Me.
User avatar
ericbabe
Posts: 11848
Joined: Wed Mar 23, 2005 3:57 am
Contact:

RE: Decimals and rounding?

Post by ericbabe »

Yeah, sorry.  I know when I wrote up the original economic whitepaper (and in the revised economic whitepaper!) we were still using variable production. When I actually looked into what the variance was in the game, there were many cases where it was just too dominant, made economic prediction too much guesswork.
Image
and2
Posts: 79
Joined: Sat Jan 17, 2009 7:51 am

RE: Decimals and rounding?

Post by and2 »

Hi thanks for the "under the hood" answer! :)

Supposing I understand your replies correctly it seems to me, that it makes sence to fiddle with the sliders in the provincial development screen to reach an optimum production setting, that just reaches the right side (positive) of the integer? for example 3.0-3.2 iron rather then 3.7-3.9 in X province.

I understand that occupation, weather, feudal, waste and so on can intervene along the production algorithm, but my first option as a gamer to make a difference, so to speak, in the algorithm, is at the provincial development screeen.

I realise it might be a black and white question, but it seems the dropping of fractions, rather then rounding to nearest integer, increases my inclination to "fiddle" the sliders at the development screen?

Chindits

*Edited for spelling lol*
Spanish Player in "1792 no frills"
French Player in "Westphalian Discord"
User avatar
morganbj
Posts: 3472
Joined: Sun Aug 12, 2007 1:36 am
Location: Mosquito Bite, Texas

RE: Decimals and rounding?

Post by morganbj »

Fiddling with the sliders is essentially a waste of time. See the Advanced Economy Guide in the Manuals folder. By fiddling, you're only getting very small amounts of a resource, and that is more work than it's worth (especially since you're likely not to get what you think anyway).

I have the formulas coming for all the resources so you can see what I mean. It's in the final stages and should be ready sometime this weekend.
Occasionally, and randomly, problems and solutions collide. The probability of these collisions is inversely related to the number of committees working on the solutions. -- Me.
and2
Posts: 79
Joined: Sat Jan 17, 2009 7:51 am

RE: Decimals and rounding?

Post by and2 »

Nice, I look forward to the formulas updated, thanks for all the addendums, I did read them all, particular the one about textiles I appriciated much.
 
 
 
Spanish Player in "1792 no frills"
French Player in "Westphalian Discord"
Post Reply

Return to “Crown of Glory: Emperor's Edition”