Buildings "wander" north away from roads #7604
Buildings "wander" away from roads in the negative x and negative y directions. As suggested by Eddi|zuHause on irc, this seems to happen when a lot larger than 1x1 is replace by a 1x1 lot, then that in turn is replaced by a larger lot again. When the 1x1 lot replaces a larger lot, it always goes in the top corner (-x, -y dir), which means buildings can slowly move north over time. This process seems to take maybe 6-10 in-game years. See attached pictures.
Version of OpenTTD
Buildings should be built adjacent to roads.
Buildings are able to move away from roads when they are replaced
Steps to reproduce
Build a city. Make some busses so it'll grow. Make sure "towns are allowed to build roads" is off. Fast forward, over time this will begin to happen.
The text was updated successfully, but these errors were encountered:
Would it be convenient to have a house and industry check 'at least one tile of a house/industry layout is adjacent to road'?
This could be used by the house placement algorithm, and exposed as a newgrf house/industry var.
It is possible for newgrf industry to check for adjacent road currently, but it's fiddly to do.
The code to replace houses is lovely naive:
So yeah, there is a good chance this happens :D It also means it doesn't really wander off, as in, it doesn't continue to happen, I think. At most, with non-grid layouts, a house can be 2 tiles away from a road :)
…hen rebuilding When a multi-tile house is rebuild, it always used the most northern tile to build the new house. This can very easily lead to houses wandering off in the north-ish direction (either NW or NE). To prevent this, pick the tile closest to town center when rebuilding on a multi-tile house. This still means a house can be build away from a road, but it is no longer wandering around finding another town to call home.