Page 1 of 2

Minimaps creation alternative / Map diff tool

Posted: 22 Sep 2012, 20:51
by v0id
As an alternative to have a command-line tool to generate minimaps and also better management of our maps, I created the following tools:
  • a command-line tool to create minimaps
  • a command-line tool to view differences between revisions of maps
The tools rely on libtiled to generate the map bitmaps.

Examples usage
As an example of how they could be used, let's say someone just pushed changes on a map, say 007-1. Someone else reviewes the changes and wants to check if the minimap has to be updated due to "major" visual changes in the map.

Code: Select all

$ cd eathena-data/client-data/tools 
$ ./map-diff.py 007-1
This will compare the rendering of the 007-1 map between the 2 most recent commits that modified it.

Such image could be displayed:
Map Diff (Scaled)
Map Diff (Scaled)
007-1_2fbb092-83d8751.png (168.04 KiB) Viewed 6669 times
which obviously shows the minimap should be regenerated. Using this command:

Code: Select all

$ ./minimap-render.py 007-1
Another possible usage is that you may want to visualize changes in maps that arent committed yet.
E.g:

Code: Select all

$ ./map-diff.py changes-made-by-someone-007-1.tmx ../maps/007-1.tmx
which will again generate an image showing visual differences.

In case you would want to compare other changes than the 2 most recent ones, there's always the possibility to do something like:

Code: Select all

$ git log --oneline ../maps/009-6.tmx

83d8751 Convert map compression format back to gzip. It turned out that the 0.5.0 client, which i
678b7c0 unified collision tiles for beds, moved top part of woodland indoor beds to over layer
2fcd26e Fix improper use of an effectively x2 tileset.
648d875 Fix tux9th's map changes for the new standards.
9af1f6d Maps for PvP-last man standing Event
To see the changes between the last version (83d8751) and the first version (9af1f6d) of the map:

Code: Select all

$ git show 83d8751:../maps/009-6.tmx > 83d8751_009-6.tmx
$ git show 9af1f6d:../maps/009-6.tmx > 9af1f6d_009-6.tmx
$ ./map-diff.py 83d8751_009-6.tmx 9af1f6d_009-6.tmx
which would show there werent any visual changes since its first creation.
009-6 changes (cropped, scaled)
009-6 changes (cropped, scaled)
83d8751_009-6__9af1f6d_009-6.png (94.8 KiB) Viewed 6669 times
Finally, the minimap creation tool accepts more than one map argument. For example, to update all the existing minimaps:

Code: Select all

$ ./minimap-render.py $(sed s/.png// <<< $(ls ../graphics/minimaps/))
Minimaps look

A rendered minimap typically looks like this:
009-1 minimap
009-1 minimap
009-1.png (13.97 KiB) Viewed 6669 times
You will notice the small outlines to give a cell-shaded effect, that improves readability overs a simple scaled-down version of the map.

Limitations
The raster tool requires a large amount of RAM when the processed map is very large, which may end up to have the tool failing to render the map.
So far, 024-4 is the only map causing a problem with its 500x500 size.... Anyway, it's good practice to not make maps larger than 150x150.

Installation
Want to test ?
There are 2 steps.
  • Grab the minimap and diff tools on my map-tools branch of my tmwa-client-data fork. See the 2 related commits here
  • Grab the tmxrasterizer tool from the tmxrasterizer branch of my Tiled fork. Follow the compile instructions of Tiled. If you have an existing installation of Tiled, you can safely upgrade and install: there's only the new tmxrasterizer program that will be installed in your path.
  • Install the Image Magick tools on your system.
  • Git and Python.
Would these be helpful in your mapping tasks, reviews, and should be adopted ?
If yes, any ways to improve ?

Thanks for your comments :)

Re: Minimaps creation alternative / Map diff tool

Posted: 25 Sep 2012, 17:58
by Jenalya
I used v0id's tool to update the minimaps of 011-1, 012-1, 055-1 and 056-1 and found it very handy to use.
v0id wrote:You will notice the small outlines to give a cell-shaded effect, that improves readability overs a simple scaled-down version of the map.
We put the new minimaps on the testserver and we'd like some feedback on the new look.

Re: Minimaps creation alternative / Map diff tool

Posted: 26 Sep 2012, 13:17
by Whistler
They look more clear and precise than the "old" ones, The outline
gives more depth and contrast to their display.
Didn't use the tools to make them but as a player it's easier to read.
Off topic, it will be nice to be able to resize the mini map window or
change its transparency.

Re: Minimaps creation alternative / Map diff tool

Posted: 02 Oct 2012, 06:15
by Nard
I don't have much to say except that this is a very nice work, a nice improvement to the gui. Thanks tor the job!

