This thread got me thinking about the rules for the Great Merchant Trade Mission so I delved into the SDK and found the following...
The formula for the amount of gold received is...complicated...
Total Gold =
iBaseTrade + (
iTradeMultiplier *
iUnitTradePercent/100 *
Profit )
Where
iBaseTrade is 500 (from Civ4UnitInfos.xml)
iTradeMultiplier is 200 (from Civ4UnitInfos.xml)
iUnitTradePercent is a speed scaling factor (from Civ4GameSpeedInfo.xml)
- 300% for Marathon
- 150% for Epic
- 100% for Normal
- 67% for Quick
and
Profit is calculated as follows...
First get the base profit, which is the lesser of two values
Method1
BaseProfit =
CapitalPop *
THEIR_POPULATION_TRADE_PERCENT/100
Where
CapitalPop is the populaition of your capital as shown on the map (not the one in the demographics screens)
THEIR_POPULATION_TRADE_PERCENT is 50
So, by default method1 yields
BaseProfit = CapitalPop/2
Method2
BaseProfit =
CapitalDist *
iTradeProfitPercent/100
Where
CapitalDist is the distance to your capital measured in tiles with diagonals counting 1.5
iTradeProfitPercent is a mapsize scaling factor (from CIV4WorldInfo.xml)
80% for Duel
70% for Tiny
60% for Small
50% for Standard
40% for Large
30% for Huge
So on a standard map, method2 yields
BaseProfit = CapitalDist/2
OK, we take the lesser of the values from method1 and method2 as
BaseProfit. So now,
Profit =
BaseProfit * (100 +
FOREIGN_TRADE_MODIFIER)/100 *
TotalTradeModifier/100 *
TRADE_PROFIT_PERCENT/100
[
Note: if Profit is 0 at this point it is set to a minimal 1 for a domestic route and 2 for a foreign route]
Where
FOREIGN_TRADE_MODIFIER is 150 (from GlobalDefines.xml) but is only used if the city does not belong to our team
TRADE_PROFIT_PERCENT is 20 (from GlobalDefines.xml)
is calculated as follows...
TotalTradeModifier = 100 +
iTradeRouteModifier + (
CityPop +
OUR_POPULATION_TRADE_MODIFIER_OFFSET ) *
OUR_POPULATION_TRADE_MODIFIER ) +
CAPITAL_TRADE_MODIFIER
[
Note: If TotalTradeModifier is less than 0 then 0 is used]
Where
iTradeRouteModifier is the sum of iTradeRouteModifier (from CIV4BuildingInfos.xml) for all buildings in the city (Note: Currently only Harbor (=50) has this value set)
CityPop is the populaition of this city as shown on the map (not the one in the demographics screens)
OUR_POPULATION_TRADE_MODIFIER_OFFSET is -10 (from GlobalDefines.xml)
OUR_POPULATION_TRADE_MODIFIER is 5 (from GlobalDefines.xml)
CAPITAL_TRADE_MODIFIER is 25 (from GlobalDefines.xml) but is only added if this city is connected to its capital
So, by default for a foreign city that has a harbor and is connected to its capital...
Profit = min(CapitalPop/2, CapitalDist/2) * 250 / 100 * ( ( 100 + 50 + (CityPop-10)*5 +25) / 100 ) * 20 / 100
and the total gold received (assuming normal speed) is...
Total Gold = 500 + 200 * (min(CapitalPop/2, CapitalDist/2) * 250 / 100 * ( ( 100 + 50 + (CityPop-10)*5 +25) / 100 ) * 20 / 100 )
So, to summarize,
You always get a base amount of 500
The variable part is 200 times a value that is proportional to game speed and related to
- the city size
- whether the city has a harbor
- whether the city is connected to its capital,
- whether the city is foreign (means 'not on our team', rather than just 'not ours'),
- a number of modifiers defined in XML files
- and the lesser of:
- the population of your capital
- the distance to your capital scaled based on map size.
Whew, I hope someone other than me finds that useful.