Hello, I've seen some Trade Route formulas posted under the CIV2 forum, I'm just wondering if anyone knows the trade route formula for CTP2. Or maybe a hint on which cpp file I should search under
Announcement
Collapse
No announcement yet.
trade route calculation?
Collapse
X
-
Cursory investigation suggests that it's pretty simple. From TradeRouteData.cpp:
Code:sint32 TradeRouteData::GetValue() const { if(m_sourceRouteType != ROUTE_TYPE_RESOURCE) return 0; double baseValue = g_theWorld->GetGoodValue(m_sourceResource); double distance = double(m_destinationCity->GetCityData()->GetDistanceToGood(m_sourceResource)); return sint32(baseValue * distance); }
I guess this may be processed further (taking into account city populations, or something like that). I suggest you investigate - I guess you'd either want to look for calls to the above function or else work the other way from wherever the values get used (e.g. the trade screen).
Comment