Latest Posts

Topic: Poorly centred map previews

blind3rdeye
Avatar
Topic Opener
Joined: 2020-03-26, 08:47
Posts: 74
Ranking
Likes to be here
Posted at: 2023-12-09, 05:57

I've noticed that some of the map preview thumbnail images are centred in a way that makes it hard to imagine what the map is like. I'm attaching an example for Mystical Maze. For some reason the image focuses on the water surrounding the island rather than the island itself.

I don't know if the map position in the preview is determined by some specific map data or if it is chosen by some algorithm - but in general I think its best if the edges of the preview are on water rather than land.


Attachment:
bad preview image.png

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2397
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2023-12-09, 10:03

The map preview image depends on the map origin, the coordinates 0,0 (x,y). This map origin is used as as the upper left corner to generate the preview image of the map.

In order to change the preview of a map, a maps author has to adjust the map origin. One can find this tool in the tool menu of the editor and is called "Map Origin". Choose the option and click on the map at that position where you want to have the coordinates 0,0. After saving the map the preview image should have been changed accordingly. This may need some try's to get a good map preview.

I think having an algorithm for calculating a good preview, e.g. water tiles on the edges, will not work for all maps, e.g. Dust in the Wind or Archipelago Sea.

But i agree that this option probably needs more explanation.


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
blind3rdeye
Avatar
Topic Opener
Joined: 2020-03-26, 08:47
Posts: 74
Ranking
Likes to be here
Posted at: 2023-12-09, 10:30

Right. That all makes sense, and sounds quite reasonable. Thanks for the explanation. I suppose what's probably happening is that map authors are treating the origin as the centre, which they then use as a kind of starting point to build the map around; but then the preview image treats it as the corner rather than the centre and so it gets messed up.

I guess the solution is just to make sure that map authors can see what the preview is going to look like, and that they know how to change it (i.e. change where the origin is). But maybe for the official maps it would be ok for one of the developers to change the origin on the map author's behalf.


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2397
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2023-12-09, 11:15

I forgot to mention: The minimap of the editor also uses the map origin to render the map as the minimap = the upper left corner of the minimap is the map origin, the coordinates 0,0. The image shown in the minimap of the editor is equal to the map preview.

Changes to the map origin are immediately reflected in the minimap. So to find a good map preview one can just open the minimap and use the map origin tool. At every click on the map (not the minimap) the map shown in the minimap will move so that the new map origin is the upper left corner of the minimap. If one is happy with the rendered image in the minimap just save the map and the map preview will look like the minimap has shown.


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
tothxa
Avatar
Joined: 2021-03-24, 12:44
Posts: 425
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2023-12-09, 14:27

Anyway, it's probably a good idea to change the editor to position the window to the map centre when starting a new map, and maybe also for opening an existing one.


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2397
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2023-12-09, 14:48

See https://github.com/widelands/widelands/issues/1694


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
mxb2001
Avatar
Joined: 2019-05-20, 18:49
Posts: 237
OS: Linux
Version: 1.1
Ranking
Widelands-Forum-Junkie
Location: The land of the thirsty spider
Posted at: 2023-12-10, 04:35

Ah that explains the bizarre europa map preview where you see the border around the map (to prevent connecting russia to spain and sicily to norway ; ) forming a + sign right in the middle. I suppose 0,0 was placed in switzerland rather than near iceland... hehe.


--
To Boldly Go Where No Man Has Gone Before

Top Quote