Minetestmapper rewritten into C++

Post Reply
User avatar
mireq
New member
Posts: 7
Joined: Sat Aug 25, 2012 14:53

Minetestmapper rewritten into C++

by mireq » Post

There is now an official repository for this: https://github.com/minetest/minetestmapper
Windows downloads are available here.


I rewrote the minetestmapper.py tool to C++. It is at least 50 times faster than original.

Code: Select all

./minetest_mapper ...  6,96s user 0,16s system 99% cpu 7,181 total
python minetestmapper.py ... 531,58s user 1,66s system 99% cpu 8:55,13 total
Source code is on github (https://github.com/mireq/minetest-mapper-cpp).

Required dependencies are:
  • libgd
  • boost
  • sqlite3
Commandline arguments are the same as used in minetestmapper.py
Last edited by sfan5 on Wed May 06, 2020 10:06, edited 3 times in total.
Reason: .

User avatar
tonyka
Member
Posts: 320
Joined: Sat Jun 16, 2012 04:08
Location: Alicante, España

by tonyka » Post

such as do to compile?
there is no readme or install file...
I use linux ...
thanks
Last edited by tonyka on Wed Aug 29, 2012 16:18, edited 1 time in total.
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

tonyka wrote:such as do to compile?
there is no readme or install file...
I use linux ...
thanks

Code: Select all

$ cd /the/directory/of/minetestmapper/
$ cmake .
$ make .

User avatar
tonyka
Member
Posts: 320
Joined: Sat Jun 16, 2012 04:08
Location: Alicante, España

by tonyka » Post

not working
I do not know what I'm doing wrong ...
:(

Code: Select all

tony-ka@tonyka-HP-Compaq-dc7600-Small-Form-Factor:~/Escritorio/Minetest_compilado/minetest-mapper/mireq-minetest-mapper-cpp-5a2375e$ cmake .
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- 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
-- Found LibSqlite3: /usr/lib/x86_64-linux-gnu/libsqlite3.so 
-- Boost version: 1.46.1
-- Found the following Boost libraries:
--   system
--   filesystem
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tony-ka/Escritorio/Minetest_compilado/minetest-mapper/mireq-minetest-mapper-cpp-5a2375e
tony-ka@tonyka-HP-Compaq-dc7600-Small-Form-Factor:~/Escritorio/Minetest_compilado/minetest-mapper/mireq-minetest-mapper-cpp-5a2375e$ make .
tony-ka@tonyka-HP-Compaq-dc7600-Small-Form-Factor:~/Escritorio/Minetest_compilado/minetest-mapper/mireq-minetest-mapper-cpp-5a2375e$ 
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)

User avatar
Menche
Member
Posts: 1001
Joined: Sat Jul 02, 2011 00:43
IRC: Menchers
In-game: Menche
Location: An island in a lava lake.

by Menche » Post

Don't use the "." after "make".

Also, to speed up a large build, use the "-j#" option, where # is the number of cores + 1. My machine has 4 cores so I use "make -j5". To find the number of cores you have, run "grep -c processor /proc/cpuinfo".
Last edited by Menche on Wed Aug 29, 2012 18:58, edited 1 time in total.
An innocent kitten dies every time you top-post.

User avatar
Phitherek_
Member
Posts: 112
Joined: Thu Aug 23, 2012 16:17
Location: Kraków
Contact:

by Phitherek_ » Post

woah, and c55 added -j2 option permanently in the README for the engine on GitHub... I think he should explain this better...

EDIT: All right, in the -j# the # is number of THREADS and not CORES. So -j2 is for two-threaded one core processor. Menche, you can switch to -j8 then ;).
Last edited by Phitherek_ on Wed Aug 29, 2012 21:18, edited 1 time in total.
---
Posted by Phitherek_

User avatar
RabbiBob
Member
Posts: 335
Joined: Sat Jan 28, 2012 22:40
Location: /teleport 54,47,28
Contact:

by RabbiBob » Post

Nice work, the Win binary worked right off the mark. I noted that I had an odd issue with the .py that didn't happen in the .exe:

.exe on the left, no odd marks like on the right.

Image

Would you be interesting in adding mod color schemes to the colors.txt (if so, see here)?
Last edited by RabbiBob on Thu Aug 30, 2012 01:33, edited 1 time in total.

User avatar
mireq
New member
Posts: 7
Joined: Sat Aug 25, 2012 14:53

by mireq » Post

@tonyka: Readme is really missing. README.md will be added in the coming days.

@Menche: In this case, the differences are small:

Code: Select all

make -j 1  7,07s user 0,79s system 98% cpu 7,991 total
make -j 2  7,08s user 0,84s system 121% cpu 6,506 total
make -j 3  7,15s user 0,87s system 135% cpu 5,918 total
@RabbiBob: added, thanks.

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

Can we have some arguments please?

Here is the contents:

Code: Select all

minetest_mapper.exe -i C:\Documents and Settings\Jordan\Desktop\Minetest 0.4.2\worlds\city\ -o output_file.png
And the world SHOULD work. But it does not generate any .png anywhere.
Last edited by Jordach on Thu Aug 30, 2012 11:08, edited 1 time in total.

User avatar
tonyka
Member
Posts: 320
Joined: Sat Jun 16, 2012 04:08
Location: Alicante, España

by tonyka » Post

thank you all, but I have not managed to compile ...
compile and tells me not find GD.h
according to forums related to GD, gives problems in ubuntu, but can not find the solution...
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)

