Where in the files is the actual formula used to calculate Trade?

Valatros

Chieftain
Joined
Apr 10, 2014
Messages
33
Pretty much the title. I'm not an experienced enough modder or programmer to intuit where to look, and going through all instances of the word "Trade" with text crawler was a nonstarter. Is it somewhere readily accessible, or is messing with the formula itself, rather then just the variables it interacts with, going to require a DLL mod?
 
Seems like you intuited it correctly. CvGameCoreDLLFinalRelease

Normally, calculations like this are done in C++. BE did some things a little different with the covert operations and quests, which are done in Lua, but trade is still in the DLL as far as I can see.
 
Ah, crap. Alright thanks, being right that it was somewhere out of the realm of what I can fix is a bit like coming home to find out you were right, you DID leave the oven on, but at least now I know. Ah well, maybe in a couple terms.
 
So, how easy would a DLL be to change? Or could we change where the trade routes look for the formula (i.e., to something we can edit)?
 
The defines file holds at least some tweakable variables that allow you to influence trade (and give an insight how the formula night work). You can't change the basic calculation setup, but tweaks to the existing variables are possible.
 
So, how easy would a DLL be to change? Or could we change where the trade routes look for the formula (i.e., to something we can edit)?

To change it, you need the source code. This means you have to wait if/until Firaxis releases it. They were nice enough to do so for Civ4 and Civ5 and the add-ons, so I guess they will also do so for BE. However, for Civ5, we had to wait quite a long time, and the same might be true for BE.

When it is released, the thing is written in C++, so if you can code in C++, it's not a big deal to change the trade route formula. You can familiarize yourself with it by editing the DLL for Civ5.
 
Top Bottom