3x3 layout center gap

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
User avatar
Dada
Engineer
Engineer
Posts: 40
Joined: 02 Apr 2010 13:01
Location: Rotterdam, The Netherlands

3x3 layout center gap

Post by Dada »

Hi there, was hoping if anyone could help me find a solution here.
Usually I play using the 3x3 town layout, but one of its drawbacks is that you tend to get a "gap" in the middle of each block. Especially in suburbs.
I realize that this is because there simply aren't that many 2x2 houses available that could fill the gap (mostly in the city), but still I'm wondering if there's something that can be done about it.

Couldn't find anything by searching, although I did find a patch that allows you to place houses manually. I'd much prefer to play on the mainline branch though.

In a poll about which layout people prefer, someone mentioned there's a workaround of some sort, but I haven't been able to find more info.

Maybe there's some newgrfs that have more 2x2 houses that will fill up the blocks more completely?
Thanks for any suggestions :)
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: 3x3 layout center gap

Post by kamnet »

You can try some other house set NewGRFs to see if there are more, I can't say for certain.

Typically I don't worry about it, because I use the empty space to throw in a non-track station tile so I can abuse the station spread setting. :) Or, I just plant nice object tiles there and create little parks and green spaces.
User avatar
YNM
Tycoon
Tycoon
Posts: 3570
Joined: 22 Mar 2012 11:10
Location: West Java

Re: 3x3 layout center gap

Post by YNM »

Total Town Replacement Set is fairly good.
YNM = yoursNotMine - Don't get it ?
「ヨーッスノットマイン」もと申します。
_dp_
Transport Coordinator
Transport Coordinator
Posts: 277
Joined: 18 Dec 2013 12:32

Re: 3x3 layout center gap

Post by _dp_ »

Town fills that gap if it is allowed to build roads and was initially generated with 3x3 or better roads layout. In that case it builds houses that aren't directly adjacent to the road (that's the code Eddi mentioned).
If you disable town roads there is no good solution here, just use another layout. In theory houses NewGRF can help but only if it's specifically made to address this problem. With something like lots of 2x2 houses and a single 1x1. I don't think there is anything like that currently and generic house sets won't help much here.
User avatar
Dada
Engineer
Engineer
Posts: 40
Joined: 02 Apr 2010 13:01
Location: Rotterdam, The Netherlands

Re: 3x3 layout center gap

Post by Dada »

kamnet wrote:Typically I don't worry about it, because I use the empty space to throw in a non-track station tile so I can abuse the station spread setting. :) Or, I just plant nice object tiles there and create little parks and green spaces.
Those object tiles sound nice, do you use a specific newgrf for that? Would like to have a look :)

Also, thanks for letting me know that disallowing road building is actually what causes this. I prefer to play this way but maybe if I turn road building on and set the town growth rate lower it'll be OK. Will give that a try as well.
edit: hm, I wonder if buying/reserving the empty tile next to the last road tile would prevent new roads from being made altogether, since with 3x3 I know where they will be built.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: 3x3 layout center gap

Post by planetmaker »

Dada wrote:
kamnet wrote:Typically I don't worry about it, because I use the empty space to throw in a non-track station tile so I can abuse the station spread setting. :) Or, I just plant nice object tiles there and create little parks and green spaces.
Those object tiles sound nice, do you use a specific newgrf for that? Would like to have a look :)

Also, thanks for letting me know that disallowing road building is actually what causes this. I prefer to play this way but maybe if I turn road building on and set the town growth rate lower it'll be OK. Will give that a try as well.
edit: hm, I wonder if buying/reserving the empty tile next to the last road tile would prevent new roads from being made altogether, since with 3x3 I know where they will be built.
If the town has no space to place roads, then yes, you will effectively stop the town from expanding.
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: 3x3 layout center gap

Post by Pyoro »

Should the mechanic be tied to having road building turned on? If it's part of the road building scheme, why is a separate option that talks about road placing disabling it?
_dp_
Transport Coordinator
Transport Coordinator
Posts: 277
Joined: 18 Dec 2013 12:32

Re: 3x3 layout center gap

Post by _dp_ »

planetmaker wrote:If the town has no space to place roads, then yes, you will effectively stop the town from expanding.
It will still waste time trying though so it will slow down town growth. But if you're not after the fastest growth that's fine.
Pyoro wrote:Should the mechanic be tied to having road building turned on? If it's part of the road building scheme, why is a separate option that talks about road placing disabling it?
Yeah, should probably be separate. The way that extra house placement is implemented looks more like a hack to me tbh. Not only it's under roads setting but it effectively doubles the growth rate. Also it always works on map generation so you get nice towns with houses in gaps and then they just slowly die out as game goes xD
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: 3x3 layout center gap

Post by Eddi »

I'm sure a patch to make it less hacky would be welcome.
User avatar
Dada
Engineer
Engineer
Posts: 40
Joined: 02 Apr 2010 13:01
Location: Rotterdam, The Netherlands

Re: 3x3 layout center gap

Post by Dada »

_dp_ wrote:Yeah, should probably be separate. The way that extra house placement is implemented looks more like a hack to me tbh. Not only it's under roads setting but it effectively doubles the growth rate. Also it always works on map generation so you get nice towns with houses in gaps and then they just slowly die out as game goes xD
Oh, that's kind of interesting. I might try to have a look inside the code one of these days to see if I can write a patch that separates these things. Just had a look in the code and it looks very clean.
Earlier I said I'd rather not use patches but I guess I might give it a shot...

edit: I wonder if this is the check that needs to be altered... will try tomorrow, it's late here now.
https://github.com/OpenTTD/OpenTTD/blob ... .cpp#L1270
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: 3x3 layout center gap

Post by Eddi »

that looks like the right place. essentially you will want to move the two cases of "GrowTownWithExtraHouse" outside of that check for "roads allowed", leaving everything else as is
User avatar
Dada
Engineer
Engineer
Posts: 40
Joined: 02 Apr 2010 13:01
Location: Rotterdam, The Netherlands

Re: 3x3 layout center gap

Post by Dada »

Eddi wrote:that looks like the right place. essentially you will want to move the two cases of "GrowTownWithExtraHouse" outside of that check for "roads allowed", leaving everything else as is
Do you think it would be preferable to add a new setting, like "allow houses being built two tiles away from the road", or is it good enough to remove the whole "(_settings_game.economy.allow_town_roads || _generating_world)" check?
Removing that check is enough to make things work. :) I'm not sure if anyone would want to keep the old behavior.

edit: PR made
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: 3x3 layout center gap

Post by Eddi »

you need to first make sure that it doesn't start to build roads if you remove that
User avatar
Dada
Engineer
Engineer
Posts: 40
Joined: 02 Apr 2010 13:01
Location: Rotterdam, The Netherlands

Re: 3x3 layout center gap

Post by Dada »

Oh yes, I forgot to say, but I did test it. Seems to work as expected. When town roads are on, behavior is as it's always been, towns refusing to build houses in places where roads should go, and eventually it starts adding road segments. When town roads are off, it freely creates houses on the tiles where roads should go. It also successfully fills in the "gaps".

Maybe I could do a bit more robust test and take screenshots, but it seems to do what's expected.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: Ahrefs [Bot] and 5 guests