Page 9 of 10

Re: Minetestmapper rewritten into C++

PostPosted: Mon Jan 16, 2017 21:10
by Sergey
taikedz wrote:you did "mkdir dir1; cd dir1"

There is no colors.txt in that dir1. An executable "that uses files in the current/local directory" uses the current dir in which you run the command, not the data from the dir in which it resides.

I know what current directory is. And I didn't confuse anything.

taikedz wrote:You want to execute
Code: Select all
minetestmapper --colors $PATH_TO_COLOURS_TXT <and the rest of your stuff>

I just want not to deal with colors.txt at all if I don't want to paint my map in some special way.
minetestmapper should use its own default settings.

Re: Minetestmapper rewritten into C++

PostPosted: Wed Jan 18, 2017 15:40
by sfan5
Sergey wrote:
sfan5 wrote:How did you install minetestmapper and which version did you install?


I installed minetestmapper from AUR [https://aur.archlinux.org/packages/minetestmapper-git/] this standard way.

Unfortunately the AUR package installs minetestmapper incorrectly, please install it manually from source in the meantime.

Re: Minetestmapper rewritten into C++

PostPosted: Tue Jan 31, 2017 19:48
by Sergey
sfan5 wrote:
Sergey wrote:
sfan5 wrote:How did you install minetestmapper and which version did you install?


I installed minetestmapper from AUR [https://aur.archlinux.org/packages/minetestmapper-git/] this standard way.

Unfortunately the AUR package installs minetestmapper incorrectly, please install it manually from source in the meantime.

AUR package was corrected. Now it draws map without necessary colors.txt.

But it wasn't an upgrade. I had to uninstall program, clear package cache, and then install program again.

Re: Minetestmapper rewritten into C++

PostPosted: Tue Jan 31, 2017 19:54
by Sergey
Now there are new problems with generating maps of newly generated worlds.

If I create new world (name: s1, mapgen: valleys), start (play) it, turn around without making any steps, exit it, and then launch in terminal minetestmapper, then I get that situation:

Code: Select all
$ minetestmapper --geometry -5000:-5000+10000+10000 --draworigin  -i ~/.minetest/worlds/s1/ -o s1.1.png
terminate called after throwing an instance of 'std::out_of_range'
  what():  sizecheck y
Аварийный останов (стек памяти сброшен на диск)

Re: Minetestmapper rewritten into C++

PostPosted: Thu Feb 02, 2017 21:56
by sfan5
I can't reproduce this problem, however it should go away if you compile minetestmapper in Release mode.

Re: Minetestmapper rewritten into C++

PostPosted: Fri Mar 17, 2017 21:48
by Sergey
I have reasonable questions about minetestmapper.

Does minetestmapper take into account floatlands?
What kind of maps minetestmapper generates in case of view from above?
Will view from above cover what is on the ground?
How to dintigiush projection of floatlands from what is on the ground?

Re: Minetestmapper rewritten into C++

PostPosted: Sat Mar 18, 2017 14:15
by twoelk
Sergey wrote:I have reasonable questions about minetestmapper.

Does minetestmapper take into account floatlands?
What kind of maps minetestmapper generates in case of view from above?
Will view from above cover what is on the ground?
How to dintigiush projection of floatlands from what is on the ground?


quick answer:
1. yes
2. a view from above (as far above as air nodes have been generated)
3. yes
4. you cannot (at least not easily, you may want to try out hightmap options)

sollution:
you can tell the mapper where to begin mapping, left, right, front, back, up and down
README.rst wrote:
Code: Select all
min-y:
    Don't draw nodes below this y value, e.g. ``--min-y -25``

max-y:
    Don't draw nodes above this y value, e.g. ``--max-y 75``

Re: Minetestmapper rewritten into C++

PostPosted: Thu Aug 10, 2017 14:40
by krokoschlange
Code: Select all
CMakeFiles/minetestmapper.dir/Image.cpp.o: In Funktion `Image::save(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
Image.cpp:(.text+0x9af): Nicht definierter Verweis auf `gdImagePng'
collect2: error: ld returned 1 exit status
CMakeFiles/minetestmapper.dir/build.make:279: die Regel für Ziel „minetestmapper“ scheiterte
make[2]: *** [minetestmapper] Fehler 1
CMakeFiles/Makefile2:67: die Regel für Ziel „CMakeFiles/minetestmapper.dir/all“ scheiterte
make[1]: *** [CMakeFiles/minetestmapper.dir/all] Fehler 2
Makefile:149: die Regel für Ziel „all“ scheiterte
make: *** [all] Fehler 2


It seems to be similar to this one:
sfan5 wrote:
stormchaser3000 wrote:i got a compile error with the version in the top post (i might try sfan5's fork) and i got this
Code: Select all
        CMakeFiles/minetest_mapper.dir/TileGenerator.cpp.o: In function `TileGenerator::writeImage(std::string const&)':
        TileGenerator.cpp:(.text+0x22e9): undefined reference to `gdImagePng'
        collect2: error: ld returned 1 exit status
        make[2]: *** [minetest_mapper] Error 1
        make[1]: *** [CMakeFiles/minetest_mapper.dir/all] Error 2
        make: *** [all] Error 2



Make sure you have a libgd version with png support installed.

What I did:
    Build libpng
    run ./config in the libgd folder: It said it would use libpng for png support
    build libgd
    build minetestmapper
What did I do wrong?

Re: Minetestmapper rewritten into C++

PostPosted: Fri Aug 11, 2017 13:18
by sfan5
If you have built libgd on your own you either need to make sure to install it system-wide or point minetestmapper to the correct path using -DLIBGD_INCLUDE_DIR= or -DLIBGD_LIBRARY=.

Re: Minetestmapper rewritten into C++

PostPosted: Fri Aug 11, 2017 15:24
by krokoschlange
sfan5 wrote:If you have built libgd on your own you either need to make sure to install it system-wide or point minetestmapper to the correct path using -DLIBGD_INCLUDE_DIR= or -DLIBGD_LIBRARY=.

Still the same error :(
I built libgd 2.2.4 with libpng 1.6.31, these should be the newest versions ... and ofc latest mtmapper

Re: Minetestmapper rewritten into C++

PostPosted: Sun Nov 05, 2017 15:04
by BirgitLachner
What about this error?

Code: Select all
terminate called after throwing an instance of 'ZlibDecompressor::DecompressError


Is it a problem with png?
My husband (Linux-Pro) thinks that usually at Debian the png-support should be "installed".

Thanks ... Birgit

Re: Minetestmapper rewritten into C++

PostPosted: Mon Nov 06, 2017 22:10
by sfan5
Nope unrelated to PNG, that error usually points towards invalid data inside the map.sqlite

Re: Minetestmapper rewritten into C++

PostPosted: Tue Nov 07, 2017 17:18
by twoelk
isn't the same error thrown when the mapper tries to load and unzip another mapblock and can't because it runs into memory issues? Try mapping a smaller area, if it still happens I was wrong :-P

or if you got lots of time, by some sort of clever mapping bisecting you can pinpoint the corrupt area

Re: Minetestmapper rewritten into C++

PostPosted: Tue Nov 07, 2017 18:46
by BirgitLachner
I can try it, but the error was not inside the area I wanted to map. I teleported myself to this place but there was nothing special there and I think that haven't been there before. I even used the command "/deleteblocks here" to rebuild the area. But the problem was the same.

Can I "repair" the database. Is there a command?

Birgit

Re: Minetestmapper rewritten into C++

PostPosted: Fri Nov 10, 2017 18:10
by BirgitLachner
I found the --geometry option and tried a smaller area but I got the same error.

Re: Minetestmapper rewritten into C++

PostPosted: Thu Nov 15, 2018 13:28
by wziard
Hi all,

I created a fork of minetestmapper and added some functions I needed myself. I did a pull request on minetest/minetestmapper, but I closed it again, as I think I need to rework the code a bit.

The added functionality could be useful though, so I'll post a link here for anyone who wants to try:

https://github.com/wziard/minetestmapper

Quick example, generate a fully functioning slippy map in one command:

Code: Select all
minetestmapper -i input/ -o map.jpg --tilesize 1024x1024 --leaflet --buildpyramid --noemptyimage


This will generate (a lot of) tiles named '<zoom>_<x>_<-y>_map.jpg' and a html file named 'map.jpg.html'
copy all these to some folder on your webserver (or local machine of course) and add the leaflet.css and leaflet.js from the Leaflet/ subdir. Tadaa! working map.

The added flags are:

--tilesize WxH
tiled output. for if your map is too big to output in one go. Much faster than running minetestmapper in a loop with the --geometry option.

--leaflet
output tiles in a leaflet compatible format, and also output some ready-to use html just upload the tiles
and the html to your website to have a working slippy map.

--buildpyramid
when doing tiled output, will also generate downscaled tiles for leaflet so zooming out is faster.

known bugs/todo
-when one of the map dimensions is smaller than the tilesize, it crashes
-some variable names are re-used in an illogical manner.
Despite these minor bugs it works rather well at my site (sorry, private server used by my children, so I won't put a link here.)

I also already know how to fix those, but as I'm rather busy it'll be next week before I get around to doing it.

plan: (but no idea yet if feasible)
Make special sign nodes (maybe with some code in the sign) show up as markers on the map, so you can name stuff.

Re: Minetestmapper rewritten into C++

PostPosted: Thu Nov 15, 2018 14:14
by Linuxdirk
I wonder if we’ll ever get a decent isometric view from all four sides.

Re: Minetestmapper rewritten into C++

PostPosted: Thu Nov 15, 2018 14:51
by wziard
Linuxdirk wrote:I wonder if we’ll ever get a decent isometric view from all four sides.

Not with this utility. MinetestMapper has no idea how to actually render stuff and just uses a list of colors for each block. That would need to be an addon to the Minetest Client, which *does* know how to render stuff.

It would not be very hard to let MinetestMapper create 'side views' though, where you'd specify some cut-line. Could be an interesting addition to my fork :-)

Re: Minetestmapper rewritten into C++

PostPosted: Sun Nov 18, 2018 20:39
by wziard
Another addition to my fork at:
https://github.com/wziard/minetestmapper

This time I added a --marker option

--marker <nodename> will make minetestmapper output the locations off the requested node (on stdout) in the rendered area. (So only if it is within the rectangle specified with --geometry). I plan to use this to add placenames to my slippy map defined by signs put down in the world.

example: I have a minetest world with a signs_road:red_street_sign placed with the text "Paris". If I then generate my map with
Code: Select all
./minetestmapper -i MyWorld -o worldmap.png --marker signs_road:red_street_sign
it will output the following info on stdout:
Code: Select all
Marker signs_road:red_street_sign 256 10 1
"infotext":""Paris""
"display_text":"Paris"
"formspec":"size[6,3]field[0.5,0.7;5.5,1;display_text;Text;${display_text}]button_exit[2,2;2,1;ok;Write]"
EndMarker


I can then easily parse this info to put a marker named "Paris" on my online map.

As soon as I have the javascript side of the map working I'll try to put up a demo map somewhere.

P.S. @Sfan5 e.a. I won't do a pull request for this (yet) as I need to clean up the code a bit to keep the standard as high as the rest of the app. Also, I guess you'd think this would be outside the scope of the utility.
I must say, my utmost compliments to the author(s) of this program. Very clear code. Easy to build on.

Re: Minetestmapper rewritten into C++

PostPosted: Thu Nov 22, 2018 09:05
by wziard
Linuxdirk wrote:I wonder if we’ll ever get a decent isometric view from all four sides.


Experimental hacked minetestmapper, I just bruteforce it by drawing colored hexagons for all nodes from back to front :-) :

Be sure to watch the full zoom version.

Image
edit: whoops, I see I misaligned the blocks when manually stitching, I shoudl have aligned the upper-right, but I aligned lower-left by accident. Oh well, you get the idea.

Limitations:
- single color blocks
- only from one side atm
- produces tiles which you need to stitch together manually
- slooooooooow.

plans:
not really any plans with this specific code. To make a workable isometric viewer/exporter I'd need to start again (nicking the database code from minetestmapper maybe).

Re: Minetestmapper rewritten into C++

PostPosted: Sat Jan 12, 2019 13:09
by wziard
I experimented some more with the isometric output hacked into my fork of minetestmapper and this is the current output:

Image

Looks quite nice, but I really should get to work and write a utility which is geared towards isometric from the start because this is so slooooow :-)

But if you don't mind slow, the results are quite nice imho.

To make the height differences a bit more visible I somewhat shade the blocks by height, making height blocks more whiteish and lower blocks more dark.

Re: Minetestmapper rewritten into C++

PostPosted: Sat Jan 12, 2019 21:07
by Linuxdirk
Ah shit! That looks great, man! Good job. The last version is beautiful.

This outplays the “official” mapper by eons :) I hope this somehow makes it into an official release.

Re: Minetestmapper rewritten into C++

PostPosted: Sat Jan 12, 2019 22:12
by solars
I want test it!

I build https://github.com/wziard/minetestmapper/tree/iso.
What parameter must I use to get an ISO map?

Re: Minetestmapper rewritten into C++

PostPosted: Sun Jan 13, 2019 09:25
by wziard
Oh , documentation, I need to write some. :-) I'll update the docs later

int he meantime this is what I use:
Code: Select all
minetestmapper -i world/ -o isomap.png --tilesize 128x128 --isometric --drawalpha --noemptyimage --min-y -32 --scale 4


You can use --geometry to limit the area to an interesting part, because it will be very slow. You absolutely need the --tilesize (or --geomety) or the images will be huge :-).

This will result in both normal and isometric tiles. You can use the mergeiso utility (in the mergeiso subfolder) to stitch the isometric tiles into flattened tiles which fit together.

and then the 'buildpyramid' utility to create a zoom pyramid for a leaflet.js slippy map.

Oh, and you need the 'own' branch. I still need to tidy it for the iso branch.

Re: Minetestmapper rewritten into C++

PostPosted: Sun Jan 13, 2019 17:20
by solars
I love it!

Image
iso.jpg
(176.29 KiB) Not downloaded yet


1000 thanks wziard!

P.S.: The parameter "--scale 4" dosn't work: "option '--scale' is ambiguous; possibilities: '--scalecolor' '--scales'".
But I don't need it. I can scale the images with GIMP. :)