Nemo08
Member
Posts: 132
Joined: Mon Dec 26, 2011 04:59

by Nemo08 » Post

tonyka wrote:thank you all, but I have not managed to compile ...
compile and tells me not find GD.h
according to forums related to GD, gives problems in ubuntu, but can not find the solution...

Code: Select all

apt-get install libgd2-xpm-dev libboost-all-dev libgd-tools
for 12.04
Last edited by Nemo08 on Thu Aug 30, 2012 19:57, edited 1 time in total.

User avatar
tonyka
Member
Posts: 320
Joined: Sat Jun 16, 2012 04:08
Location: Alicante, España

by tonyka » Post

hey thanks ...
has replaced some libraries and ...
It works!
wondering, you get to Rome!
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)

User avatar
RabbiBob
Member
Posts: 335
Joined: Sat Jan 28, 2012 22:40
Location: /teleport 54,47,28
Contact:

by RabbiBob » Post

Jordach wrote:Can we have some arguments please?

Here is the contents:

Code: Select all

minetest_mapper.exe -i C:\Documents and Settings\Jordan\Desktop\Minetest 0.4.2\worlds\city\ -o output_file.png
And the world SHOULD work. But it does not generate any .png anywhere.
Try one of two things:

Add " around the path

Code: Select all

minetest_mapper.exe -i "C:\Documents and Settings\Jordan\Desktop\Minetest 0.4.2\worlds\city" -o output_file.png
or
  • Create a util directory at C:\Documents and Settings\Jordan\Desktop\Minetest 0.4.2\
  • Put minetest_mapper.exe and color.txt in C:\Documents and Settings\Jordan\Desktop\Minetest 0.4.2\util\
  • Create map.bat and put the following in it:
    • minetest_mapper.exe -i ../worlds/city/ -o output.png
  • Save it and run the bat file
The latter way gives you a quick double click way of running the mapper.

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

Thanks RabbiBob.

User avatar
tonyka
Member
Posts: 320
Joined: Sat Jun 16, 2012 04:08
Location: Alicante, España

by tonyka » Post

wow is fast and furious :D
is like comparing a moped with a Bugatti Veyron 8.0 W16 Super Sport 1200 hp
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

Here is my colour sheet so far;

Code: Select all

default:stone 128 128 128
default:stone_with_coal 50 50 50
default:water_flowing 39 66 106
default:torch 255 255 0
default:water_source 39 66 106
default:sign_wall 117 86 41
default:chest 128 79 0
default:furnace 118 118 118
default:fence_wood 103 78 42
default:rail 162 119 53
default:ladder 154 110 40
default:lava_flowing 255 100 0
default:lava_source 255 100 0
default:dirt_with_grass 107 134 51
default:tree 86 58 31
default:leaves 48 95 8
default:dirt_with_grass_and_footsteps 102 129 38
default:mese 178 178 0
default:dirt 101 84 36
default:wood 104 78 42
default:sand 210 194 156
default:cobble 123 123 123
default:steelblock 199 199 199
default:glass 183 183 222
default:mossycobble 219 202 178
default:gravel 70 70 70
default:sandstone 204 0 0
default:cactus 0 215 0
default:brick 170 50 25
default:clay 104 78 42
default:papyrus 58 105 18
default:bookshelf 196 160 0
default:jungletree 205 190 121
default:junglegrass 62 101 25
default:nyancat 255 153 255
default:nyancat_rainbow 102 50 255
default:apple 200 0 0
default:desert_sand 210 194 156
default:desert_stone 210 194 156
default:dry_shrub 100 80 40

moreores:gold_block 255 255 51
moreores:mithril_block 51 204 255

moreblocks:junglewood 255 204 153
moreblocks:stonebrick 128 128 128
moreblocks:circlestonebrick 128 128 128
moreblocks:ironstonebrick 180 180 180
moreblocks:stonesquare 128 128 128
moreblocks:splitstonesquare 128 128 128
moreblocks:plankstone 128 128 128
moreblocks:ironglass 120 120 120
moreblocks:coalglass 70 70 70
moreblocks:cleanglass 183 183 222
moreblocks:cactusbrick 0 215 0
moreblocks:cactuschecker 0 215 0
moreblocks:emptybookshelf 196 160 0
moreblocks:oerkkiblock 153 51 204
moreblocks:coalstone 90 90 90
moreblocks:ironstone 120 120 120
moreblocks:coalchecker 120 120 120
moreblocks:ironchecker 170 170 170
moreblocks:trapstone 128 128 128
moreblocks:trapglass 183 183 222
moreblocks:fence_junglewood 255 204 153
moreblocks:horizontaltree 48 95 8
moreblocks:horizontaljungletree 48 95 8
moreblocks:allfacestree 48 95 8
moreblocks:glowglass 240 240 0
moreblocks:superglowglass 240 240 0
moreblocks:rope 0 240 0

