Hi!

I have been looking into the correct tile production formula, and have arrived 
at this result after verifying a lot of different outputs:

normal production =
  (
    base production
    + additive expert production
    + additive resource production
    + additive expert resource production
  ) 
  * multiplier resource
  * multiplier expert
  
  
tile improvement production =
  additive tile improvements (plow, road, minor river, major river)  
  * multiplier expert
   
colony efficiency bonus =
  MAX(rebel bonus number, (
    rebel bonus number
    * multiplier resource
    * IF(expert at producing goodstype, 2, 1)
  ))

total production =
  normal production
  + tile improvement production
  + colony efficiency bonus


Note that the colony efficiency bonus gets multiplied even for expert types 
that only have additive bonuses (Expert Farmer).

The current production numbers in FreeCol deviates rather heavily from this 
formula, and I have built an acceptance test based on the above formula and 
verified a few hundred production variations in the original game as well.


Best wishes,
Stian Grenborgen



___________________________________
From: Stian Grenborgen
Sent: 03 September 2022 10:51
    
Hi again,

I have found that getPotentialProduction/getMaximumPotential for 
Tile/BuildingType produces different results than the actual production 
(ColonyTile/Building) even when the results should be the same.

When looking into the code I have noticed all sorts of issues with modifiers 
not being applied. Some of these issues only affect methods used by the AI, 
while other issues affect the actual production. For example, an expert farmer 
never gets the additional  (expert) bonus from the grain resource.

I think the best solution for these problems is having a separate class for 
calculating production/consumption -- and that this class gets the list of 
modifiers for the colony and player as parameters. This way, we can use the 
same code everywhere (potential,  maximum and actual production) and 
Tile+ColonyTile+Building+Colony gets simplified.

The main problem with the rewrite is lack of tests for the correct tile 
production values ... so it would be really helpful if someone would make 
tables/lists with the correct values for each combination of:
* Tile type
* Resource
* Tile improvements (plow, minor river, major river and/or road)
* Worker type (unattended, petty criminal, indentured servant, colonist, 
convert, expert)
* Liberty bonuses (-2, -1, 0, +1, +2)

That's lots of combinations and numbers ... but only having a complete set for 
one resource (grain) would help immensely. Please do tell if you can help make 
these tables/lists :-)


Best wishes,
Stian Grenborgen    

_______________________________________________
Freecol-developers mailing list
Freecol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to