rolo: ok, there IS a bug (a minor one).
PieceOfMind: You are right about ice and barb culture blocking trade networks. But the current network links are established via many
land tiles.
I don't think I give away any important spoilerish info by explaining the following:
Resource trades between 2 players require a trade network connection
traderoute
. But a bidirectional connection is not necessary, thus at least 1 of the players must have his capital's plot and the plot of his trading partner's capital in the same plotgroup. Plotgroups consist of adjacent tiles which can be part of a trade network of a player.
The requirements are:
- the plot has a route OR
- is adjacent to a river (Sailing required when outside of own culture) OR
- has trade enabling terrain (Coast and Ocean with the known tech requirements)
Further conditions:
- the plot must not be blocked by impassable things (ice on coast blocks, but peaks are special - they DON'T block river networks)
- the tile must either be revealed OR owned by a non-hostile player (this is the crucial point, that's also why barb culture blocks coastal networks, everybody is always at war with the barbs)
So in the save (410 BC):
Colonel Kurtz hasn't revealed to many tiles of this Pangaea (whereas the other players have), but trade network connections are currently established with ALL other players.
Bidirectional connections:
- Kurtz <--> Ramesses
- Kurtz <--> De Gaulle
Thebes and Paris are in your "home" plotgroup which of course includes Kyoto, and both Ramesses and De Gaulle have Kyoto in their "home" plotgroup.
Unidirectional connections:
you have Rome in your "home" plotgroup, but Augustus hasn't revealed the critical unowned tiles connecting your new Viking acquisitions to your Japanese cities, so he misses Kyoto in his.
- Kurtz <-- Wang Kon
- Kurtz <-- Joao
Both currently have Kyoto in their "home" plotgroup, but your plotgroup doesn't reach that far to include their capitals' plots. Wang Kon has revealed enough of the unowned tiles of your area to have a "stable" network, but Joao's situation is very special and his trade network connection to you gets broken in the IBT due to the bug (it doesn't survive a forced recalculation triggered by deleting and rebuilding a critical road via WB).
However, Joao has Workers finishing a road in a certain tile within his culture (which causes the recalculation and splitting of his old plotgroup -- his "home" plotgroup loses Kyoto), but this road establishes a critical link for
your "home" plotgroup to also include Lisbon, so that a new unidirectional connection is created:
- Kurtz --> Joao
The bug:
The code to test whether two adjacent plots can be part of the same plotgroup is not working in an "isotropic" way, so that depending on the direction plotgroups are either allowed to combine or they get split up. The following 4 plots are critical for Joao's trade network connection:
P1 and P4 are unowned, P2 and P3 are owned (they are within your culture). Joao has revealed P1 and P3 but not P2 and P4. Thus, P4 the unowned and unrevealed plot can never be part of his "home" plotgroup. P1 the unowned but revealed plot is the critical link. The code
CvPlot::isTradeNetworkConnected(const CvPlot* pPlot, TeamTypes eTeam) includes this section which says that if a plot is unowned both plots must be revealed in order to become part of the same plotgroup:
Code:
[SIZE="3"]if (!isOwned())
{
if (!isRevealed(eTeam, false) || !(pPlot->isRevealed(eTeam, false)))
{
return false;
}
}[/SIZE]
Therefore the test "is P2 connected to P1?" fails since P1 is unowned and P2 is unrevealed. But the test "is P1 connected to P2?" succeeds since P2 is owned so that it's enough that only P1 is revealed.
In the save Joao's current plotgroup must have got calculated using the direction P2-->P1, but any recalculation will use P1-->P2 (I don't know why) and thus split the old common plotgroup in two new separate plotgroups; the connection is lost...
This is a very special and rather rare situation for this bug to show an effect plus the connections will "heal" over time by new routes being built and expanding culture, but it is irritating and I think it can be fixed by changing the above code lines in order to achieve isotropy/bidirectionality. (Include in an unofficial patch? - I'm afraid Dresden is suffering from "Solver Syndrom"
).
Code:
[SIZE="3"]if ( (!isOwned() && !isRevealed(eTeam, false)) || (!(pPlot->isOwned()) && !(pPlot->isRevealed(eTeam, false))) )
{
return false;
}[/SIZE]
You are right rolo, the barbs are always last to play during an IBT, so AI-barb interaction in a single IBT couldn't explain the phenomenon completely. Also, a barb Galley would need to perform the blockade mission which is only implemented in the Better-AI code. The Galley merely sitting on a coastal tile will have no effect on the trade network.
Difference between trade network for resource trades and trade routes for cities:
As mentioned above resource trades require the capitals' plots to be in a common plotgroup of 1 or both of the 2 potential trading partners (it won't work if both plots are in the "home" plotgroup of a third player), whereas the prerequisite for city B to show up as a trade route in city A's city screen is that the owner of city A has city B's plot in the one plotgroup of his which also includes the plot of city A (this does not have to be his "home" plotgroup which includes his capital's plot). If you cancel Open Borders with everybody but Joao, Braga will be the only Portugese city available for a trade route in 410 BC. But after 2 turns (Joao builds road and you need to update your trade routes) all of Joao's cities will be available.