stairs:stair_wood 196 160 0
stairs:slab_wood 196 160 0
stairs:stair_stone 128 128 128
stairs:slab_stone 128 128 128
stairs:stair_cobble 128 128 128
stairs:slab_cobble 128 128 128
stairs:stair_brick 170 50 25
stairs:slab_brick 170 50 25
stairs:stair_sandstone 204 0 0
stairs:slab_sandstone 204 0 0
stairs:stair_steelblock 190 190 190
stairs:slab_steelblock 190 190 190
stairs:stair_gold 255 255 51
stairs:slab_gold 255 255 51
stairs:stair_diamond 51 204 255
stairs:slab_diamond 51 204 255

glowstone:glowstone 255 204 0

xfences:fence 103 78 42
xfences:fence_1 103 78 42
xfences:fence_2 103 78 42
xfences:fence_3 103 78 42
xfences:fence_4 103 78 42
xfences:fence_5 103 78 42
xfences:fence_6 103 78 42
xfences:fence_7 103 78 42
xfences:fence_8 103 78 42
xfences:fence_9 103 78 42
xfences:fence_10 103 78 42
xfences:fence_11 103 78 42
xfences:fence_12 103 78 42
xfences:fence_13 103 78 42
xfences:fence_14 103 78 42
xfences:fence_15 103 78 42
Note that steelblock, gold and diamond stairs are only in my own gamemode. And half of moreores is supoorted.
Last edited by Jordach on Fri Aug 31, 2012 15:20, edited 1 time in total.

User avatar
mrtux
Member
Posts: 141
Joined: Mon Jun 25, 2012 02:41
Contact:

by mrtux » Post

This should be included with Minetest's Windows bianaries. +1000
thanks doge

User avatar
nomohakon
Member
Posts: 219
Joined: Fri Aug 10, 2012 16:34
IRC: nomohakon
In-game: nomohakon
Location: VanessaE's servers

by nomohakon » Post

If it only can create heightmaps... can it?

EDIT: greyscale heightmaps.

One question. How to add new blocks to mapping process, ie gloopblocks:cement.
Last edited by nomohakon on Tue Oct 09, 2012 16:39, edited 1 time in total.
"To learn who rules over you, simply find out who you are not allowed to criticize." - Voltaire
"Knowledge, like air, is vital to life. Like air, no one should be denied it." - Alan Moore, V for Vendetta
- - -
"To never die... and to conquer all, that is winning." ―Illyria

User avatar
LazyJ
Member
Posts: 687
Joined: Wed Sep 12, 2012 12:29
Location: Podunk, Nowhere, USA

by LazyJ » Post

I haven't been able to get a rendering of the full map.

Both mappers (python and c++) only generate an area from (+/-) 1472 x (+/-) 1472. I used the "--drawscale" option to confirm this range.

I've been to two, opposite far corners (-30000 to +30000) and built stuff just to make sure something is registered in the world and yet the mapper programs won't extend to that range.

I've checked the "--help" for clues to see if there was some sort of range option or limiter... no luck.

-i/--input <world_path>
-o/--output <output_image.png>
--bgcolor <color>
--scalecolor <color>
--playercolor <color>
--origincolor <color>
--drawscale
--drawplayers
--draworigin
Color format: '#000000'

Any ideas?
Last edited by LazyJ on Sat Nov 10, 2012 14:52, edited 1 time in total.

User avatar
LazyJ
Member
Posts: 687
Joined: Wed Sep 12, 2012 12:29
Location: Podunk, Nowhere, USA

by LazyJ » Post

*bump*

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

where is the default background color set? id like to change it to black i keep forgetting the cmd line argument lol

User avatar
LazyJ
Member
Posts: 687
Joined: Wed Sep 12, 2012 12:29
Location: Podunk, Nowhere, USA

by LazyJ » Post

mauvebic wrote:where is the default background color set? id like to change it to black i keep forgetting the cmd line argument lol
This is from the minetestmapper "--help" from both the python and c++ versions:

-i/--input <world_path>
-o/--output <output_image.png>
--bgcolor <color>
--scalecolor <color>
--playercolor <color>
--origincolor <color>
--drawscale
--drawplayers
--draworigin
Color format: '#000000'


Perhaps "--bgcolor #000000" is what you are looking for? I haven't tried changing the colors yet to know what happens.
Last edited by LazyJ on Thu Nov 15, 2012 17:44, edited 1 time in total.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

i meant change the default in the source code so i dont have to use that argument - cant find what line the defaults' on :p
Last edited by mauvebic on Thu Nov 15, 2012 20:27, edited 1 time in total.

User avatar
LazyJ
Member
Posts: 687
Joined: Wed Sep 12, 2012 12:29
Location: Podunk, Nowhere, USA

by LazyJ » Post

*bump*

Anyway to expand the minetestmapper's ability to create an image of the full world map (30000+)?

User avatar
LazyJ
Member
Posts: 687
Joined: Wed Sep 12, 2012 12:29
Location: Podunk, Nowhere, USA

by LazyJ » Post

*bump*

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests