FlaviusBelisarius
Chieftain
I've been working extensively on making the transportation game more functional and less painful to setup. Work is not finished (meaning I have still ideas on how to move forward) but since I have had quite nice results on my test game, I will describe what I have done so far.
Briefly:
1 and 2: new transport controls
Similarly to the existing import feeder logic, the idea here is to have hysteresis and better control over when stuff moves in or out of a city. Whereas the old feeder was hard-coded to trigger on 75% maintain level, the new threshold parameter allows full control. For symmetry, a similar threshold is added for export: do not start exporting before a set level of storage is reached (export threshold).
This is how import/export governor popup looks like now:
Lumber is fully set for import and export functions. Max storage is 100. Maintain level is 20. Import feeder threshold is 40. Export threshold is 60.
Import of lumber is turned on (while it was off) when storage level drops below 40.
Import of lumber is turned off (while it was on) when storage level surpasses 40 (and maintain level if it was higher).
Lumber imports will not exceed 100 storage level.
Lumber export is turned on (while it was off) when storage level reaches 60.
Lumber export is turned off (while it was on) when storage level drops to 20 or below.
So in this case, in the hysteresis range of 40-59 storage, the situation is static. No importing. No exporting.
Stone is set for automatic needs-only import. If construction requires stone, just that much will be imported, not more, not less (feature 6). Otherwise, storage is kept at zero assuming no local production takes place.
3. Auto setup feeder
What this feature does, it makes a single xml-editable load function of the import/export governor popup parameters.
CIV4YieldInfos.xml
has new fields for
loads and applies the settings in one go.
4. Automatic domestic goods button
Similarly to 3, this is a new one-click automatic setup function. But this one is rather clever.
Coats are produced locally (and in demand too locally for volume 1). Import is set to off and export is set on with a threshold of 60 storage, keeping 10. (I set the keep_min as closest multiple of 10 rounded up)

In the above screen capture, domestic imports and exports are set with one click. Coffee, .. to Wine are imported with differing parameters. Wool cloth, Cloth and Beer are exported instead since they are locally produced.
Note the new visualization on the import export fields:
[a-b] @c-
a: maintain level
b: maximum storage
c: import threshold
[d-] @e+
d: maintain level
e: export threshold
Both have color highlight denoting if import / export is active or stopped presently.
There are a lot of small things to improve with this function yet. But it is very powerful already!
5. switch export/import city roles

City in export / import squares switch places. No need to remove and re-select.
7. route-automation adheres to thresholds
By activating the transport advisor screen (above screen shot), you can put transports to partially automated mode. In this mode, it used to be so that feeder logic was ignored partially. Now, it does not matter. All transports follow the rules.
[Edit:] Now published in:
https://github.com/MagisterBelisarius/Mod/tree/transport_automation
Briefly:
- New yield setting (spinbox) in city governor import/export popup: import feeder threshold
- New yield setting (spinbox) in city governor import/export popup: export threshold
- New button in city governor import/export popup: Auto-setup feeder on all goods
- New button in city governor import/export popup: Auto-setup domestic goods
- New button in trade routes advisor: switch export/import city roles
- Changed functionality: import feeder by default precisely transports construction materials (not bringing more than needed as was before)
- Changed functionality: route-automated transports adhere to the feeder condition logic (and the new export threshold logic). Before, only full auto transports respected feeder status.
1 and 2: new transport controls
Similarly to the existing import feeder logic, the idea here is to have hysteresis and better control over when stuff moves in or out of a city. Whereas the old feeder was hard-coded to trigger on 75% maintain level, the new threshold parameter allows full control. For symmetry, a similar threshold is added for export: do not start exporting before a set level of storage is reached (export threshold).
This is how import/export governor popup looks like now:
Lumber is fully set for import and export functions. Max storage is 100. Maintain level is 20. Import feeder threshold is 40. Export threshold is 60.
Import of lumber is turned on (while it was off) when storage level drops below 40.
Import of lumber is turned off (while it was on) when storage level surpasses 40 (and maintain level if it was higher).
Lumber imports will not exceed 100 storage level.
Lumber export is turned on (while it was off) when storage level reaches 60.
Lumber export is turned off (while it was on) when storage level drops to 20 or below.
So in this case, in the hysteresis range of 40-59 storage, the situation is static. No importing. No exporting.
Stone is set for automatic needs-only import. If construction requires stone, just that much will be imported, not more, not less (feature 6). Otherwise, storage is kept at zero assuming no local production takes place.
3. Auto setup feeder
What this feature does, it makes a single xml-editable load function of the import/export governor popup parameters.
CIV4YieldInfos.xml
has new fields for
- what yield to apply the function for
- maintain storage level
- maximum storage level
- feeder threshold
- export threshold
loads and applies the settings in one go.
4. Automatic domestic goods button
Similarly to 3, this is a new one-click automatic setup function. But this one is rather clever.
- It looks at the city domestic demands - only those goods that are needed are adjusted.
- It looks if the city is producing locally or needs to import.
- If the city needs to import a domestic demanded yield, suitable import feeder and max storage are set based on how much the yield is demanded. So small demands require small storage, large volumes more. It is based on how many turns the city can satisfy said demand.
- If the city produces a domestic yield it needs, imports are not set but export parameters are set instead, ensuring that there is sufficient storage remaining to satisfy domestic demand.
Coats are produced locally (and in demand too locally for volume 1). Import is set to off and export is set on with a threshold of 60 storage, keeping 10. (I set the keep_min as closest multiple of 10 rounded up)

In the above screen capture, domestic imports and exports are set with one click. Coffee, .. to Wine are imported with differing parameters. Wool cloth, Cloth and Beer are exported instead since they are locally produced.
Note the new visualization on the import export fields:
[a-b] @c-
a: maintain level
b: maximum storage
c: import threshold
[d-] @e+
d: maintain level
e: export threshold
Both have color highlight denoting if import / export is active or stopped presently.
There are a lot of small things to improve with this function yet. But it is very powerful already!
5. switch export/import city roles

City in export / import squares switch places. No need to remove and re-select.
7. route-automation adheres to thresholds
By activating the transport advisor screen (above screen shot), you can put transports to partially automated mode. In this mode, it used to be so that feeder logic was ignored partially. Now, it does not matter. All transports follow the rules.
[Edit:] Now published in:
https://github.com/MagisterBelisarius/Mod/tree/transport_automation
Last edited: