Minetestmapper rewritten into C++

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

Re: Minetestmapper rewritten into C++

by sfan5 » Post

You should be able to hold shift and right click into the explorer windows and start a shell by choosing the "Start command line here" (or similar) option.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

est31
Developer
Posts: 173
Joined: Mon Dec 29, 2014 01:49

Re: Minetestmapper rewritten into C++

by est31 » Post

Hi Argos, I have a build failure with the latest commit: https://gist.github.com/anonymous/c894b3737759127fbae4
Adding the following line to the file db.h made it build:

#define __STDC_LIMIT_MACROS

This page gives more explanations why.
Can you add that line?

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

Re: Minetestmapper rewritten into C++

by Argos » Post

est31 wrote:Hi Argos, I have a build failure with the latest commit: https://gist.github.com/anonymous/c894b3737759127fbae4
Adding the following line to the file db.h made it build:

#define __STDC_LIMIT_MACROS

This page gives more explanations why.
Can you add that line?
Hi est31,

I did some initial investigation, and found this additional information: https://sourceware.org/bugzilla/show_bug.cgi?id=15366 . I don't know if you are compiling according to the standard C++11 (this is reported when running

Code: Select all

cmake .
). If you are, it seems the cause may be a bug in your stdint.h (which is not being compatible with C++11)...

I'll investigate further, and make a patch if necessary. I am quite busy at the moment, but I hope I'll manage somewhere next week - depending on the amount of work involved.

It would be helpful if you could provide some additional information on your environment, so that I can try and reproduce the problem: which distribution and distribution release are you using ? Which compiler and compiler version ? Which version of glibc (or other C library) ? Does cmake report that it is using C++11 or C++0x ?

I also get the impression that a fix for this problem might possibly be for minetestmapper to include 'cstdint' instead of 'stdint.h'. I pushed a quick patch to a new 'stdint' branch. Could you test that, to see whether it solves your problem ?
My mods & tools:
My fork of Minetestmapper - much improved - features, manual, Windows downloads
[MOD] Wrench (rotate:wrench) - improved screwdriver alternative - manual, download

est31
Developer
Posts: 173
Joined: Mon Dec 29, 2014 01:49

Re: Minetestmapper rewritten into C++

by est31 » Post

Yes, cmake reports C++11 usage. The changes from the stdint make it compile.

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

Re: Minetestmapper rewritten into C++

by Argos » Post

est31 wrote:Yes, cmake reports C++11 usage. The changes from the stdint make it compile.
Thanks. Made the fix definitive & pushed it to the master branch.

I changed the commit message, so the actual commit is not the same as the previous one from the (now deleted) stdint branch.
My mods & tools:
My fork of Minetestmapper - much improved - features, manual, Windows downloads
[MOD] Wrench (rotate:wrench) - improved screwdriver alternative - manual, download

AsgardBeast
New member
Posts: 4
Joined: Tue Jun 09, 2015 22:41
GitHub: AsgardBeast
IRC: AsgardBeast
In-game: AsgardBeast
Location: United States
Contact:

Re: Minetestmapper rewritten into C++

by AsgardBeast » Post

Alright so I thought I would put these here for those that would like them. After searching for compiled executable for Linux I just decided to build my own. I hate having to build compiled code because of all the "dependencies" that must be installed that I will never use again. I figure there may be others who feel the same way. These were built on Debian 8.1 and may not work on all systems. It will just depend on your particular build. I have also written a script that should make compiling the executable a little easier for those who want the steps automated. Again this script was written on and for Debian based systems. I'm not sure how much use these will be to anyone but since I had them available I thought I would make the accessible to those that want to try them out.

The Build Script : http://minetest.elysianhome.net/files/b ... testmapper
This script should put the binaries in your home directory under a MineTestMapper folder. (assuming it works at all)

32Bit Systems : http://minetest.elysianhome.net/files/m ... x32.tar.gz
This package includes the binary, a tarball with the binary and docs, and a deb package.

64Bit Systems : http://minetest.elysianhome.net/files/m ... x64.tar.gz
This package includes the binary, a tarball with the binary and docs, and a deb package.
"If you wish to solve the mysteries of the universe. You must think in terms of energy, frequency, and vibration." - Nikola Tesla

Ivà
Member
Posts: 115
Joined: Sun Feb 22, 2015 07:11
GitHub: melzua
IRC: melzua
In-game: melzua
Location: Catalonia

Re: Minetestmapper rewritten into C++

by Ivà » Post

Thankyou @AsgardBeast

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Minetestmapper rewritten into C++

by paramat » Post

When i run the following command or add any colour option the mapper fails and the error message below appears.

$ ./minetestmapper -i ~/minetestf/gitmods/minetest/worlds/m2/ -o ~/m2map.png --bgcolor #000000

./minetestmapper: option '--bgcolor' requires an argument

AsgardBeast
New member
Posts: 4
Joined: Tue Jun 09, 2015 22:41
GitHub: AsgardBeast
IRC: AsgardBeast
In-game: AsgardBeast
Location: United States
Contact:

Re: Minetestmapper rewritten into C++

by AsgardBeast » Post

paramat wrote:When i run the following command or add any colour option the mapper fails and the error message below appears.

$ ./minetestmapper -i ~/minetestf/gitmods/minetest/worlds/m2/ -o ~/m2map.png --bgcolor #000000

./minetestmapper: option '--bgcolor' requires an argument
Try this instead;

./minetestmapper -i ~/minetestf/gitmods/minetest/worlds/m2/ -o ~/m2map.png --bgcolor '#000000'

Hashtags on the command line don't work very well when left out in the open. Quote the #COLORS and you should be fine.
"If you wish to solve the mysteries of the universe. You must think in terms of energy, frequency, and vibration." - Nikola Tesla

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Minetestmapper rewritten into C++

by paramat » Post

Thanks it works now.

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

Re: Minetestmapper rewritten into C++

by Argos » Post

A note to those who haven't seen it yet: @addi created a nice GUI for minetestmapper. See this page.
My mods & tools:
My fork of Minetestmapper - much improved - features, manual, Windows downloads
[MOD] Wrench (rotate:wrench) - improved screwdriver alternative - manual, download

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

Re: Minetestmapper rewritten into C++

by Sergey » Post

I can't install minetestmapper from AUR: https://aur.archlinux.org/packages/minetestmapper-git/

I start the process with

Code: Select all

yaourt -S minetestmapper-git
Then some dependencies are suggested to install from repo first: gperftools, libuv, snappy, cmake, gd, leveldb.

All of this seems to be installed correctly.

Then configuring of minetestmapper starts. And finishes like this:

Code: Select all

-- The CXX compiler identification is GNU 6.2.1
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- libgd library: /usr/lib64/libgd.so
-- libgd headers: /usr/include
-- zlib library: /usr/lib64/libz.so
-- zlib headers: /usr/include
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- sqlite3 library: /usr/lib64/libsqlite3.so
-- sqlite3 headers: /usr/include
-- Could NOT find PostgreSQL (missing:  PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR) 
-- PostgreSQL not found!
-- LevelDB library: /usr/lib64/libleveldb.so
-- LevelDB headers: /usr/include/leveldb
-- LevelDB backend enabled
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
POSTGRESQL_LIBRARY
    linked by target "minetestmapper" in directory /tmp/yaourt-tmp-sergey/aur-minetestmapper-git/src/minetestmapper

-- Configuring incomplete, errors occurred!
See also "/tmp/yaourt-tmp-sergey/aur-minetestmapper-git/src/minetestmapper/CMakeFiles/CMakeOutput.log".
Any ideas what is wrong?

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

Re: Minetestmapper rewritten into C++

by sfan5 » Post

