Thread Tools
Old May 30, 2003, 13:42   #1
Zenon
Warlord
 
Local Time: 03:42
Local Date: November 2, 2010
Join Date: Mar 2003
Posts: 147
Trade Roads – Determination of the Bonus Road and Railroad Connection
It is well known that a qualified trade road adds to the trade bonuses, both to the permanent trade bonuses (source to destination trade road) and to the delivery bonus (destination to source city). The source to destination trade roads are the most valuable especially when connecting a SSC.
It is also well known that a (bonus) trade route connection can be determined by sending a unit that disregards terrain (one move unit or explorer) with the go to order to the destination city and back. The best way usually is to send a settler building the road on the way. This does not work if there are already other road connections on the way. The unit takes the fastest way, the trade road does not. It would also be helpful to know in advance if the trade road has to be build on easy or on difficult terrain or if it crosses a river field that needs bridge building. An explorer not only needs resources to build but also needs seafaring. To determine a trade road from an AI city to your source city you also have to know at which field the trade road leaves the AI city.
Searching for advice I found only a few known facts like a direct diagonal path between two cities giving a qualified trade route. Therefore I did a little research to find out how these traderoutes could be known. This is what I found:

I. General Rule

The following rules always describe the trade road from the source city to the destination city, which gives the additional permanent trade route bonus. To determine the way back which triggers the delivery bonus, just exchange source city and destination city and repeat the rules.

1. Shortest Way

The trade route is always on the shortest way (measured in steps without regard of terrain). If there is only one shortest way (e.g. two cities on opposite sides of a bay) this is the trade route.


2. Direct Paths (step 2)

If there is a

- direct diagonal path
- direct straight (nondiagonal) path from South West to North East

from the source city to the destination city this is the trade route.

3. One crossroad (step 3)

If step one and step two do not give a trade route a crossroad point is needed. It is helpful to remind that trade roads in these cases usually go clockwise around a fictitious center point between the two cities. This is not a general rule, though, as there are exceptions.

The possible (destination city) Crossroad Points are on a diagonal path leading out of the destination city. This destination diagonal is determined by the diagonal field adjacent to the destination city that is next (measured in steps) to the source city.

If there are two possible diagonals it is – seen from the destination city – the one determined by the first crossroad point on the righthand side. Exception: if a direct path from South West to North East from the Source city or from the source city diagonal to the other possible crossrad points (on the „left“ diagonal) is possible it is the left point that determines the destination diagonal.

The crossroad points are only at uneven numbers on the diagonal seen from the destination city (1,3,5,...)

The source city diagonal leaves the source city on the diagonal field that is next to the destination city. If there are two possibilities it is – seen from the source city – the one on the left side.

3.1 regular connection (no SouthWest to North East path possible)

3.1.1 If there is a direct straight (non diagonal) path from the source city to one of the destination city crossroad points and this crossrad point is left of the source city diagonal (seen from the source city) the trade route is determined by connecting the source city with this crossroad point and the destination city.
3.1.2 If there is a source city diagonal that leads to the first diagonal crossroad point of the destination city this determines the trade route
3.1.3 if 3.1.1 and 3.1.2 don´t give a trade route a possible secondary crossroad point has to be checked: it is the nondiagonal field adjacent to the destination city, that is next to the source city. If there is a source city diagonal that leads to a non diagonal field adjacent to the destination city and the destination city is right of the diagonal (seen from the source city) a one crossroad trade route connection can be established.

3.2 Irregular path (Southwest to Northwest connection possible)

3.2.1 If there is a direct straight path from the source city to one of the destination city crossroad points (on a „left“ diagonal) the trade route is determined by connecting the source city with this crossroad point and the destination city.
3.2.2 3.1.2 does not apply if any (even a two crossroad) South West/North East connection is available.
3.2.3 3.1.3 does not apply if any (even a two crossroad) South West/North East connection is available.

4. Two Crossroads (step 4)

If neither step 1 nor step 2 nor step 3 leads to a traderoute a second crossroad point has to be determined. This second crossroad point is on the source city diagonal.

It is determined by the shortest way (measured in steps on the source city diagonal) from the source city to a direct nondiagonal path that leads to a crossroad point of the destination city.


II. Obstacles

If the trade route according to the general rule is permanently not available (e.g. there are ocean fields on the way) there are the following rules:

1. Determination Point or crossroad point not available

If a determination or a crossroad point is not available (e.g. the one determining the destination city diagonal) it does not affect the General Rule. In a first step the trade road is calculated as if it was available.

2. Obstacles on the trade route

If there is an obstacle the trade route is regular until it reaches the obstacle. From there the next step goes
- to the field (measured in steps) next to the destination city
or if there is still a choice
- to the field that is next measured in trading distance
or if there is still a choice
- to the field on the left seen in direction to the destination city, unless there is a field to Northeast available. If a direct Southwest to Northeast route is blocked the righthand field is chosen.

From this point a new trade route to the destination city is determined according to the General Rule.

If there is - again - an obstacle on the (newly determined) trade route this set of rules is repeated.

I am not completely happy with this set of rules. I always thought that there should be an easier way to describe the trade route paths. But it seems that the creators of civ tried to cover the rules like in many other cases concerning trade. I can´t see a reason why something like a Northeast preference should be programmed.

However, they seem to work in the cases I found so far. It helps to keep the preferences in mind:
- shortest way
- Southwest to Northeast preference
- the trade routes usually go clockwise around a (fictitious) center point between the two cities.

I´ll try to add some examples in my next post.

Any comments are welcome.

Zenon
Zenon is offline  
Old May 30, 2003, 15:26   #2
rah
lifer
Apolytoners Hall of FameCivilization IV: Multiplayer
Just another peon
 
rah's Avatar
 
Local Time: 21:42
Local Date: November 1, 2010
Join Date: Nov 1999
Location: who killed Poly
Posts: 22,919
Wasn't there a diagram posted awhile back that showed all possible "non obstructed" paths?
__________________
The OT at APOLYTON is like watching the Special Olympics. Certain people try so hard to debate despite their handicaps.
rah is offline  
Old May 30, 2003, 15:42   #3
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 04:42
Local Date: November 2, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
Zenon, I did a similar tests during my ELG #2 two weeks ago, but I wanted to express my results later. You forced me to post them now.

