Town too close to another town

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
TinyMusic
Tycoon
Tycoon
Posts: 1423
Joined: 02 Feb 2013 02:03

Town too close to another town

Post 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?
Formerly known as UseYourIllusion.
Java Scenario Found Here - Version 2 out
[tweɪ̂ pû tɕʰì wɔ̀ mǐlɤ lû tɕʰìŋ nì pɑ́ŋmɑ̌ŋ]

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9412
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Town too close to another town

Post by planetmaker »

No. IIRC the minimum distance is 20 tiles or so.

User avatar
YNM
Tycoon
Tycoon
Posts: 3547
Joined: 22 Mar 2012 11:10
Location: West Java

Re: Town too close to another town

Post by YNM »

Maybe commenting / changing the piece of code that regulate this could help ?
YNM = yoursNotMine - Don't get it ?
「ヨーッスノットマイン」と呼ぶことはできる。

User avatar
kamnet
Moderator
Moderator
Posts: 7222
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Town too close to another town

Post by kamnet »

In the scenario editor, click on the town's name, click the buttons to grow the town.

User avatar
YNM
Tycoon
Tycoon
Posts: 3547
Joined: 22 Mar 2012 11:10
Location: West Java

Re: Town too close to another town

Post by YNM »

He's probably wants to keep the towns small, not grown.
YNM = yoursNotMine - Don't get it ?
「ヨーッスノットマイン」と呼ぶことはできる。

User avatar
kamnet
Moderator
Moderator
Posts: 7222
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Town too close to another town

Post 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.

TinyMusic
Tycoon
Tycoon
Posts: 1423
Joined: 02 Feb 2013 02:03

Re: Town too close to another town

Post by TinyMusic »

Can anyone then write a patch to stop the maximum width limit? And plus, would it be easy to write?
Formerly known as UseYourIllusion.
Java Scenario Found Here - Version 2 out
[tweɪ̂ pû tɕʰì wɔ̀ mǐlɤ lû tɕʰìŋ nì pɑ́ŋmɑ̌ŋ]

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9412
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Town too close to another town

Post 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 ;-)

TinyMusic
Tycoon
Tycoon
Posts: 1423
Joined: 02 Feb 2013 02:03

Re: Town too close to another town

Post 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
Last edited by TinyMusic on 03 Jun 2013 14:39, edited 2 times in total.
Formerly known as UseYourIllusion.
Java Scenario Found Here - Version 2 out
[tweɪ̂ pû tɕʰì wɔ̀ mǐlɤ lû tɕʰìŋ nì pɑ́ŋmɑ̌ŋ]

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9412
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Town too close to another town

Post 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.

User avatar
YNM
Tycoon
Tycoon
Posts: 3547
Joined: 22 Mar 2012 11:10
Location: West Java

Re: Town too close to another town

Post by YNM »

Town separation, is.
YNM = yoursNotMine - Don't get it ?
「ヨーッスノットマイン」と呼ぶことはできる。

Eddi
Tycoon
Tycoon
Posts: 7456
Joined: 17 Jan 2007 00:14

Re: Town too close to another town

Post by Eddi »

IIRC there once was a patch that allowed to configure the town distance
You might not exactly be interested in Ferion, but if you are, have fun :)

Eastler_Dart
Engineer
Engineer
Posts: 2
Joined: 31 May 2020 09:32

Re: Town too close to another town

Post 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

Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 7 guests