You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating a map with the good ol' original terrain generator and using better_roads town layout this (as shown in the below screen-shot) happens.
If the mechanism for generation would only be set to not build roads next to each other but with one to three squares apart, that would be just lovely.
The same thing also sometimes happens during the progress of the game where better_roads leads to road next to road on the hills.
There was an interesting function in the trunk back in the day (rel. 0.6.3) - I don't know if it is still present but it could perhaps be used to
prevent the town mechanism to build roads too near each other. Here's that function:
/**
* Check if a neighboring tile has a road
*
* @param tile curent tile
* @param dir target direction
* @param dist_multi distance multiplier
* @return true if one of the neighboring tiles at the
* given distance is a road tile else false
*/
static bool IsNeighborRoadTile(TileIndex tile, const DiagDirection dir, uint dist_multi)
{
/* Lookup table for the used diff values */
const TileIndexDiff tid_lt[3] = {
TileOffsByDiagDir(ChangeDiagDir(dir, DIAGDIRDIFF_90RIGHT)),
TileOffsByDiagDir(ChangeDiagDir(dir, DIAGDIRDIFF_90LEFT)),
TileOffsByDiagDir(ReverseDiagDir(dir)),
};
/* We add 1 to the distance because we want to get 1 for
the min distance multiplier and not 0.
Therefore we start at 4. The 4 is used because
there are 4 tiles per distance step to check. /
dist_multi = (dist_multi + 1) * 4;
for (uint pos = 4; pos < dist_multi; pos++) {
TileIndexDiff cur = 0;
/ For each even value of pos add the right TileIndexDiff
for each uneven value the left TileIndexDiff
for each with 2nd bit set (2,3,6,7,..) add the reversed TileIndexDiff */
cur += tid_lt[(pos & 1) ? 0 : 1];
if (pos & 2) cur += tid_lt[2];
cur = (uint)(pos / 4) * cur; // Multiply for the fitting distance
if (GetBuiltRoadBits(TILE_ADD(tile, cur)) & DiagDirToRoadBits((pos & 2) ? dir : ReverseDiagDir(dir))) return true;
}
return false;
}
Can you add the savegame so we can actually reproduce OpenTTD doing that and thus fix the issue; I've generated a dozen maps with the original map generator and haven't seen any case of that.
SirkoZ opened the ticket and wrote:
Attachments
Reported version: trunk
Operating system: Windows
This issue was imported from FlySpray: https://bugs.openttd.org/task/3332
The text was updated successfully, but these errors were encountered: