More Trade Routes

I didn't add a lot to the SDK. Just the code needed to make the new victory condition check for you or your team's total gold. The part on parsing XML I learned from reading the tutorial here on these forums. The rest was just finding where the game checks for victory conditions and exposing the functions to python, which is done by just following other victory conditions and adding similar codes.

Anyway, if you're really interested, the attachment is a zip of the files that I modified. The parts that contains my codes start with // CA edit
 

Attachments

Still around, trying to milk all ideas involved with trade routes. new zip coming soon.

Just finished with a worker improvement called port. Only buildable on coastal land, it allows trade networks to connect from coast to land, assuming you have Sailing tech which allows your civ to trade on coast. The advantage is that you don't have to build another city to act as a port city. It can be worked and gives +1 commerce (and +1 more if you know Astronomy.) Also using TheLopez Improvement outside borders, these are buildable outside your borders.

The only problem is how it looks on map. Anyone know how to manipulate structures on the map? Like how watermill orients itself with rivers.

Each trade route also grants +1 gold, +1 research, and +1 culture. Encourages building roads to new cities and building early wonders like Silk Road and Caravanserai. Values can be changed in XML. eg make it 0/0/2 for easy culture, or 0/0/0 to turn it off.

Next thing I'll work on is improving airport building. Two cities with airports should count as connected regardless of other physical factors: no roads, no port cities on different or same continents or islands. maybe no visibility too? Depending on how it's done, could make it possible to create Impaler's wonder that connects all cities.

Somewhere down the line, maybe more diplomatic options.
 
Encountered an error with the hof.
The game hangs for a while or chrashes, if I have a look at the hof.
 
I just finished up coding that (cross your fingers for testing)

Its done by setting a new Boolean in CvCity, then in the CvCity::isConnectedtoCity function the City checks if its own boolean is set && if the area (continent) of the argument city matches its own and returns true if they do, else it continues on to the normal comparison.

An AirPort connection might work in a similar way, perhaps just piggybacking on the AirLift ability of the AirPort which is unique to it (and logical too AirLift = ability to move stuff = trade connection). I belive the City has a "Max Airlift" datamember so you wouldn't need to loop through all the buildings in the city (which will keep the speed high). The check just needs to confirg that both cities have airlifting. To be honest I cant think of many situations ware you would see any benifit though, their need to be better means of cutting a Cities Trade Connections with blockading navel units and land units, THEN the airport connection could be crutial (think Berlin Airlift).

Do you mind if I use your SilkRoad Art assets in my New Wonders mod pack? It will include several new Wonders with effects created by new Code I've added combined with some of the nicest new Buildings art.

P.S. I belive orientation of Improvments might be done on the LPlotSystem.xml files but its just a guess.
 
As the game progresses, trade routes can become a good source of extra food, hammers, and commerce. When the enemy starts pillaging all your roads, farms, and mines, airports with the ability to resume trade can significantly help to keep the city up and running. This ability doesn't warrant a new building, though, and tacking it onto an airport makes sense. Also, if you build a new city on another continent and it doesn't have access to the coast, then buying an airport can make the city grow very fast (due to extra food and hammers from lots of trade routes.)

Then, the World Wonder could just give all cities an airport.

The art for Silk Road is from Wikipedia, so I guess it's fine if others want to borrow it.

PlotLSystem.XML seems complicated. I hope it works, but it's too many variables and attributes to traverse. Strangely, I can't find anything on watermills or riversidemakesvalid that has to do with orienting the structure. (I've searched in XML, Python and SDK.)

On to more ideas, it could be fun to fight over trade routes, or at least hurt your opponents'. What if there are new invisible units called robbers and pirates that steal from your opponents' trade routes, if they stand outside or stay on a ship outside an enemy city. On the flip side, there are new patrols and coast guard units that can see these invisible units and fight them.

Also, what if you could accumulate food and hammers like you do with gold. You can put extra food and hammers into a national treasury when you tell a city to stop growth or stop production. Use the food to help another city grow faster, and use the hammers to finish any production. These could be enabled through tech or civics. Perhaps you can trade them with other civs, just like gold or gold per turn. Not only that, convert from one type to another: gold for food or hammers, food for gold or hammers, and hammers for gold or food.
 
New version is up

Summary of changes:
7. New world wonder.
11. Bonus gold, research, and culture for each trade route
13. Improvements outside borders by TheLopez.
14. New worker improvement to connect to trade network.
15. New processes put yields into treasury.
16. Cities can borrow food and hammers from treasury.
17. Interface improvements.

see first post for some screen shots
 
I was thinking of an Airport in every City wonder as well, was going to be called "Boeing Corporation" in the style of Corporations as wonders in Sevo-Mod. Interesting inclusion of a Food and Hammer pool, I bet this will REALY change the game dynamics. I'll see if I can get that Silk wonder code working (It should work but for some silly reason it dosn't), I've been all distracted with code for other wonders latley, perhaps I can just modify your AirPort code to do it.
 
Boeing is good choice. I was going to call the wonder Area 51 because the engineers there eventually (will finally?) perfect V/STOL using alien technology. Imagine thousands of flying saucers zooming across the skies. :D

the airport just adds a criterion during updateTradeRoutes since it doesn't call isConnectedTo. so changing isConnectedTo doesn't do what you think it does.

i tried to use isConnectTo to share resources on different cities but it didn't work until their borders expanded and merged. so ultimately, i figured it's all up to plotGroups: connect the plot groups between two airports, regardless of their location, borders or impassability. this could also work for improvements or features. i knew this when i started two weeks ago, but didn't put enough effort to see how to connect plotgroups.
 
From another thread:
Port is an improvement that be built inside and outside your borders, but only on coastal tiles. It connects your ocean-based trade with your land-based trade (don't forget to build a road on top of the port). Also, provides +1 commerce if worked on, and +1 more if you know Astronomy. Can be built on desert tiles, too. (by default, nothing can be built on deserts.) I still need to work on placing the graphics by the water.

I'm done with Airbase improvement. It acts just like Airport for the city, allowing airlifts and connecting to trade network. They can't be built adjacent to another airbase. +1 commerce, can build on any land tile inside or outside your borders, +50% tile defense, 35% air bomb defense

check for mod version 2.1
 
2.2
added XML load component to read partial files.
removed original (base) CIV4 files for units, buildings, techs, improvements, builds, traits, leaderheads, civilizations.
added partial files to replace base items (eg worker, forge, granary, etc.)
added AI to use food and hammers.
added tech modern engineering (allows world trade center, high rise, engineer).
added buildings river port, world trade center (national wonder).
added new unit engineer (upgrade from worker and fast worker).
added improvement high rise.
 
I really like the changes that you have done, some of the idea's in here are wonderful.
 
Man, really creative your mod, the commercial victory seems really nice, I believe its really hard to archieve it in normal CIV, but with your changes its prob a bitt easier :) This could be a really nice addon for other modders I believe :)
 
I know I sound like a noob. I usually don't download Mods. But this time I liked your idea so much I had to. I've got a few questions for you

1. Does it work for Warlords?
2. How to play it?
3. In what folder should I put the "TradeRoutes2_2.zip" file? Should I unzip it or what?

Thanks ;) Really like your idea
 
Back
Top Bottom