I will post a detailed post tomorrow, but a quick question now. Do points 2. - 4. correspond to Civ 2.42 Pathways Version 1.0 picture (see 'Caravans' section in GL index #2)?
I tested the picture also with MGE and it works perfectly.

Edit: I think rah means the same picture. But the picture don't solve obstructions (=water).
__________________
Civ2 "Great Library Index": direct download, Apolyton attachment
SlowThinker is offline  
Old May 30, 2003, 16:57   #4
War4ever
Civilization II MultiplayerCivilization III MultiplayerCivilization II Democracy GameApolytoners Hall of Fame
Emperor
 
War4ever's Avatar
 
Local Time: 18:42
Local Date: November 1, 2010
Join Date: Dec 1969
Location: I live amongst the Red Sox Nation
Posts: 7,969
YES, that was posted by markus f....the diagram anyways...awhile back....but its not always correct either
__________________
Boston Red Sox are 2004 World Series Champions!
War4ever is offline  
Old May 30, 2003, 20:37   #5
Zenon
Warlord
 
Local Time: 03:42
Local Date: November 2, 2010
Join Date: Mar 2003
Posts: 147
ST, I have done a comparison with this diagram and haven´t found any differences so far. If I had known this thread I certainly could have saved some time on my research. On the other hand it was fun to solve this puzzle.
The diagram is better than any examples I could give. So I try to attach Quantum Satis work in this thread, too.

Zenon
Attached Thumbnails:
Click image for larger version

Name:	diagram.bmp
Views:	38
Size:	181.1 KB
ID:	46576  
Zenon is offline  
Old May 31, 2003, 07:34   #6
DrSpike
Civilization IV: MultiplayerApolyton University
Deity
 
DrSpike's Avatar
 
Local Time: 03:42
Local Date: November 2, 2010
Join Date: Sep 2001
Location: Enthusiastic member of Apolyton
Posts: 30,342
I have that diagram.........it's very useful and mostly correct.
DrSpike is offline  
Old May 31, 2003, 15:31   #7
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 04:42
Local Date: November 2, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
War, DrSpike, can you post examples in which the diagram is not correct?
__________________
Civ2 "Great Library Index": direct download, Apolyton attachment
SlowThinker is offline  
Old May 31, 2003, 17:25   #8
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 04:42
Local Date: November 2, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
General algorithm (bug-free situations)
So I post my version of the goto algorothm. I'm not sure about everything, since only quick tests were done.

I will use the word Path in place of trade route, because Paths are important not only for caravan deliveries, but also for blocking barbs for example (see my post in partisan barbarians won't attack your partisans ).

First of all, I want to add rule 0. It looks it is self-evident but it is good to express it:

There is always just one Path from point A to point B.
If Path goes from A through B to C, then Path from B to C is the corresponding sub-Path. In other words, in order to understand the complete Paths between any pair of points A and B on a given map you need to know only the 'direction' from A to B (for any pair of points A and B), i.e. only one step from square A to B. Then if you want to know the whole Path between A and B you can construct it step by step.


Now we can suppose we have a general situation - point A is the starting point and B is the destination, and there may be obstructions on the map. Point A has 8 neighbours and the question is: which one represents the direction to B?

Step 1
Say the distance (the 'movement' distance - i.e. number of steps of a Warrior) from A to B is Dist. Candidates for the directon are all neighbours with distance to B equal to Dist-1. If there is only one such a neighbour then this one represents the direction.

(This is equal to Zenon's point '1. Shortest Way'. But I claim this is valid also for a map with obstacles (see paragraph 'Obstacles' at end of this post: I tested Ocean only). So I disagree with Zenon's sentence:
2. Obstacles on the trade route: If there is an obstacle the trade route is regular until it reaches the obstacle. )

Step 2
Otherwise (i.e. if there is more than 1 shortest direction) the direction is chosen in accordance with the Civ2 Pathways diagram.
If this square is obstructed a 'secondary' direction is chosen. 'Secondary directions' are defined firmly for each square - you can imagine there is a diagram of 'Civ2 Secondary directions' - analogous to the Civ2 Pathways diagram.
If secondary direction is obstructed then a tertiary direction is chosen (again you can imagine there is a diagram of 'Civ2 Tertiary directions') and so on.

(This step was not tested thorougly.
I didn't have time to be able to compare Step 2 with Zenon's paragraph 2.Obstacles on the trade route and to test differences)


Obstructions:
A square with an obstruction can be Ocean or enemy unit or enemy ZOC (any other?). I tested Ocean only: Civ2 counts with Ocean in advance, i.e. Civ2 chooses a shortest way with respect to Ocean squares. I have a feeling that enemy units are taken in advance also, but enemy ZOCs are ignored until they are reached by the unit. Can you confirm if this is true?
A note: I suppose enemy units don't destroy a Path (and a trade route with bonus) completely but they only redirect it. Is this true? It could be exploited: to block an AI unit on a specific square...

Last edited by SlowThinker; May 31, 2003 at 17:34.
SlowThinker is offline  
Old May 31, 2003, 17:34   #9
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 04:42
Local Date: November 2, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
Bugs
The Paths don't always correspond to the algorithm in my last post. There are some bugs in the behavior of Civ2:

1. Civ2 remembers previous maps. If you reload a different map the Civ2 still 'thinks' about an old one:
Load the nolake.sav, GoTo Rome (5 steps are enough). Then load lake.sav and GoTo Rome again: The Warior will move as would be moving on a map without the lake.
Now quit Civ2 completely, run Civ2.exe again, GoTo with lake.sav first then GoTo with nolake.sav.

2. Civ2 remembers previous movements and adapt present movement to them.
(I wasn't able to repeat the test. I need more time or I was wrong.)

Warning: Also trade route are affected temporarily by these bugs.
Attached Files:
File Type: zip goto-lakes.zip (3.6 KB, 3 views)
SlowThinker is offline  
Old June 1, 2003, 20:22   #10
solo
Apolytoners Hall of Fame
King
 
Local Time: 02:42
Local Date: November 2, 2010
Join Date: Jan 2001
Location: Lowell, MA USA
Posts: 1,703
I have noticed that the presence of rivers can alter routes from the more direct paths that might normally be followed. For example, the route can move diagonally to a river, follow it a way, and then move on a diagonal back towards the other city.

From a practical viewpoint, the idea of using "station" cities, located just outside cities for which establishing the route bonuses are important, ends up being more useful in actual games. Besides simplifying and speeding up the setup of the route bonuses, station cities located close to the Source can serve multiple Destinations, too.
solo is offline  
Old June 2, 2003, 07:28   #11
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 04:42
Local Date: November 2, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
Solo,
"station" cities are good, but it would be very useful to know the exact GoTo algorithm so that you needn't to waste warriors that trace routes in early stages of the game.
Don't you have an example of a river rerouting a route?

Zenon,
I start to think that your article 'II. Obstacles' is affected by Bug nr. 1, wasnt'it?
__________________
Civ2 "Great Library Index": direct download, Apolyton attachment
SlowThinker is offline  
Old June 2, 2003, 08:26   #12
solo
Apolytoners Hall of Fame
King
 
Local Time: 02:42
Local Date: November 2, 2010
Join Date: Jan 2001
Location: Lowell, MA USA
Posts: 1,703
ST,

Okay, here is an example. Most of the Atlanta to Rome route is along the river. Here the river is parallel to the normal path, so is not hard to figure, but when a river meanders, it can get more complicated. You may have to research many possibilities involving rivers for the complete answer to the routing algorithm.
Attached Files:
File Type: sav ab_a440.sav (71.6 KB, 5 views)
solo is offline  
Old June 2, 2003, 08:40   #13
DrSpike
Civilization IV: MultiplayerApolyton University
Deity
 
DrSpike's Avatar
 
Local Time: 03:42
Local Date: November 2, 2010
Join Date: Sep 2001
Location: Enthusiastic member of Apolyton
Posts: 30,342
It will be difficult to make the right road a science for every situation.........from a practical gameplay point of view you just use the diagram or warriors and learn how to use stations when it is practical.

Probably part of the problem is due to the bugs you discussed..........perhaps the diagram is correct for non-obstructed paths without bugs.

The path with obstructions is pretty much anyone's guess; creating rules for these cases would be tricky, (though there are some tentative ones in old threads IIRC) so that's where warriors come in.
DrSpike is offline  
Old June 2, 2003, 09:19   #14
rah
lifer
Apolytoners Hall of FameCivilization IV: Multiplayer
Just another peon
 
rah's Avatar
 
Local Time: 21:42
Local Date: November 1, 2010
Join Date: Nov 1999
Location: who killed Poly
Posts: 22,919
Why use warrriors, just use the goto command on the settlers building the roads. They move a square then clear the goto command.
__________________
The OT at APOLYTON is like watching the Special Olympics. Certain people try so hard to debate despite their handicaps.
rah is offline  
Old June 2, 2003, 09:32   #15
DrSpike
Civilization IV: MultiplayerApolyton University
Deity
 
DrSpike's Avatar
 
Local Time: 03:42
Local Date: November 2, 2010
Join Date: Sep 2001
Location: Enthusiastic member of Apolyton
Posts: 30,342
Sure do that too. If I have a few turns spare with a policing warrior I use them..........'s funny really, who would have thought the buggy goto command would be useful?
DrSpike is offline  
Old June 2, 2003, 13:43   #16
rah
lifer
Apolytoners Hall of FameCivilization IV: Multiplayer
Just another peon
 
rah's Avatar
 
Local Time: 21:42
Local Date: November 1, 2010
Join Date: Nov 1999
Location: who killed Poly
Posts: 22,919
Why bother using a warrior to go along, the settler defends better.
__________________
The OT at APOLYTON is like watching the Special Olympics. Certain people try so hard to debate despite their handicaps.
rah is offline  
Old June 2, 2003, 13:57   #17
DrSpike
Civilization IV: MultiplayerApolyton University
Deity
 
DrSpike's Avatar
 
Local Time: 03:42
Local Date: November 2, 2010
Join Date: Sep 2001
Location: Enthusiastic member of Apolyton
Posts: 30,342
I didn't say use the warrior to go along. I said use any free turns you may have with a warrior. It costs you very little, since you will build the warrior anyway, and helps me plan early on.

There are many viable approaches.
DrSpike is offline  
Old June 2, 2003, 16:08   #18
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 04:42
Local Date: November 2, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
Quote:
Originally posted by rah
Why use warrriors, just use the goto command on the settlers building the roads. They move a square then clear the goto command.
The problem is that you usually waste one settler in the very early stage of the game. Trade routes go often trough squares where you woudn't build roads normally.
Frequently it is better to use a warrior and to build the route later when time of a settler will have a lesser value.
__________________
Civ2 "Great Library Index": direct download, Apolyton attachment
SlowThinker is offline  
Old June 2, 2003, 17:24   #19
rah
lifer
Apolytoners Hall of FameCivilization IV: Multiplayer
Just another peon
 
rah's Avatar
 
Local Time: 21:42
Local Date: November 1, 2010
Join Date: Nov 1999
Location: who killed Poly
Posts: 22,919
Hmmm, the settler has to build the road. So I don't see the difference. Goto the path when your settlers are ready to build the road. The road building settlers are usualy from my core group of cities built right before the caravans can be produced, so they start in the right locations. My outlaying cities build the settlers that will fuel further expansion. When the core group of settlers is done roading, they either improve a few choice squares for hidden specials or improving defensive terrain, and by then the boats are ready to move them out quickly to what's left of the frontier.
__________________
The OT at APOLYTON is like watching the Special Olympics. Certain people try so hard to debate despite their handicaps.
rah is offline  
Old June 2, 2003, 17:43   #20
Zenon
Warlord
 
Local Time: 03:42
Local Date: November 2, 2010
Join Date: Mar 2003
Posts: 147
Solo,

according to my tests rivers do not change the effective trade routes, they just change the go to order for units that follow the fastest way. I have looked into your example. The Atlanta Rome railroad follows the regular path (just the last field next to Rome is ocean, therefore it goes to the field next to Rome). But I found a good example in a New York Washington trade route I created. A quick test says it´s regular, too, but it is not the same path a one move unit would follow. I am not completely sure but so far I haven´t found an example were rivers would alter effective trade routes.

ST,

this is an interesting observation. I remember that in a self made scenario I played I got a settler on grassland an a city on a mountain. I thought that this was due to terrain changes and the program "remembered" the former terrain. When I find time I will find out if this bug affected my tests.

Zenon
Zenon is offline  
Old June 2, 2003, 18:22   #21
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 04:42
Local Date: November 2, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
Quote:
Originally posted by rah
The road building settlers are usualy from my core group of cities built right before the caravans can be produced
I wanted to say that you usually want a road connection between cities very soon - sooner than you will produce caravans. But these early roads will go by Grassland preferentially; but once that you build them, the goto command will follow these roads and you won't be able find out the correct trade route by a goto command. So it is good to use the goto command on warriors before the early routes are built.
__________________
Civ2 "Great Library Index": direct download, Apolyton attachment
SlowThinker is offline  
Old June 3, 2003, 13:19   #22
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 04:42
Local Date: November 2, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
I can't test the effect of rivers now but I attach a tool that clears all rivers from a .sav file.
Attached Files:
File Type: zip civ2clearrivers.zip (165.3 KB, 4 views)
SlowThinker is offline  
Old June 4, 2003, 23:52   #23
Straybow
Civilization II Succession GamesSpanish CiversPtWDG2 TabemonoAlpha Centauri Democracy GameNationStatesGalCiv Apolyton EmpireTrade Wars / BlackNova TradersCivilization II Democracy Game
Emperor
 
Straybow's Avatar
 
Local Time: 19:42
Local Date: November 1, 2010
Join Date: Dec 1969
Location: LF & SG(2)... still here in our hearts
Posts: 6,230
Use Explorers, dude!
That's why I've always tested paths by cheating Explorers into place, sometimes I even substitute a rules.txt with Explorer movement bumped way up.

PS, here's a version that shows up:
Attached Thumbnails:
Click image for larger version

Name:	pathdiagram.png
Views:	94
Size:	8.1 KB
ID:	46999  
__________________
(\__/) Save a bunny, eat more Smurf!
(='.'=) Sponsored by the National Smurfmeat Council
(")_(") Smurf, the original blue meat! © 1999, patent pending, ® and ™ (except that "Smurf" bit)
Straybow is offline  
Old June 5, 2003, 00:02   #24
Straybow
Civilization II Succession GamesSpanish CiversPtWDG2 TabemonoAlpha Centauri Democracy GameNationStatesGalCiv Apolyton EmpireTrade Wars / BlackNova TradersCivilization II Democracy Game
Emperor
 
Straybow's Avatar
 
Local Time: 19:42
Local Date: November 1, 2010
Join Date: Dec 1969
Location: LF & SG(2)... still here in our hearts
Posts: 6,230
Path Problems
Using Explorers may not be perfect. There was a challenge game of some sort about a year ago. Over time I got three different Avalon-Tenochtitlan paths using Explorers.
Attached Thumbnails:
Click image for larger version

Name:	gotoodd.png
Views:	94
Size:	48.8 KB
ID:	47000  
__________________
(\__/) Save a bunny, eat more Smurf!
(='.'=) Sponsored by the National Smurfmeat Council
(")_(") Smurf, the original blue meat! © 1999, patent pending, ® and ™ (except that "Smurf" bit)
Straybow is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 22:42.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team