Fixed that here: https://github.com/minetest/minetestmap ... ee1dcdf560

Also the PKGBUILD could use some updates, minetestmapper supports proper share paths and colors.txt no longer needs to be in current directory.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

Re: Minetestmapper rewritten into C++

by Sergey » Post

Thank you very much! I just compiled the program.

But I still have one little question. I tried to test the example from wiki [http://wiki.minetest.net/Minetestmapper].

Code: Select all

minetestmapper --geometry -10000:-10000+20000+20000 --drawscale -i ~/.minetest/worlds/my_world/ -o my_world.png
And the output is:

Code: Select all

Warning: Falling back to using colors.txt from current directory.
Exception: Specified colors file could not be found
You just said there is no need for colors.txt file.

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

Re: Minetestmapper rewritten into C++

by Sergey » Post

And the second question.

I, however, downloaded colors.txt file from the URL mentioned in wiki [http://wiki.minetest.net/Minetestmapper]. By the way, that URL is wrong. That URL is http://digitalaudioconcepts.com/vanessa ... colors.txt but correct is http://daconcepts.com/vanessa/hobbies/m ... colors.txt

I put that colors.txt in folder, cd to it, launched the command above, and I got image with white gaps like in attached screenshot [http://imageup.ru/s2654441]

Why is that?

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

Re: Minetestmapper rewritten into C++

by sfan5 » Post

That's perfectly normal, the white gaps happen in places where the world was not generated yet.
Since the world is only generated when a player walks near the area this happens often.

Also there is a colors.txt that comes with minetestmapper, VanessaE's colors file is useful only if you have mods in your world.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

Re: Minetestmapper rewritten into C++

by Sergey » Post

sfan5 wrote:That's perfectly normal, the white gaps happen in places where the world was not generated yet.
Since the world is only generated when a player walks near the area this happens often.

Also there is a colors.txt that comes with minetestmapper, VanessaE's colors file is useful only if you have mods in your world.
But as I said minetestmapper protests when there is no colors.txt in current directory.
Last edited by Sergey on Sun Jan 15, 2017 22:10, edited 1 time in total.

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

Re: Minetestmapper rewritten into C++

by sfan5 » Post

Sergey wrote:
sfan5 wrote:That's perfectly normal, the white gaps happen in places where the world was not generated yet.
Since the world is only generated when a player walks near the area this happens often.

Also there is a colors.txt that comes with minetestmapper, VanessaE's colors file is useful only if you have mods in your world.
But as I said minetestmapper protests when there is no colors.txt in current dicrectory.
There should be a colors.txt that comes with minetestmapper as you can see here: https://github.com/minetest/minetestmap ... colors.txt
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

AsgardBeast
New member
Posts: 4
Joined: Tue Jun 09, 2015 22:41
GitHub: AsgardBeast
IRC: AsgardBeast
In-game: AsgardBeast
Location: United States
Contact:

Re: Minetestmapper rewritten into C++

by AsgardBeast » Post

Sergey wrote:
sfan5 wrote:That's perfectly normal, the white gaps happen in places where the world was not generated yet.
Since the world is only generated when a player walks near the area this happens often.

Also there is a colors.txt that comes with minetestmapper, VanessaE's colors file is useful only if you have mods in your world.
But as I said minetestmapper protests when there is no colors.txt in current dicrectory.
The minetestmapper DOES need a colors.txt, it just doesn't require it to be in the same directory. You can use the

Code: Select all

--colors /path/to/location/colors.txt
to tell it where the colors.txt is located.

As well the "white" sections of the map you created are "unexplored" territory. The original minetestmapper had these areas "black" in color but that was changed in the C++ build at some point to default to "white". If you want to change the color of the "unexplored" territory you can use the

Code: Select all

--bgcolor '#000000'
to change it.
"If you wish to solve the mysteries of the universe. You must think in terms of energy, frequency, and vibration." - Nikola Tesla

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

Re: Minetestmapper rewritten into C++

by Sergey » Post

OK. I created new directory, cd to it, launch the command

Code: Select all

$ minetestmapper --geometry -100:-100+200+200 --drawscale --draworigin --drawalpha -i ~/.minetest/worlds/my_world/ -o my_world.png
Output:

Code: Select all

Warning: Falling back to using colors.txt from current directory.
Exception: Specified colors file could not be found
How can you explain this?

AsgardBeast
New member
Posts: 4
Joined: Tue Jun 09, 2015 22:41
GitHub: AsgardBeast
IRC: AsgardBeast
In-game: AsgardBeast
Location: United States
Contact:

Re: Minetestmapper rewritten into C++

by AsgardBeast » Post

Sergey wrote:OK. I created new directory, cd to it, launch the command

Code: Select all

$ minetestmapper --geometry -100:-100+200+200 --drawscale --draworigin --drawalpha -i ~/.minetest/worlds/my_world/ -o my_world.png
Output:

Code: Select all

Warning: Falling back to using colors.txt from current directory.
Exception: Specified colors file could not be found
How can you explain this?
Was the minetestmapper executable AND the colors.txt file in the same directory you created and were in when you ran the minetestmapper executable located within THAT directory?

Just having the colors.txt file in the directory you are executing the minetestmapper command from doesn't tell minetestmapper WHERE the colors.txt file is located. Unless you specifically tell it otherwise, minetestmapper is going to fall back the located colors.txt file.

Here is an example;

Code: Select all

minetestmapper --geometry -100:-100+200+200 --drawscale --draworigin --drawalpha -i ~/.minetest/worlds/my_world/ -o my_world.png --colors /location/of/your/colors.txt
If you do not know the location of your colors.txt file then find the one that should have come with the minetestmapper files that you downloaded or complied from.

It would appear from your previous posts that you have successfully created an image with the utility so I have to ask why this is even an issue?
"If you wish to solve the mysteries of the universe. You must think in terms of energy, frequency, and vibration." - Nikola Tesla

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

Re: Minetestmapper rewritten into C++

by Sergey » Post

Of course, minetestmapper IS EXECUTABLE. We are talking about C++ program, not about python script (which may or may not be executable).

As I said, I created new directory. So, it is empty after creation. And therefore there is no colors.txt in it.

My actions (in order for you to understand):

Code: Select all

$ mkdir dir1
$ cd dir1
$ minetestmapper --geometry -100:-100+200+200 --drawscale --draworigin --drawalpha -i ~/.minetest/worlds/my_world/ -o my_world.png

Warning: Falling back to using colors.txt from current directory.
Exception: Specified colors file could not be found
From what sfan5 said I understand that if there is no colors.txt in current directory and you don't specify path to it explicitly with --colors switch, then minetestmapper should use its own default colors.txt installed with it.

But it doesn't. That's the problem.

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

Re: Minetestmapper rewritten into C++

by sfan5 » Post

How did you install minetestmapper and which version did you install?
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

Re: Minetestmapper rewritten into C++

by Sergey » Post

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.

Code: Select all

yaourt -S minetestmapper-git
That's it.

P.S. I have Manjaro Linux, it is ArchLinux based distro.

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: Minetestmapper rewritten into C++

by taikedz » Post

Sergey wrote:My actions (in order for you to understand):

Code: Select all

$ mkdir dir1
$ cd dir1
$ minetestmapper --geometry -100:-100+200+200 --drawscale --draworigin --drawalpha -i ~/.minetest/worlds/my_world/ -o my_world.png

Warning: Falling back to using colors.txt from current directory.
Exception: Specified colors file could not be found
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.

You want to execute

Code: Select all

minetestmapper --colors $PATH_TO_COLOURS_TXT <and the rest of your stuff>

Post Reply

Who is online

Users browsing this forum: cHyper and 7 guests