What are the actual effects of the luxury trade route and the slave trade route? Does anyone know the numbers?
One of the XML files is called TradeRouteDef. If I'm reading that file correctly, a standard or slave trade route should have a base value of
0.05 * [planet "incomes"] + max(1, min(250, 0.025 * [trade route length])) + max(1, min(250, 0.1 * [trade route age]))
A luxury trade route should have a base value of
0.1 * [planet "incomes"] + max(1, min(250, 0.05 * [trade route length])) + max(1, min(250, 0.1 * [trade route age]))
Luxury trade routes should additionally grant +5% influence and morale to the host colony, while slave trade routes should grant +5% production to the host colony. All three types of trade routes should grant +1 morale to the colony if at least one of the empires involved has the Entrepreneur faction trait. This base value is then multiplied by the trade route value bonuses which apply to the planet in question.
It should be noted that the "planet income" modifier listed in TradeRouteDef.XML appears to be based off of planetary production rather than any specific to planetary income. I have a (somewhat modded, but nothing specifically aimed at trade routes) test game where Earth is specialized for manufacturing and has a population of 61.4 (production of ~109) with -39.5 income while another world is specialized for wealth and has population of 27.5 (production of 61.9) with 2070.8 net income, while Drengi (my trading partner) has a population of 17 (production of 22) and a net income of 11.3. The Earth-Drengi route 6.6 of its base value from the incomes of Earth and Drengi according to the tool tip for the trade route in the Govern screen, while the other colony's trade route gets 4.2 of its base value from the incomes of my other colony and Drengi (again according to the tool tip). 5% of 2070 is 103.5, so clearly net income is not used to compute the bonus from trade planet "incomes," but 5% of 83.9 (22 production from Drengi + 61.9 production from my colony) is 4.195, which is rather similar to the value of 4.2 listed for that trade route's bonus from trade planet "incomes." Similarly, when we check Earth-Drengi, we see that 0.05 * (109 + 22) = 6.55 and that the Earth-Drengi trade route has a bonus of 6.6 from trade planet "income." Note that if you have structures (or projects, if you've modded the existing projects or added new ones) giving bonuses to gross income (e.g. v1.01 Prometheon Pleasure Parks), this bonus will NOT affect the trade route value.
A = 4.9 ( [Population of my planet + target planet] * 0.1)
I don't believe that this is entirely correct. The numbers that I see in game suggest to me that the portion of the trade route's value which comes from planetary "income" is based more directly off of planetary production, not population.
Some numbers from a quick, unmodded test game:
Trade route between Umoja I (a colony) and Drengi:
Umoja I has a population of 8.8/9/9.4, approval of 29/28/27, with +1 production from Enhanced Production and +10% production from an Economic Starbase for all three data points.
Drengi has a population of 10.8/10.9/11.1, approval of 63/63/62, with no known production bonuses from starbases, technologies, or structures.
Thus, we have population totals of 19.6/19.9/20.5, and production totals of roughly 37.5/37.7/38.2. The trade route income bonus from trading planet "incomes" is 1.6/1.6/1.6 for this trade route; this is 8.2%/8.0%/7.8% of the population or 4.3%//4.2%/4.2% of the production. It's a standard trade route, and TradeRouteDef.XML indicates that standard trade routes should have a multiplier of 0.05 to whatever is being referred to as planetary income; ~4.2% is much closer to 0.05 than ~8% is.
Trade route between Umoja I and Kona:
Same set of points for Umoja I as above.
Kona has a population of 7 and approval of 54 for all three data points, with no known production bonuses.
Population totals are 15.8/16/16.4, production totals are 27.8/28/28.3, and the trade planet income bonuses to trade route income are 1.2/1.2/1.3. This is 7.6%/7.5%/7.9% of the populations and 4.3%/4.3%/4.6% of the planetary production. It's a standard trade route, and once again the ratio of TPI to planetary production totals is more similar to the planetary income multiplier stated in TradeRouteDef.XML than the ratio of TPI to planetary population.
Trade route between Earth and Drengi:
Earth's population is 13 and approval is 84 for both data points, with +1 production from Enhanced Production, +2 production from a Durantium Refinery, and +10% production from an economic starbase.
Drengi's population is 10.9/11.1 and its approval is 63/62 with no known production bonuses.
Population totals are 23.9/24.1, production totals are 54.6/54.7, TPIs are 2.5/2.5, TPI/Population ratios are 10.5%/10.4%, TPI/Production ratios are 4.6%/4.6%. Standard trade route, again expecting the base value used for TPI to be multiplied by 0.05 => production again matches the expectation better.
Trade route between Earth and Kona
Earth's population is 13 and its approval is 84, with +2 production from a Durantium Refinery, +1 production from Enhanced Production, and +10% production from an Economic Starbase.
Kona's population is 7 and its approval is 54, with no known production bonuses.
Population total is 20, production total is 44.8, TPI is 2.1, TPI/population is 10.5%, TPI/production is 4.7%.
Note that these numbers, especially the TPI/production ratios, are rounded and based off of rounded values, so it should be expected for there to be some variation in the observed ratios around the expected value. The TPI/production ratios are more consistent with one another and with the expected fraction of trade planet income listed in TradeRouteDef.XML than the TPI/population ratios; therefore, I would suggest that it's more likely that the Trade Planet Income bonus is based off of planetary production than directly off of planetary population.