Minetestmapper rewritten into C++

Post Reply
User avatar
Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

Re: Minetestmapper rewritten into C++

by Morn76 » Post

JPRuehmann wrote:Hello
Sorry I don´t understand what you are talking about.
What is a color.txt File, where must it located and what is its content?
At least where can I get it?
Thanks,
JPR
https://raw.githubusercontent.com/minet ... colors.txt

User avatar
JPRuehmann
Member
Posts: 334
Joined: Fri Mar 21, 2014 21:40
Location: Germany
Contact:

Re: Minetestmapper rewritten into C++

by JPRuehmann » Post

Thanks
But where do I put it?
minetestmapper is in /usr/local/bin/
JPR

User avatar
Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

Re: Minetestmapper rewritten into C++

by Morn76 » Post

I think the mapper always looks for it in your current working directory. I don't really see a way to have it search some global install location. Looks like the install portion of CMakeLists is broken, because colors.txt does not seem to get installed anywhere at all. Cmake is nice for building but terrible for installation. :-(

User avatar
JPRuehmann
Member
Posts: 334
Joined: Fri Mar 21, 2014 21:40
Location: Germany
Contact:

Re: Minetestmapper rewritten into C++

by JPRuehmann » Post

Aha
Good to know.
That´s a Bug then, I think.
Would be nice to Fix.
Thaks,
JPR

User avatar
Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

Re: Minetestmapper rewritten into C++

by Morn76 » Post

Maybe this is so you can easily have different colors.txt files in different directories, each tuned for different purposes and installed MT mods. I just clone the minetestmapper repo, do "cmake .; make" and run it from there. No need for a global install really.

User avatar
JPRuehmann
Member
Posts: 334
Joined: Fri Mar 21, 2014 21:40
Location: Germany
Contact:

Re: Minetestmapper rewritten into C++

by JPRuehmann » Post

That is no Problem in Linux and in Windows as I know to, sincer there is an Hirarchy.
lowest System wide File in /etc /usr/local/etc /usr/share/<programname> or /usr/local/share/<programname>.
next User File in ~/
next Programm specific in specific Programm Folder.
Highest in ./
I think that should be flexible and logical enough, since you can always override by putting a colors.txt in the local Directory.
But always knows that there is an colors .txt thlre.if you ant to use the commano elsewhere.
wTill then,
JPR

User avatar
Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

Re: Minetestmapper rewritten into C++

by Morn76 » Post

Sure, but you have to implement that in the code: "Search in working directory; if not found look here", etc. It doesn't happen automatically. Just opening "./colors.txt" is far easier.

I'm just surprised that the program does not at least exit with an error message if colors.txt is not found. Generating a completely black image is pretty useless. But as I said, it might simply be that nobody has installed this globally so far, so this problem went unnoticed.

Also, minetestmapper is primarily used by server admins I think, not so much regular MT users, so this might explain why it is less user friendly in that regard.

User avatar
sfan5
Moderator
Posts: 3892
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: Minetestmapper rewritten into C++

by sfan5 » Post

this file needs to be in the directory minetestmapper is run from.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

Re: Minetestmapper rewritten into C++

by Morn76 » Post

sfan5 wrote:this file needs to be in the directory minetestmapper is run from.
We already know that, the question was why there is no search path to look in global directories too. The cmake installer does not really do a complete install because it only installs the binary.

User avatar
sfan5
Moderator
Posts: 3892
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: Minetestmapper rewritten into C++

by sfan5 » Post

Morn76 wrote:
sfan5 wrote:this file needs to be in the directory minetestmapper is run from.
We already know that, the question was why there is no search path to look in global directories too. The cmake installer does not really do a complete install because it only installs the binary.
I did not notice your post, concerning the colors.txt file: complain to ShadowNinja about that, he wanted to change it.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
JPRuehmann
Member
Posts: 334
Joined: Fri Mar 21, 2014 21:40
Location: Germany
Contact:

Re: Minetestmapper rewritten into C++

by JPRuehmann » Post

I will Post on github to maybe I´am not right here.
But for Info.
If got it work now. I´m not completely happy how because of the restrictions. But it works.
first restriction it works only with the colors.txt that is in the github sources, at least I can´t find any other working colors.txt.
second restriction the colors.txt file must be in the same directory as the executable.
third the executable must be started from the Directory in which itsel and the colors.txt is located so you have to cd in the respective folder first.
If you only use it in and from mods that seems OK to me but if you want to use it as standalone command from the Command line it is quite a hazzle.
Thanks,
JPR

User avatar
stormchaser3000
Member
Posts: 419
Joined: Sun Oct 06, 2013 21:02
GitHub: stormchaser3000

Re: Minetestmapper rewritten into C++

by stormchaser3000 » Post

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
EDIT: nope still the same error in sfan5's fork

User avatar
sfan5
Moderator
Posts: 3892
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: Minetestmapper rewritten into C++

by sfan5 » Post

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.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
stormchaser3000
Member
Posts: 419
Joined: Sun Oct 06, 2013 21:02
GitHub: stormchaser3000

Re: Minetestmapper rewritten into C++

by stormchaser3000 » Post

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.

png support? i have libgd

User avatar
sfan5
Moderator
Posts: 3892
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: Minetestmapper rewritten into C++

by sfan5 » Post

stormchaser3000 wrote:
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.

png support? i have libgd
Yeah, but your copy of libgd seems to be missing png support.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

Re: Minetestmapper rewritten into C++

by Morn76 » Post

stormchaser3000 wrote: png support? i have libgd
Maybe you still have gd 1.x? You need gd 2.0 at least for PNG support I think. Gd 1 only outputs GIF.

User avatar
stormchaser3000
Member
Posts: 419
Joined: Sun Oct 06, 2013 21:02
GitHub: stormchaser3000

Re: Minetestmapper rewritten into C++

by stormchaser3000 » Post

i am using 2.1.0

User avatar
Argos
Member
Posts: 40
Joined: Tue Mar 04, 2014 21:47

Re: Minetestmapper rewritten into C++

by Argos » Post

To anyone interested: I have pushed some more changes I made to my version of minetestmapper.

Major features/changes since my previous post:
  • Merged all relevant patches by sfan5 and ShadowNinja (from minetest/minetestmapper)
  • A number of bugs were fixed
  • Alpha transparency merged & adapted / improved so that it works as expected.
  • Redis support merged.
  • Colors.txt is automatically searched for in different locations, and
    can also be specified on the command-line.
  • Colors.txt parsing is fixed & errors are now reported.
  • A grid can be drawn on the map.
  • Geometry is now node-accurate - no more mandatory rounding to map blocks.
    Even a 1x3 map is possible, for example.
    (rounding to block boundaries is also still supported)
  • Database backend to use is determined automatically from world.mt, but can also still be specified manually.
  • Additional points, lines, circles, rectangles or text can be drawn on the map, using world coordinates or map coordinates.
    Transparency is also supported (for circles and ellipses it does not work well though, due to a bug in libgd).
  • Parsing failures of map blocks from the database are now caught and reported; processing continues if
    they are limited in number.
  • Progress indicator
Previous changes & fixes, relative to minetest/minetestmapper:
  • Fixed the options --min-y and --max-y to work correctly
  • Ability to report actual world size and other information (with --verbose)
  • A map of the requested size can be generated (instead of it being reduced
    if the world is smaller).
  • Improved speed
For more detailed information, see the Changelog, or the README file.

Source on github

Examples of some of the features:

Original map, and map with 16x16 grid, aligned to block boundaries (but any grid size is supported):

Image
exampes1.png
(23.27 KiB) Not downloaded yet
A map with fixed dimensions (empty blocks are not trimmed). Same map with automatic shrinking to eliminate empty blocks (bottom-right), and a version where the map geometry does not follow block boundaries (top-right). Each map with a 16x16 grid to show the block boundaries.

Image
exampes2.png
(15.42 KiB) Not downloaded yet
A map with translucent water, and a map with additional figures and text, drawn by minetestmapper.

Image
exampes3.png
(160.9 KiB) Not downloaded yet

User avatar
Inocudom
Member
Posts: 3085
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

Re: Minetestmapper rewritten into C++

by Inocudom » Post

viewtopic.php?f=14&t=6920
Dan Duncombe made this neat program some time before he got banned. If only the same could be done for current minetestmapper programs.
You can now find my videos at BitChute: https://www.bitchute.com/channel/some_cheeky_jinuskian/

User avatar
JPRuehmann
Member
Posts: 334
Joined: Fri Mar 21, 2014 21:40
Location: Germany
Contact:

Re: Minetestmapper rewritten into C++

by JPRuehmann » Post

Hello that seems super, but if Itry to Compile I get the following errors.

Code: Select all

Scanning dependencies of target minetestmapper
[ 11%] Building CXX object CMakeFiles/minetestmapper.dir/PixelAttributes.cpp.o
[ 22%] Building CXX object CMakeFiles/minetestmapper.dir/PlayerAttributes.cpp.o                                                                              
[ 33%] Building CXX object CMakeFiles/minetestmapper.dir/TileGenerator.cpp.o                                                                                 
In file included from /home/ruehmann/minetest-mapper-cpp/TileGenerator.h:28:0,
                 from /home/ruehmann/minetest-mapper-cpp/TileGenerator.cpp:23:
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:15:22: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
  int &x = dimension[0];
                      ^
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:16:22: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
  int &y = dimension[1];
                      ^
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:17:22: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
  int &z = dimension[2];
                      ^
/home/ruehmann/minetest-mapper-cpp/BlockPos.h: In constructor ‘BlockPos::BlockPos()’:
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:23:15: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
  BlockPos() : dimension{0, 0, 0} {}
               ^
/home/ruehmann/minetest-mapper-cpp/BlockPos.h: In constructor ‘BlockPos::BlockPos(int, int, int)’:
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:24:37: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
  BlockPos(int _x, int _y, int _z) : dimension{_x, _y, _z} {}
                                     ^
/home/ruehmann/minetest-mapper-cpp/BlockPos.h: In copy constructor ‘BlockPos::BlockPos(const BlockPos&)’:
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:25:34: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
  BlockPos(const BlockPos &pos) : dimension{pos.x, pos.y, pos.z} {}
                                  ^
In file included from /home/ruehmann/minetest-mapper-cpp/TileGenerator.h:28:0,
                 from /home/ruehmann/minetest-mapper-cpp/TileGenerator.cpp:23:
/home/ruehmann/minetest-mapper-cpp/BlockPos.h: At global scope:
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:50:26: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
  bool &xBlock = isBlock[0];
                          ^
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:51:26: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
  bool &yBlock = isBlock[1];
                          ^
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:52:26: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
  bool &zBlock = isBlock[2];
                          ^
/home/ruehmann/minetest-mapper-cpp/BlockPos.h: In constructor ‘NodeCoord::NodeCoord()’:
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:54:28: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
  NodeCoord() : BlockPos(), isBlock{false, false, false} {}
                            ^
/home/ruehmann/minetest-mapper-cpp/BlockPos.h: In constructor ‘NodeCoord::NodeCoord(int, int, int)’:
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:55:60: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
  NodeCoord(int _x, int _y, int _z) : BlockPos(_x, _y, _z), isBlock{false, false, false} {}
                                                            ^
/home/ruehmann/minetest-mapper-cpp/BlockPos.h: In constructor ‘NodeCoord::NodeCoord(const BlockPos&, bool)’:
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:56:69: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
  NodeCoord(const BlockPos &pos, bool node = false) : BlockPos(pos), isBlock{pos.x == Any ? false : !node, pos.y == Any ? false : !node, pos.z == Any ? false : !node} {}
                                                                     ^
