View Full Version : Making Roads Produce Commerce


Rodman49
Dec 29, 2009, 05:37 PM
So I've made my own tiny earth map with 16 civs. Problem is the starting points are not balanced at all. America, India, China, and Mongolia starting points always seem to dominate.

To lessen their dominance I want to do the following:
- Make the Road Improvement provide one additional commerce.
- Make the Railroad Improvement provide an additional hammer.

I only want this happen when I play my map. I figure that means I will need to make it a mod unless such a change can be made in the Worldbuilder save. This is for Beyond the Sword 3.19

Thanks in advance.
Oh yeah, here is a link for reference about the map:
http://www.nexus-studios.org/conflict_earth/
(Its the one in the ZIP)

The_J
Dec 29, 2009, 07:52 PM
Yes, that needs a mod, because XML changes are done globally, not map dependend.

For the route changes:
I think it's Assets\XML\GameInfo\RouteInfo.xml.

Rodman49
Dec 29, 2009, 09:27 PM
Thanks, its actually in:

\Assets\XML\Misc\Civ4RouteInfos.xml

Can I actually just add this:

<YieldChanges>
<iYieldChange>0</iYieldChange>
<iYieldChange>0</iYieldChange>
<iYieldChange>1</iYieldChange>
</YieldChanges>

And it will work?

Rodman49
Dec 29, 2009, 10:32 PM
Wow, I tried doing that and Civ freaked out (testing via custom XML).

Here is the code I used.
<?xml version="1.0"?>
<!-- edited for CONFLICT EARTH -->
<!-- edited by Paul Street on 29DEC09 -->
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Firaxis Games 2005 -->
<!-- -->
<!-- Route Infos -->
<Civ4RouteInfos xmlns="x-schema:CIV4MiscSchema.xml">
<RouteInfos>
<RouteInfo>
<Type>ROUTE_ROAD</Type>
<Description>TXT_KEY_ROUTE_ROAD</Description>
<iValue>1</iValue>
<iAdvancedStartCost>12</iAdvancedStartCost>
<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
<iMovement>30</iMovement>
<iFlatMovement>30</iFlatMovement>
<BonusType>NONE</BonusType>
<!-- CHANGE HERE -->
<YieldChanges>
<iYieldChange>0</iYieldChange>
<iYieldChange>0</iYieldChange>
<iYieldChange>1</iYieldChange>
</YieldChanges>
<!-- CHANGE HERE -->
<PrereqOrBonuses/>
<Yields/>
<TechMovementChanges>
<TechMovementChange>
<PrereqTech>TECH_ENGINEERING</PrereqTech>
<iMovementChange>-10</iMovementChange>
</TechMovementChange>
</TechMovementChanges>
<Button>Art/Interface/Buttons/Builds/BuildRoad.dds</Button>
</RouteInfo>
<RouteInfo>
<Type>ROUTE_RAILROAD</Type>
<Description>TXT_KEY_ROUTE_RAILROAD</Description>
<iValue>2</iValue>
<iAdvancedStartCost>18</iAdvancedStartCost>
<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
<iMovement>20</iMovement>
<iFlatMovement>6</iFlatMovement>
<BonusType>NONE</BonusType>
<!-- CHANGE HERE -->
<YieldChanges>
<iYieldChange>0</iYieldChange>
<iYieldChange>1</iYieldChange>
<iYieldChange>1</iYieldChange>
</YieldChanges>
<!-- CHANGE HERE -->
<PrereqOrBonuses>
<PrereqOrBonus>
<BonusType>BONUS_COAL</BonusType>
</PrereqOrBonus>
<PrereqOrBonus>
<BonusType>BONUS_OIL</BonusType>
</PrereqOrBonus>
</PrereqOrBonuses>
<Yields/>
<TechMovementChanges/>
<Button>Art/Interface/Buttons/Builds/BuildRailroad.dds</Button>
</RouteInfo>
</RouteInfos>
</Civ4RouteInfos>

Any ideas?

Jaroth
Dec 30, 2009, 01:32 PM
I'm not very familiar with XML, but I don't think you can just add your own tag like that.

Especially since there is no reference to "YieldChanges" within the schema file, CIV4MiscSchema... only "Yields".

Perhaps changing the Yields tag will add the bonus. But as The J said, it would work globally on all maps.

Also, there are "RouteYieldChanges" tags associated with all the different terrain improvements within CIV4ImprovementInfos. You can look up the one for mines to see an example using the railroad. Maybe those will be useful to you as well.

Also, unless you want railroads to yield 2 hammers, you should probably edit CIV4ImprovementInfos if you're adding it to CIV4RouteInfos instead.

