bump...
I've been looking into this from a playing perspective. I wanted to compare GS bulbs with great merchant trade missions and one thing led to another...I barely know some C and I haven't studied C++ at all, but here are some things that I've found:
From CvUnit.cpp
Code:
int CvUnit::getTradeGold(const CvPlot* pPlot) const
{
CvCity* pCapitalCity;
CvCity* pCity;
int iGold;
pCity = pPlot->getPlotCity();
pCapitalCity = GET_PLAYER(getOwnerINLINE()).getCapitalCity();
if (pCity == NULL)
{
return 0;
}
iGold = (GC.getUnitInfo(getUnitType()).getBaseTrade() + (GC.getUnitInfo(getUnitType()).getTradeMultiplier() * ((pCapitalCity != NULL) ? pCity->calculateTradeProfit(pCapitalCity) : 0)));
iGold *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getUnitTradePercent();
iGold /= 100;
return max(0, iGold);
}
If I got it right, basically this says
trade_mission_gold = 500 + 200 * trade_profit_between_the_target_city_and_my_capital
Then it scales for game speed and does some integer division with 100. (actually, that /100 is part of speed scaling most likely)
calculateTradeProfit function is a beyond my abilities. From CvCity.cpp:
Code:
int CvCity::calculateTradeProfit(CvCity* pCity)
{
int iProfit;
iProfit = min(((pCity->getPopulation() * GC.getDefineINT("THEIR_POPULATION_TRADE_PERCENT")) / 100), ((plotDistance(getX_INLINE(), getY_INLINE(), pCity->getX_INLINE(), pCity->getY_INLINE()) * GC.getWorldInfo(GC.getMapINLINE().getWorldSize()).getTradeProfitPercent()) / 100));
if (getTeam() != pCity->getTeam())
{
iProfit *= max(0, (GC.getDefineINT("FOREIGN_TRADE_MODIFIER") + 100));
iProfit /= 100;
}
iProfit *= max(0, (totalTradeModifier() + 100));
iProfit /= 100;
iProfit *= GC.getDefineINT("TRADE_PROFIT_PERCENT");
iProfit /= 100;
return max(((getTeam() != pCity->getTeam()) ? 2 : 1), iProfit);
}
This involves city population, distance, world size, trade modifiers and possibly sth else I've missed. Anyway, I think that this function should have something to do with the trade route yield that the other city would get from the capital. In fact, I've got good results with the following final formula:
trade_mission_gold = 500 + 200 * trade_route_gold_that_the_other_guy_would_have_with_my_capital
That would be for normal speed, for epic it would get multiplied by 1.5.
(btw, sorry about silly variable naming

)
I've checked with WB and spies for a few values, it seems to be working okay.
Phew...at least the bulbing thing looks simpler:
Code:
int CvUnit::getDiscoverResearch(TechTypes eTech) const
{
int iResearch;
iResearch = (GC.getUnitInfo(getUnitType()).getBaseDiscover() + (GC.getUnitInfo(getUnitType()).getDiscoverMultiplier() * GET_TEAM(getTeam()).getTotalPopulation()));
iResearch *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getUnitDiscoverPercent();
iResearch /= 100;
iResearch = min(GET_TEAM(getTeam()).getResearchLeft(eTech), iResearch);
return max(0, iResearch);
}
BaseDiscover is 1500 and DiscoverMultiplier is 3 for a GS, 1000 and 2 for other great people. This is simply
bulb_value = 1500 + 3 * total_team_population
for a GS, scaled with game speed.

If I continue this way, I'll find myself filling up gaps in my education just to play civ better...