In file included from /home/ruehmann/minetest-mapper-cpp/TileGenerator.h:28:0,
                 from /home/ruehmann/minetest-mapper-cpp/TileGenerator.cpp:23:
/home/ruehmann/minetest-mapper-cpp/BlockPos.h: In copy constructor ‘NodeCoord::NodeCoord(const NodeCoord&)’:
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:57:55: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
  NodeCoord(const NodeCoord &coord) : BlockPos(coord), isBlock{coord.xBlock, coord.yBlock, coord.zBlock} {}
                                                       ^
/home/ruehmann/minetest-mapper-cpp/BlockPos.h: In constructor ‘NodeCoord::NodeCoord(int64_t)’:
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:58:25: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
  NodeCoord(int64_t i) : isBlock{true, true, true} { setFromDBPos(i); }
                         ^
/home/ruehmann/minetest-mapper-cpp/BlockPos.h: At global scope:
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:88:9: error: ‘hash’ is not a class template
  struct hash<NodeCoordHashed>
         ^
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:89:2: error: explicit specialization of non-template ‘std::hash’
  {
  ^
make[2]: *** [CMakeFiles/minetestmapper.dir/TileGenerator.cpp.o] Fehler 1
make[1]: *** [CMakeFiles/minetestmapper.dir/all] Fehler 2
make: *** [all] Fehler 2
How can I compile it?

Thanks,
JPR

User avatar
rubenwardy
Moderator
Posts: 6107
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Minetestmapper rewritten into C++

by rubenwardy » Post

The error above is:

Code: Select all

/home/ruehmann/minetest-mapper-cpp/BlockPos.h: At global scope:
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:88:9: error: ‘hash’ is not a class template
  struct hash<NodeCoordHashed>
         ^
/home/ruehmann/minetest-mapper-cpp/BlockPos.h:89:2: error: explicit specialization of non-template ‘std::hash’
  {
See http://stackoverflow.com/questions/1396 ... ion-in-c98

Your compiler seems to be outdated.

User avatar
Argos
Member
Posts: 40
Joined: Tue Mar 04, 2014 21:47

Re: Minetestmapper rewritten into C++

by Argos » Post

JPRuehmann wrote:Hello that seems super, but if Itry to Compile I get the following errors.

[error messages removed]

How can I compile it?

Thanks,
JPR
That seems to be a thing I missed while testing. Sorry about that.

It seems like a quick fix. I'll try and get it out tomorrow. In the mean time, set CMAKE_BUILD_TYPE to either "Debug" or "Release" when running cmake. E.g.:

Code: Select all

cmake -DCMAKE_BUILD_TYPE=Release .
The problem happens when CMAKE_BUILD_TYPE is not set (and also when set to an unexpected value).

Regards.

User avatar
philipbenr
Member
Posts: 1688
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

Re: Minetestmapper rewritten into C++

by philipbenr » Post

Inocudom wrote:viewtopic.php?f=14&t=6920
Dan Duncombe made this neat program some time before he got banned. If only the same could be done for current minetestmapper programs.
I think he is unbanned, but not coming back... He said he would be back, but I don't think so.

User avatar
Kilarin
Member
Posts: 778
Joined: Mon Mar 10, 2014 00:36

Re: Minetestmapper rewritten into C++

by Kilarin » Post

Am I understanding correctly that minetestmapper is no longer included with minetest, and I'll need to download one of the forks and compile it?

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

Re: Minetestmapper rewritten into C++

by Evergreen » Post

Kilarin wrote:Am I understanding correctly that minetestmapper is no longer included with minetest, and I'll need to download one of the forks and compile it?
No, the python one is still under /minetestdir/util/minetestmapper.py There just isn't a C++ mapper.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests