Minetestmapper rewritten into C++

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

by mireq » Post

Removed hardcoded size of image and added --geometry x:y+w+h option. New sources and binary are on github (https://github.com/mireq/minetest-mapper-cpp).

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

by LazyJ » Post

Ok, some more kitchen-testing with the latest version from Github (as of 2012_11_27 morning), Minetest v 0.4.3 and Ubuntu 12.04, 4gig ram

I played around with the "--geometry" option and here are some of the results:

--geometry -30000:-30000+100+100
Result: "Segmentation fault (core dumped)". Yes, there are some buildings out at -30,000x,-30,000y.

--geometry -20000:-20000+100+100
Result: About 15 to 20 minutes to produce a 33 byte (yup, 3-3-b-y-t-e) file that wouldn't load into Eye-of-Gnome (eog) nor GIMP.

--geometry -2000:-2000+4000+4000
Result: A 6.7mb file covering a 4000 x 4000 area starting in the lower left corner at -2000x, -2000y

--geometry -10000:-10000+20000+20000
Results: A 20.2mb file covering a 20,000 x 20,000 area staring in the lower left corner at -10,000x, -10,000y

I've noticed that the minetestmapper's "y" is different than Minetest's coordinates "y". In Minetest, the "y" is the vertical (heaven to hell, up and down) where in the minetestmapper, the "y" is the north and south, forward and reverse (like they taught me in geometry class).

The file size seems quite large for a flat, 2D map. I see that each node is already reduced to 1 pixel each. If rendering the full 60,000x60,000 map becomes possible, what other options could be exercised to reduce the file size? Greyscale instead of RGB? Lower resolution? Output format *.jpg instead of *.png? What about splitting the image into sections that could later be knitted together in a photo editor?

I hope this information is usefull in the further develpment of this nifty program.

User avatar
VanessaE
Moderator
Posts: 4511
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Program bugs and memory usage aside, about all you can to do shrink the file size further without losing important information is to use 8-bit color instead of 24-bit, assuming it doesn't already do that, use fewer color transitions (e.g. lose the shadows that give hills and tall objects some definition), don't save any metadata, and use maximum PNG compression on the file. You could also try cutting out all parts of the map that haven't been built on, fill those areas with solid white similar to how unexplored regions are drawn. That'll cut the size down some. Large swaths of solid colors compress better than regular map details.

You could indeed try converting such a map to JPG, which will probably cut the file size considerably, but it'll likely suffer horrible quality loss even at high quality settings.

You could also try scaling the map down 2:1 or maybe 3:1, but of course that will result in blurred details.

The best solution is probably to only export the portions of the map that have been built up, and stitch them together on a web page with thumbnails to make a clickable, zoomable map similar to the one ruberwardy maintains for redcrab's server.

Some of this has already been tried as you already know, and the results weren't necessarily all that great.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
Iqualfragile
Member
Posts: 160
Joined: Tue Sep 18, 2012 22:11

by Iqualfragile » Post

is ruberwardys script avivable to the public?

and try using optipng, it can reduce the filesize to one third
Gr8 b8, m8. I rel8, str8 appreci8, and congratul8. I r8 this b8 an 8/8. Plz no h8, I'm str8 ir8. Cr8 more, can't w8. We should convers8, I won't ber8, my number is 8888888, ask for N8. No calls l8 or out of st8. If on a d8, ask K8 to loc8. Even with a full pl8, I always have time to communic8 so don't hesit8.

User avatar
davidpace
Member
Posts: 685
Joined: Wed Oct 17, 2012 11:09
Location: United States

by davidpace » Post

I dunno.........
Iqualfragile wrote:is ruberwardys script avivable to the public?

and try using optipng, it can reduce the filesize to one third
Taking a break for a while see ya guys!

In some of my posts I will be putting "Secret" White sentences.. Tell me if you see them!!! :D

User avatar
VanessaE
Moderator
Posts: 4511
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

One thing I've noticed with this mapper is that it leaves lots of big holes all over my map image. By holes, I don't mean white spots, but rather little circular or square stone depressions in the land all over the place. Each of those spots has nodes that the mapper isn't familiar with, such as a conifer tree from cisoun's Conifers mod, white fencing from my Colored Woods mod, lighting blocks from my Home Decor mod, or most of the plants in my Plantlife modpack. One would assume nodes without a colors.txt entry would just be treated as air... :-)

Python version, as of minetest git commit 40dac4cd[...]:
Image

C++ version, as of mapper commit 7d15dbf4[...]:
Image

Don't mind the difference in colors, I've got an expanded colors.txt that I use with the python mapper.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
Casimir
Member
Posts: 1163
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

Can someone make a tutorial on how to use this?
Please.
Last edited by Casimir on Mon Dec 31, 2012 21:25, edited 1 time in total.

User avatar
VanessaE
Moderator
Posts: 4511
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

I was playing around with this again today and also noticed that it does not load the entire colors.txt file - many entries therein are skipped. Maybe it's due to the sheer number of entries are in mine, I dunno. This colors.txt is what I use with the python mapper.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

I was wondering if someone could make a version that i don't have to compile. Like a build or pre compiled version.
Coding;
1X coding
3X debugging
12X tweaking to be just right

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

by PilzAdam » Post

jojoa1997 wrote:I was wondering if someone could make a version that i don't have to compile. Like a build or pre compiled version.
You have to tell us wich OS you are using.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

Windows 7
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
Casimir
Member
Posts: 1163
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

jojoa1997 wrote:Windows 7
Me too. Please?

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

by Jordach » Post

Casimir wrote:
jojoa1997 wrote:Windows 7
Me too. Please?
Already is: https://github.com/mireq/minetest-mapper-cpp/downloads

Usage:

http://forum.minetest.net/viewtopic.php ... 321#p40321
Last edited by Jordach on Sat Jan 26, 2013 22:36, edited 1 time in total.
viewtopic.php?f=10&t=19056 Solar Plains Dev Server

User avatar
RAPHAEL
Member
Posts: 627
Joined: Tue Nov 01, 2011 09:09
Location: Earth

by RAPHAEL » Post

The map generates but am curious as to why it says this:

Code: Select all

Unknown nodes:
christmas:ligs
conifers:leaves
conifers:leaves_special
conifers:sapling
conifers:trunk
darkage:chalk
darkage:desert_stone_with_iron
darkage:mud
...
wool:black
wool:grey
wool:white
workbench:4x4
Edited by sfan5: Maybe use Pastebin for that?
Last edited by sfan5 on Sun Jan 27, 2013 10:00, edited 1 time in total.
"Before you speak, ask yourself: Is it kind, is it true, is it necessary, does it improve upon the silence?"
My mods: http://goo.gl/n4kpn
(Currently Various, Industrial, Fakeblocks, Jail, MoarCraft, Christmas, Replicator, minetest dev installer for linux, bash mod installer, windows mod installer)

User avatar
VanessaE
Moderator
Posts: 4511
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Download and copy this colors.txt file in place of the default one. It supports many different mods:

http://digitalaudioconcepts.com/vanessa ... colors.txt

Those nodes that are unrecognized just means that the mapper is supposed to ignore them (this doesn't work properly in the C++ mapper).
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

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

by Jordach » Post

RAPHAEL wrote:The map generates but am curious as to why it says this:

Code: Select all

Unknown nodes:
christmas:ligs
conifers:leaves
conifers:leaves_special
conifers:sapling
conifers:trunk
darkage:chalk
darkage:desert_stone_with_iron
darkage:mud
...
wool:black
wool:grey
wool:white
workbench:4x4
Edited by sfan5: Maybe use Pastebin for that?
It probably tells you what nodes it does not recognise.
viewtopic.php?f=10&t=19056 Solar Plains Dev Server

User avatar
RAPHAEL
Member
Posts: 627
Joined: Tue Nov 01, 2011 09:09
Location: Earth

by RAPHAEL » Post

VanessaE wrote:Download and copy this colors.txt file in place of the default one. It supports many different mods:

http://digitalaudioconcepts.com/vanessa ... colors.txt

Those nodes that are unrecognized just means that the mapper is supposed to ignore them (this doesn't work properly in the C++ mapper).
Thank you VanessaE.. here is my contribution to it (for now)
snow:snow 255 255 255
snow:snow_block 255 255 255
snow:ice 116 187 251
snow:dirt_with_snow 255 255 255

traps:cage 107 134 51

jail:jailwall 108 123 139

industrial:cement 108 123 139
industrial:asphalt 0 0 0
industrial:white_brick 255 255 255

stairs:slab_asphalt 0 0 0
stairs:slab_cement 108 123 139
stairs:stair_cement 108 123 139
stairs:stair_asphalt 0 0 0

lightsplus:light_on 255 255 255
lightsplus:slab_light 255 255 255
lightsplus:slab_light_on 255 255 255
lightsplus:slab_light_wall 255 255 255
lightsplus:slab_light_wall_on 255 255 255

maptools:glass 183 183 222
maptools:stone 128 128 128

more_fences:fence_cobble 123 123 123
more_fences:fence_iron 108 123 139
more_fences:fence_stone 128 128 128

various:lawngrass 107 134 51

scaffolding:scaffolding 104 78 42
EDIT: updated colors
Last edited by RAPHAEL on Sun Jan 27, 2013 19:38, edited 1 time in total.
"Before you speak, ask yourself: Is it kind, is it true, is it necessary, does it improve upon the silence?"
My mods: http://goo.gl/n4kpn
(Currently Various, Industrial, Fakeblocks, Jail, MoarCraft, Christmas, Replicator, minetest dev installer for linux, bash mod installer, windows mod installer)

User avatar
VanessaE
Moderator
Posts: 4511
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Thanks, Raphael. I've added your edited settings and updated the downloadable file.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
Casimir
Member
Posts: 1163
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

Jordach wrote:
Casimir wrote:
jojoa1997 wrote:Windows 7
Me too. Please?
Already is: https://github.com/mireq/minetest-mapper-cpp/downloads

Usage:

http://forum.minetest.net/viewtopic.php ... 321#p40321
It works! I love it!

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

Can anyone make a windows build for it?
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
Casimir
Member
Posts: 1163
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

See one post above.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

Casimir wrote:See one post above.
I mean a pre-compiled version
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
Casimir
Member
Posts: 1163
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

It is.
Download the file, download the colors.txt. Put both into the same folder. Press shift and rightclick into that folder (not on the files). Click "Open command window here" (or something similar). Then you type the line you see in the post linked by Jordach. That should work.
When you get an error make sure you have the right path, and try it with and without the \ at the end.

User avatar
VanessaE
Moderator
Posts: 4511
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

New revision to my colors.txt today to accommodate the latest moreblocks+stairsplus as well as adding a bunch of blocks on my server that weren't being covered before.

Get it from the same download location as mentioned above.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

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

by LazyJ » Post

Thanks, Vanessa!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest