Thunderbrd
C2C War Dog
I didn't understand AIAndy's method either but I can say it sounds like an improvement.
That is a pretty good explanation of the basics.I'm not really sure what AIAndy means with a flood fill algorithm, but my guess is something along this line:
Think of it as a height map where many different factors defines the height of a plot, the lower they are the better they are suited for trade.
Flood fill will start filling the low lying plots by incrementing the "water level" by just a little at a time, effectively tallying up the plots in an order that follows a certain rule-set. It may be global process, or it may have a source plot where it only spreads to plots adjacent to those already filled.
When the plot of one city is "submerged" and it's connected by "water" to another city, these cities will be eligible trade partners.
Those cities that connect the earliest in the process makes for the most natural trade route pairs.
Don't take my word on this though, I'm not a programmer, AIAndy will have to confirm or correct my assumptions.
I assume that coast is treated the same as rivers as the trade along them is activated by the same tech, if I remember correctly. Oceans and mountains would not spread trade until you get the respective techs.That is a pretty good explanation of the basics.
The source plots from which the flood starts are all cities and only their "height" is initially determined by some calculation concerning their trade importance. Then that importance is flooded out from the starting points to adjacent plots with easier flooding along roads and rivers so it is somewhat of a trade distance. That is somewhat similar to what realistic culture spread does. If the flood reaches and surrounds another city, then that city is considered trade dominated by the city from which the surrounding flood originated. When two floods meet, then a direct trade connection between the two cities is formed (and the exact plots for the "shortest" connection in terms of trade are also known).
Currently the flooding only stops when the entire map is split up between those spheres of trade influence of each city but I guess it would be easy to cut off the flooding after a maximum trade distance depending on city/tech/something.
Rivers should be at Raft Building, Coast at Sail Making (Name?), Sea at Seafaring, Mountain at Mountaineering and Oceans at Navigation, I think. I don't know if any such techs have been set for the Space Mod terrains.I assume that coast is treated the same as rivers as the trade along them is activated by the same tech, if I remember correctly. Oceans and mountains would not spread trade until you get the respective techs.
I think I based it on the movement cost code so those kind of things are considered.I assume that coast is treated the same as rivers as the trade along them is activated by the same tech, if I remember correctly. Oceans and mountains would not spread trade until you get the respective techs.
This would be an awesome way to establish base default trade routes, then to use units to establish farther, more profitable, hand selected non-default trade routes as discussed.That is a pretty good explanation of the basics.
The source plots from which the flood starts are all cities and only their "height" is initially determined by some calculation concerning their trade importance. Then that importance is flooded out from the starting points to adjacent plots with easier flooding along roads and rivers so it is somewhat of a trade distance. That is somewhat similar to what realistic culture spread does. If the flood reaches and surrounds another city, then that city is considered trade dominated by the city from which the surrounding flood originated. When two floods meet, then a direct trade connection between the two cities is formed (and the exact plots for the "shortest" connection in terms of trade are also known).
Currently the flooding only stops when the entire map is split up between those spheres of trade influence of each city but I guess it would be easy to cut off the flooding after a maximum trade distance depending on city/tech/something.
Fyi to avoid confusion when reading the code, the resulting graph of the algorithm (not the implementation of it) is stored in a Boost Graph, as I intended to use some of the algorithms available in there for further calculations on the trade graph.Using this flood algorithm to handle local Trade Routes? I believe I can, I'll have to take a look at the code first, but even if I can't get it, maybe I can do it from scratch. It seems a good algorithm indeed, a lot more realistic.
Cool... you'll have to help me understand these floods better. I wonder if they can be a useful tool for the ideas project...
That is a pretty good explanation of the basics.
The source plots from which the flood starts are all cities and only their "height" is initially determined by some calculation concerning their trade importance. Then that importance is flooded out from the starting points to adjacent plots with easier flooding along roads and rivers so it is somewhat of a trade distance. That is somewhat similar to what realistic culture spread does. If the flood reaches and surrounds another city, then that city is considered trade dominated by the city from which the surrounding flood originated. When two floods meet, then a direct trade connection between the two cities is formed (and the exact plots for the "shortest" connection in terms of trade are also known).
Currently the flooding only stops when the entire map is split up between those spheres of trade influence of each city but I guess it would be easy to cut off the flooding after a maximum trade distance depending on city/tech/something.
The problem with long range trade routes in Real Life is that they weren't always that profitable. For example, in the 17th century, the Dutch ruled international trade with the largest merchant fleet in the world. However, historical analysis showed that three quarters of profits came from trade with the close by Baltic sea area. The Dutch also shipped exotic goods like spices and Chinaware from the Far East to Europe. However, transporting goods with rickety wooden ships over such distances, through seas filled with storms and pirates, which caused many lost ships, and the need to build and garrison trade posts along the route for replenishment of ships was very expensive, and this ate up a significant part of the profits.
I think the presumption that far routes are more valuable is on the presumption of differing degrees of resource access assumed at more distant locations making for larger profit margins. But this wouldn't always be the case. We could try to simulate that and probably will eventually but for now, maybe too complex.The problem with long range trade routes in Real Life is that they weren't always that profitable. For example, in the 17th century, the Dutch ruled international trade with the largest merchant fleet in the world. However, historical analysis showed that three quarters of profits came from trade with the close by Baltic sea area. The Dutch also shipped exotic goods like spices and Chinaware from the Far East to Europe. However, transporting goods with rickety wooden ships over such distances, through seas filled with storms and pirates, which caused many lost ships, and the need to build and garrison trade posts along the route for replenishment of ships was very expensive, and this ate up a significant part of the profits.
DH and I HAVE been considering volumetric resources. We'll see.I think proper solutions would be extremely complex. I think you would need Volumetric Resources at least, perhaps even spreading properties for various goods simulating how much the regions get saturated with these resources. On these grounds proper prices per unit could be calculated (each turn of course), resulting in gain/trade action.
I am not entirely sure a proper 64bit program could handle that.
DH and I HAVE been considering volumetric resources. We'll see.