News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Minimap citylabels

Started by Tjoeker, June 29, 2016, 09:19:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tjoeker

I believe everybody knows this map view:



Kinda hard to read the city names in the clusters..
It's still possible in this example. But if you zoom out one more step, it's impossible to read them.

wouldn't this be more convenient?:



Just like on google earth or google maps, if 2 labels collide, just show one.
I suggest showing the city with the most citizens.

wlindley

In your example, the simple solution of showing only the "first" (topmost, leftmost) of overlapping names would show Philadelphia, Bethesda, and Arlington but not Washington DC. Trying to be very fancy about choosing which ones to display could get quite complex.

DrSuperGood

The label for the biggest (most important) city should take precedence and be shown over the smaller cities.

wlindley

So the algorithm would be this?

       
  • Make a list of all the cities visible in the minimap
  • Sort them in order of decreasing city-size (population)
  • Display the (first) city, adding its four text x,y corners (rectangle) to a rectangle-list
  • For subsequent cities, check each of (x1,y1),(x1,y2),(x2,y1),(x2,y2) to see whether any of those points are contained within the bounding boxes of anything in the rectangle-list; and skip if so, otherwise see Step 3 (display; add to list; repeat)


Dwachs

Yes, something like this. Such an algorithm could also be used for display of the game world in zoom out for city and station names / labels.
Parsley, sage, rosemary, and maggikraut.

prissi

You may switch to isometric display to read the names (in your case) ...

jamespetts

An alternative suggestion made years ago by Neroden is actually to merge cities that become absorbed into one another as here.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ters

Quote from: jamespetts on July 02, 2016, 08:45:23 PM
An alternative suggestion made years ago by Neroden is actually to merge cities that become absorbed into one another as here.

1. This map looks like it has been made with these cities as they are on purpose, to reflect the real world. As such, the map designer could have merged them from the start if it was deemed acceptable.
2. The presentation problem does not appear only when cities grow into each other. It is only affected by distance between town halls and the display scale of the map. The latter can't be used for merging cities.

DrSuperGood

City merger would work however it would require redefining what a "city" is. A city would have to be a collection of named rectangles (districts), of which one is chosen as its "centre" to define the city name. Cities expand by resizing and making new districts over time. Districts cannot overlap and would have a minimum and maximum size. If districts from one city come into contact with districts of another city then the cities can merge, where by all districts of one city are moved to the other city and the empty city removed. When zoomed close all district names are visible however when zoomed far away only the centre district name will show.

This will fix the overlapping city name issue as cities should not end up existing in close proximity from each other. It will also fix the overlapping city issue where by cities stop expanding their bounds due to low building density caused by city buildings belonging to another city being inside their city area. It also adds potential for industry placement improvements such as city based consumers creating a district around them and being limited to only 1 per district (no 3 construction wholesalers right next to each other). It could even improve city growth logic as large cities would expand in full sized districts at a time (easy to set up transport for as area is well defined) rather than gradually by incrementing boundary size (hard to setup transport for as it may expand in the wrong direction or beyond the created transport infrastructure.

Ters

Quote from: DrSuperGood on July 04, 2016, 04:59:08 AM
This will fix the overlapping city name issue as cities should not end up existing in close proximity from each other.

But it will reduce the ability to make realistic maps. And the threshold for merging cities would have to depend on the scale of the map.

DrSuperGood

Quote
But it will reduce the ability to make realistic maps. And the threshold for merging cities would have to depend on the scale of the map.
If anything it would make maps more realistic. Cities often are divided into zones/districts for administration/governing. For example the city of Glasgow has many council districts inside it, many with Glasgow somewhere in their name.

Hence why these local district names would be shown when zoomed close where overlapping name tags is not an issue. When zoomed far away or looking at the minimap then only 1 name tag will be shown.

In the case of two cities which should remain separate growing into each other (eg for a scenario) then a flag could be used to prevent city merger. It is then up to the map maker to assure that the city placements are meaningful and will not overlap names badly.

Tjoeker

I'd like to see it implemented like Wlindley put it. And as Dwachs stated, we could also use this for stations.
What's wrong with hiding names if you can't read them?

The merging of cities into one city with different districts seems to be a whole different topic to me...

DrSuperGood

Quote
What's wrong with hiding names if you can't read them?
It adds ambiguity as to what you are seeing. If you see a mess due to name tags overlapping then at least you know there are 2 objects with tags nearby even if you cannot read what they are. If you hide 1 of them then you may only be aware of 1 named object existing which you might be able to read perfectly but the other object is ambiguous to you.

Ters

Quote from: DrSuperGood on July 04, 2016, 03:56:45 PM
If anything it would make maps more realistic. Cities often are divided into zones/districts for administration/governing. For example the city of Glasgow has many council districts inside it, many with Glasgow somewhere in their name.

That is a feature of subdividing cities, not automatically merging them, which is what I replied to.

Quote from: DrSuperGood on July 04, 2016, 03:56:45 PM
In the case of two cities which should remain separate growing into each other (eg for a scenario) then a flag could be used to prevent city merger. It is then up to the map maker to assure that the city placements are meaningful and will not overlap names badly.

Then the problem we are discussing here remains, because the meaningful positions of real life cities will cause overlap. Just check out Newark, Jersey City and New York City. In Google Maps, New York City (without "City", but I don't think it's the state, because no other state names can be seen) makes Newark invisible until you zoom far enough in. At that point, the names of some of the districts of New York City have already become visible. And you have to zoom in even more for the name Jersey City to become visible.

Label conflicts is a problem as old as the concept of maps. It is resolved on the maps, not by rearranging the world the map represents. All people reading maps must just cope with it. (Fortunately, the "inhabitants" in Simutrans won't be confused by offset labels, as is happening in the real world when hastily digitized maps were put into GPSes.)