Well Global factor for production is one with Difficulty and Era factors on further processing.
Code:
Normal/Noble/Standard factors. Era factor is 100 too.
int iProductionNeeded;
iProductionNeeded = GC.getBuildingInfo(eBuilding).getProductionCost(); 1000H
iProductionNeeded *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getConstructPercent(); 1000H*100 = 100 000H
iProductionNeeded /= 100; 100 000H/100 = 1000H
int iModifier = (GC.getHandicapInfo(getHandicapType()).getConstructPercent() - 100); 100 - 100 = 0
iModifier += GC.getDefineINT("BUILDING_PRODUCTION_PERCENT") - 100; 0 + 0 - 100 = -100 - Global modifier set to 0 in this simulation.
iModifier += (GC.getEraInfo(getCurrentEra()).getConstructPercent() - 100); -100 + 100 - 100 = -100
if (iModifier < 0)
{
iModifier = (-1 * iModifier + 100); -1*-100 + 100 = 200
iProductionNeeded = iProductionNeeded * 100 / iModifier; 1000H*100/200 = 500H
}
else if (iModifier > 0)
{
iProductionNeeded *= 100 + iModifier;
iProductionNeeded /= 100;
}
return std::max(1, iProductionNeeded); 500 H
Setting global production modifier to 0 halves production cost if other factors are set to 100.
Global factor should be multiplier to reduce costs to x% if you set it in xml at x% independently from all other factors.
Lets go abstract:
Lets say there is factor A, that is is used for further processing.
a lets say is Difficulty factor, b is Global factor and c is Era factor.
A = a + b + c.
A = a + 2b + c != 2A
A = a + 0 + 0 = a
I guess you should make program to do calculations for you
Adding different factors makes them depend on each other.
That is if you really wanted to reduce building costs to 80% with global modifier, then you should reduce difficulty and era modifiers by 80% too.
In total there is Global modifier, Mapsize modifier, Difficulty modifier, Speed modifier and Era modifier.
Additionally Research have Beeline Stings and Production have Upscaled Costs option.