Page 1 of 1

Town too close to another town

Posted: 02 Jun 2013 08:48
by TinyMusic
I'm trying to make a scenario cramped with loads of cities, but the problem is when I do that it is hard to place a town close to another town. Is there a way I can overcome this?

Re: Town too close to another town

Posted: 02 Jun 2013 08:56
by planetmaker
No. IIRC the minimum distance is 20 tiles or so.

Re: Town too close to another town

Posted: 02 Jun 2013 15:06
by YNM
Maybe commenting / changing the piece of code that regulate this could help ?

Re: Town too close to another town

Posted: 02 Jun 2013 18:29
by kamnet
In the scenario editor, click on the town's name, click the buttons to grow the town.

Re: Town too close to another town

Posted: 03 Jun 2013 03:28
by YNM
He's probably wants to keep the towns small, not grown.

Re: Town too close to another town

Posted: 03 Jun 2013 04:46
by kamnet
If the minimum distance between town centers is 20 tiles, then that makes each town, at its widest, just 10 tiles each. That's not much at all.

Re: Town too close to another town

Posted: 03 Jun 2013 12:53
by TinyMusic
Can anyone then write a patch to stop the maximum width limit? And plus, would it be easy to write?

Re: Town too close to another town

Posted: 03 Jun 2013 13:03
by planetmaker
UseYourIllusion wrote:Can anyone then write a patch to stop the maximum width limit?
Sure, it's open-source. Assuming that everyone is capable of learning.
UseYourIllusion wrote:And plus, would it be easy to write?
Yes. Or no. Depends ;-)

Re: Town too close to another town

Posted: 03 Jun 2013 13:40
by TinyMusic
Isn't it just simply finding in the source code where all the town minimum width is defined and then just delete these codes? Or is it much harder than that?

Edit: I meant minimum instead of maximum

Re: Town too close to another town

Posted: 03 Jun 2013 14:27
by planetmaker
I am not even sure what property you assume to have a maximum value. The town separation? Town size? Neither is bound in any way other than map size.

Re: Town too close to another town

Posted: 03 Jun 2013 14:55
by YNM
Town separation, is.

Re: Town too close to another town

Posted: 04 Jun 2013 23:35
by Eddi
IIRC there once was a patch that allowed to configure the town distance

Re: Town too close to another town

Posted: 31 May 2020 10:13
by Eastler_Dart
im just new to openTTD, and found a hint to the old theme here:

in the Sources of openTTD (ver 1.10.1)
in the file ./src/town_cmd.cpp
in line 1834
if (IsCloseToTown(tile, 20)) {
return_cmd_error(STR_ERROR_TOO_CLOSE_TO_ANOTHER_TOWN);
}
the fix value 20 seems to be the one, who gives the error.

So try to change that to 10, 5 or something else and compile openttd to a new version.

With that you have the chance to build towns close together. If it not works,
you have to look for other places in the sources, if there are these '20' in
other places again and change them there also.

If you want to give others the same possibility, you have also to give them your compiled openTTD.

I think, a "normal" Version opens such a szenario ( towns too close together ) in a way, which throws
an error or which deletes some towns. But try it, maybe it works also.
If it throws errors, or if towns dissapear, then that is a good hint, where you have to look for more of the '20' ;-)

If I success with my german linux, and really share it on the net, there will also be
a special Version of OpenTTD, with some "reality"-Szenarios, one for Germany, one for Europe.
And because with Europe on 256x256 i also can't put MainTowns at the places they shoud be,
I will also try to change the Value '20' :-))
But first my german Linux should get "usuable for others" rolleyes

hope it helps