Minimaps creation alternative / Map diff tool

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

User avatar
v0id
Novice
Novice
Posts: 196
Joined: 15 Sep 2009, 21:31
Location: Désolé, je ne loue pas.

Minimaps creation alternative / Map diff tool

Post 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 5131 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 5131 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 5131 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 :)
User avatar
Jenalya
TMW Adviser
TMW Adviser
Posts: 717
Joined: 22 Sep 2010, 19:28

Re: Minimaps creation alternative / Map diff tool

Post 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.
Whistler
Peon
Peon
Posts: 24
Joined: 07 Jan 2010, 09:38

Re: Minimaps creation alternative / Map diff tool

Post 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.
http://themanaworld.net/ a well known host for real players.
User avatar
Nard
Knight
Knight
Posts: 1113
Joined: 27 Jun 2010, 12:45
Location: France, near Paris

Re: Minimaps creation alternative / Map diff tool

Post 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 :)
User avatar
Nard
Knight
Knight
Posts: 1113
Joined: 27 Jun 2010, 12:45
Location: France, near Paris

Re: Minimaps creation alternative / Map diff tool

Post 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.
"The language of everyday life is clogged with sentiment, and the science of human nature has not advanced so far that we can describe individual sentiment in a clear way." Lancelot Hogben, Mathematics for the Million.
“There are two motives for reading a book; one, that you enjoy it; the other, that you can boast about it.” Bertrand Russell, Conquest of Happiness.
"If you optimize everything, you will always be unhappy." Donald Knuth.
User avatar
argul
Novice
Novice
Posts: 237
Joined: 08 Aug 2010, 18:43

Re: Minimaps creation alternative / Map diff tool

Post 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
---
User avatar
v0id
Novice
Novice
Posts: 196
Joined: 15 Sep 2009, 21:31
Location: Désolé, je ne loue pas.

Re: Minimaps creation alternative / Map diff tool

Post 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 :)
User avatar
Nard
Knight
Knight
Posts: 1113
Joined: 27 Jun 2010, 12:45
Location: France, near Paris

Re: Minimaps creation alternative / Map diff tool

Post 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
User avatar
v0id
Novice
Novice
Posts: 196
Joined: 15 Sep 2009, 21:31
Location: Désolé, je ne loue pas.

Re: Minimaps creation alternative / Map diff tool

Post 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)
User avatar
v0id
Novice
Novice
Posts: 196
Joined: 15 Sep 2009, 21:31
Location: Désolé, je ne loue pas.

Re: Minimaps creation alternative / Map diff tool

Post 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.
User avatar
argul
Novice
Novice
Posts: 237
Joined: 08 Aug 2010, 18:43

Re: Minimaps creation alternative / Map diff tool

Post 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?
---
User avatar
v0id
Novice
Novice
Posts: 196
Joined: 15 Sep 2009, 21:31
Location: Désolé, je ne loue pas.

Re: Minimaps creation alternative / Map diff tool

Post 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 :)
Ablu
Manasource
Manasource
Posts: 288
Joined: 23 Jul 2011, 08:31
Location: Germany

Re: Minimaps creation alternative / Map diff tool

Post by Ablu »

I did a pullrequest to add the generation to the makefile. So it wont get forgetten.
Ablu
Manasource
Manasource
Posts: 288
Joined: 23 Jul 2011, 08:31
Location: Germany

Re: Minimaps creation alternative / Map diff tool

Post by Ablu »

As void pointed out in the pullrequest: There already is a script.
User avatar
v0id
Novice
Novice
Posts: 196
Joined: 15 Sep 2009, 21:31
Location: Désolé, je ne loue pas.

Re: Minimaps creation alternative / Map diff tool

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