Nard
Edit:
whistler wrote:it will be nice to be able to resize the mini map window
It is resizable in manaplus, no doubt that the next mana version will include the feature :)

Re: Minimaps creation alternative / Map diff tool

Posted: 02 Oct 2012, 06:24
by Nard
v0id wrote:As an alternative to have a command-line tool to generate minimaps and also better management of our maps, I created the following tools:
  • a command-line tool to create minimaps
  • a command-line tool to view differences between revisions of maps
The tools rely on libtiled to generate the map bitmaps.

[...]

Thanks for your comments :)
:D
When will these features wil be included in Tiled? It definitely needs them.

Re: Minimaps creation alternative / Map diff tool

Posted: 02 Oct 2012, 11:48
by argul
In the master branch bjorn recently added a minimap contributed by Christoph Schnackenberg.
Also a map diff tool is available, but it is still experimental. It is found at https://github.com/stefanbeller/tiled/tree/difftool

Re: Minimaps creation alternative / Map diff tool

Posted: 02 Oct 2012, 12:39
by v0id
Nard wrote:
v0id wrote:As an alternative to have a command-line tool to generate minimaps and also better management of our maps, I created the following tools:
  • a command-line tool to create minimaps
  • a command-line tool to view differences between revisions of maps
The tools rely on libtiled to generate the map bitmaps.

[...]

Thanks for your comments :)
:D
When will these features wil be included in Tiled? It definitely needs them.
These 2 command-line tools are TMW specific (e.g they follow the tmw-client-data file tree structure), hence they are not suited for Tiled.
Besides, the diff tool is only meant for our need: see visual differences. The diff tool argul mentionned is more suited for a mapper who will need to see differences at the map layer level.

There's however the tmxrasterizer which produces the map bitmaps. After some talk, it could be merged into tiled but will first need a rewrite :)

Re: Minimaps creation alternative / Map diff tool

Posted: 02 Oct 2012, 17:57
by Nard
v0id wrote: These 2 command-line tools are TMW specific (e.g they follow the tmw-client-data file tree structure), hence they are not suited for Tiled.
Besides, the diff tool is only meant for our need: see visual differences. The diff tool argul mentionned is more suited for a mapper who will need to see differences at the map layer level.

There's however the tmxrasterizer which produces the map bitmaps. After some talk, it could be merged into tiled but will first need a rewrite :)
In think it would be useful to a mapper (especially when team working) to visually and quickly locate where modifications have been made; more the diff map could feature some pop up window (or even menu) to indicate on which layers are differences and maybe quickly jump to edit them.
Concerning the minimaps, I saw that someone began to map the world on wiki with them. Definitely it is a nice tool for game documentation whether it is TMW or not.
For sure command line tools would require some work to be hierachy independant, but I think the result would be worth the effort in terms of mapping time spare just as they do at the moment.

Nard

Re: Minimaps creation alternative / Map diff tool

Posted: 18 Nov 2012, 18:01
by v0id
The server got restarted today bringing in an update where all minimaps got updated with this tool.
Press F6 :)

Also, work has been done to improve the tmxrasterizer tool. It's a bit faster and doesnt suffer crashes if the map is too large (as 024-4)

Re: Minimaps creation alternative / Map diff tool

Posted: 29 Dec 2012, 14:44
by v0id
GUI or command line will give the same result if the tool isnt used. And it's what happened: it took time to get tmxrasterizer into tiled mainline.
So for now the tool has only been used by me and jenalya for rendering existing minimaps.

On a side note, i've been unable to compile your Gui tool with monodevelop on linux.

Re: Minimaps creation alternative / Map diff tool

Posted: 29 Dec 2012, 15:21
by argul
v0id wrote:GUI or command line will give the same result if the tool isnt used.
Now that tmxrasterizer is in tiled, maybe we can add the creation of minimaps to the Makefile?

Re: Minimaps creation alternative / Map diff tool

Posted: 29 Dec 2012, 15:28
by v0id
As i pointed out to Jenalya, that's indeed the next step. I'll just review them a bit before committing however, so that will be probably in 2013 :)

Re: Minimaps creation alternative / Map diff tool

Posted: 27 Mar 2013, 09:11
by Ablu
I did a pullrequest to add the generation to the makefile. So it wont get forgetten.

Re: Minimaps creation alternative / Map diff tool

Posted: 27 Mar 2013, 09:30
by Ablu
As void pointed out in the pullrequest: There already is a script.

Re: Minimaps creation alternative / Map diff tool

Posted: 27 Mar 2013, 20:10
by v0id
Minimaps that needed an update are now updated -- which is almost all, due to the change of graphic style that happened when rewriting tmxrasterizer for inclusion in Tiled.