The International Simutrans Forum

Development => Bug Reports => Topic started by: dree12 on April 13, 2014, 04:31:10 PM

Title: [r7122] Town Hall partially engulfed by neighbouring city
Post by: dree12 on April 13, 2014, 04:31:10 PM
Over the years, the southern city of Hillmouth has expanded its borders northward, so that they overlap with Newmouth's borders.
(http://i.imgur.com/VYj3UgF.png)

Newmouth's Town Hall is partially in the zone of overlap:
(http://i.imgur.com/mk2gYts.png)

The northmost two squares of this Town Hall display the correct city screen:
(http://i.imgur.com/ZNPT6x2.png)

However, the southmost two squares are displaying Hillmouth's city screen instead:
(http://i.imgur.com/UlYWBmb.png)

Since this is Newmouth's Town Hall, the expected behaviour would be that any square of the Town Hall displays Newmouth's city screen. However, Hillmouth's expanding borders seem to have engulfed part of the Town Hall.
Title: Re: [r7122] Town Hall partially engulfed by neighbouring city
Post by: prissi on April 13, 2014, 09:43:01 PM
Yes that is well know and not considerated a bug.
Title: Re: [r7122] Town Hall partially engulfed by neighbouring city
Post by: dree12 on April 14, 2014, 12:19:53 AM
Why is this not considered a bug? If it is intended behaviour, that seems strange... Maybe it is too difficult to fix?
Title: Re: [r7122] Town Hall partially engulfed by neighbouring city
Post by: Ters on April 14, 2014, 08:38:23 AM
Can this in theory cause Hillmouth to completely lose its city hall, by all the city hall's tiles being assigned to Newmouth?
Title: Re: [r7122] Town Hall partially engulfed by neighbouring city
Post by: IgorEliezer on April 14, 2014, 08:57:42 AM
I sometimes think that Simutrans should have municipality boundaries. Even if a city spreads beyond the boundary, the "off-limits" buildings would be then part of another municipality.
Title: Re: [r7122] Town Hall partially engulfed by neighbouring city
Post by: Ters on April 14, 2014, 09:55:04 AM
The problem seems to be that boundaries in Simutrans are rectangles. I don't see how municipalities are going to help. Cities do grow and their limits will follow in time, until some point. The exact detail probably vary with time and place. (Norway used to have municipalites that were cities and municpalities that were not. The former used to devour the latter as they grew, piece by piece or whole. Now there is no formal concept of cities, just municipalites, of which just a few are "fully" urban.)
Title: Re: [r7122] Town Hall partially engulfed by neighbouring city
Post by: ӔO on April 14, 2014, 11:46:06 AM
how difficult would it be to merge cities that have grown into each other?
Title: Re: [r7122] Town Hall partially engulfed by neighbouring city
Post by: Dwachs on April 14, 2014, 12:06:12 PM
Technically, the townhall still belongs to its original city. Clicking on it does open the wrong window.

@AEO: merging is simple. It is more difficult to decide when to merge.
Title: Re: [r7122] Town Hall partially engulfed by neighbouring city
Post by: ӔO on April 14, 2014, 12:09:21 PM
I would consider, maybe, 40% overlap of borders, or higher, to be a candidate for merging.
Title: Re: [r7122] Town Hall partially engulfed by neighbouring city
Post by: prissi on April 14, 2014, 12:29:23 PM
Ok, bringing up the wrong screen is a bug, overlapping cities not. (A similar problem happens with the industry connect tool, which only works on the upper tiles.)

Back to topic: we can try to to enforce non-overlapping city limits. That way a rural area between two cities would be found.
Title: Re: [r7122] Town Hall partially engulfed by neighbouring city
Post by: Ters on April 14, 2014, 12:55:17 PM
I don't think cities normally merge when growing into each other. Altough one city tends to be the main city in the metropolitan area, I don't have the impression that it has any juristiction over the other cities. Nor does it seem right that there must be rural area between them.

If a town hall does have a distinct link to the city/town it belongs to, then one can perhaps code something that makes sure its building tiles belong to its city. One could perhaps even go as far as to associate building tiles with the closest town hall, among the town halls of overlapping town boundaries. (I haven't tried looking at the code for this.)
Title: Re: [r7122] Town Hall partially engulfed by neighbouring city
Post by: Dwachs on April 17, 2014, 09:29:19 AM
@dree12: the bug in the first post should be fixed in nightly r7147. thanks for the report.