The_J
Dec 30, 2009, 02:50 PM
Yes, it doesn't work in that way.
But you didn't see this entry ;):
<Yields/>


I guess, if you change it to:

<Yields>
<iYield>0</iYield>
<iYield>0</iYield>
<iYield>1</iYield>
</Yields>


it should work.
But i'm not sure, i'm not at my civ PC, can't test it, can't look at the schema.

Tholish
Dec 30, 2009, 08:48 PM
In fact I do that in my mod

<RouteInfo>
<Type>ROUTE_GRAVTUBE</Type>
<Description>GRAVTUBE</Description>
<iValue>6</iValue>
<iAdvancedStartCost>10</iAdvancedStartCost>
<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
<iMovement>10</iMovement>
<iFlatMovement>3</iFlatMovement>
<BonusType>BONUS_COPPER</BonusType>
<PrereqOrBonuses>
<PrereqOrBonus>
<BonusType>BONUS_COPPER</BonusType>
</PrereqOrBonus>
<PrereqOrBonus>
<BonusType>BONUS_DURALLOY</BonusType>
</PrereqOrBonus>
</PrereqOrBonuses>
<Yields>
<iYield>0</iYield>
<iYield>0</iYield>
<iYield>1</iYield>
</Yields>
<TechMovementChanges/>
<Button>,Art/Interface/Buttons/Units/Transport.dds,Art/Interface/Buttons/FinalFrontier2_Atlas.dds,1,3</Button>
</RouteInfo>

However, I prefer to make improvements more productive with routes rather than making routes directly productive. A railroad in the middle of nowhere isn't productive, even if there are lots of people around. However, if it goes through a farming region, the farms can effectively ship more grain. For this you use something like this

<RouteYieldChanges>
<RouteYieldChange>
<RouteType>ROUTE_TRACK</RouteType>
<RouteYields>
<iYield>1</iYield>
<iYield>0</iYield>
<iYield>0</iYield>
</RouteYields>
</RouteYieldChange>
<RouteYieldChange>
<RouteType>ROUTE_PAVED</RouteType>
<RouteYields>
<iYield>1</iYield>
<iYield>0</iYield>
<iYield>0</iYield>
</RouteYields>
</RouteYieldChange>
</RouteYieldChanges>
<bGraphicalOnly>0</bGraphicalOnly>
</ImprovementInfo>

Rodman49
Dec 31, 2009, 02:56 AM
Wow, awesome replies guys! Tholish and The_J - your stuff hit it right on the head!

Jaroth I see what you mean about railroads; mines, lumbermills, and quarries would get an additional +1 hammers. I'll edit them out (just change those values to 0).

Next question is somewhat related to this. Where do I change the text for when you highlight roads and railroads (the pop-up in the bottom left) to say that it increases commerce or hammers by one?

The_J
Dec 31, 2009, 12:27 PM
If you do that change, then it should automatically appear.
Or do you want to change that text?

phungus420
Dec 31, 2009, 03:19 PM
The yield changes for any worker action isn't displayed, as far as I can remember. You'd have to add this functionality through the SDK. It's way more of a PITA then it would be worth IMHO. Actually you could probably bring this up in the BUG forums, and the BUG team might like the idea and implement it for you :mischief:

Rodman49
Jan 02, 2010, 02:10 PM
I'm talking about when: I select a worker, and lets say I want to build a farm. So I highlight farm on the action bar at the bottom. Then in the bottom left a pop-up text with transparent background pops up and says +1:food: and -1:hammers:

Now I want +1:commerce: to pop up when a person tries to build a road. Any ideas?

If this requires changing an SDK then its probably too much work for something so small. I can probably just add a Civlopedia entry for it.

Additionally is there any page with a step by step guide for making this a modular mod?

phungus420
Jan 02, 2010, 02:41 PM
Generally if it already gets displayed, as is the case with the farm building option you say, it should happen automatically, if the changes you make are in the XML, which is the case here. If not, it may not take SDK work to fix, but probably will. I know at this point I'd be looking in GameTextMgr.cpp regardless to to figure out what's going on. Though the worker action buttons could very well be part of the Python interface, I just don't know. If this were my project I'd probably start a thread on it in the BUG forums, as those guys know alot more about getting values to display in the interface then anyone else, they even know more about it then the firaxis devs at this point.

brandon1965
Jan 04, 2010, 02:38 PM
I have the same question as the original poster. I don't understand enough about modding all the files to make this work but I would like to be able to add commerce to roads and production to railroads. If anyone has successfully done this and could upload the needed files I would greatly appreciate it. Thank you.

Tholish
Jan 04, 2010, 04:45 PM
Here it is in mod form.

brandon1965
Jan 04, 2010, 05:25 PM
Thank you.