numpy-izing minetestmapper

falsegrayburger
Member
Posts: 158
Joined: Sat Aug 03, 2013 15:16
In-game: naro

by falsegrayburger » Post

Please red ver!

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

by paramat » Post

Amazing work! pixels per node will be very useful, look forward to using this once i install numpy.

spillz
Member
Posts: 138
Joined: Thu Feb 13, 2014 05:11

by spillz » Post

paramat wrote:Amazing work! pixels per node will be very useful, look forward to using this once i install numpy.
Cool! I encourage you to post images... Bug reports and feature requests welcome too.

I guess python is the ugly step child here. Too bad for me that you guys chose lua over python.

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

by paramat » Post

Image


Mandelbox mapgen plus paragenv7 mod biomes.
Finally got this working, it's amazing, really like the sideview and fog options, thanks for this.

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

by paramat » Post

Image


Mountain found in paragen mod.

spillz
Member
Posts: 138
Joined: Thu Feb 13, 2014 05:11

by spillz » Post

Paramat: very cool. I guess some of the blocks/chunks haven't been generated, which creates some of the discontinuity. Really like the look of the second one. Your different trees and biomes show up really nicely.

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

by paramat » Post

Yes those were sideviews of worlds instead of cross sections. Here's a central cross seciton of a flexrealm mod dyson sphere 2600x1200px, the rings are interference patterns in the clouds.


Image
Last edited by paramat on Mon Mar 24, 2014 04:20, edited 1 time in total.

spillz
Member
Posts: 138
Joined: Thu Feb 13, 2014 05:11

by spillz » Post

paramat wrote:Yes those were sideviews of worlds instead of cross sections. Here's a central cross seciton of a flexrealm mod dyson sphere 2600x1200px, the rings are interference patterns in the clouds.
Wow... 8D

(And I had no idea that clouds get drawn -- or is this a feature of you mod?)

spillz
Member
Posts: 138
Joined: Thu Feb 13, 2014 05:11

by spillz » Post

Latest update to the mapper. Let's go caving...

Code: Select all

 python minetestmapper-numpy.py worlds/stampyworld/ stampyugb.png --drawunderground --minheight -32
Image

Had no idea caves were so numerous. (Though maybe just bugs in my code?)

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

by paramat » Post

^ Good feature.
spillz wrote:(And I had no idea that clouds get drawn -- or is this a feature of you mod?)
Yeah those are stationary cloud nodes added by my mapgen.

thetoon
Member
Posts: 106
Joined: Tue Dec 11, 2012 12:55

by thetoon » Post

Am I the only one having trouble on 64bits python?

spillz
Member
Posts: 138
Joined: Thu Feb 13, 2014 05:11

by spillz » Post

thetoon wrote:Am I the only one having trouble on 64bits python?
What's the problem?

EDIT: If using python3, try pulling the latest version from my github repo. (Left in a python2 print statement)
Last edited by spillz on Thu Mar 27, 2014 21:52, edited 1 time in total.

thetoon
Member
Posts: 106
Joined: Tue Dec 11, 2012 12:55

by thetoon » Post

spillz wrote: What's the problem?

EDIT: If using python3, try pulling the latest version from my github repo. (Left in a python2 print statement)
I'm using Python 2.7, so it shouldn't be a python3 problem.

Still, when running the script, I got hundreds of the following statement :

Code: Select all

Traceback (most recent call last):
  File "./minetestmapper-numpy.py", line 707, in generate_map_info
    plist = map_block(mapdata, version, ypos, maxy, plist, cdata, hdata, dnddata, day_night_differs, id_map, ignore, air, face_swap_order)
  File "./minetestmapper-numpy.py", line 343, in map_block
    cdata[po] = content[opaques]
TypeError: Cannot cast array data from dtype('int64') to dtype('int32') according to the rule 'safe'
Error at (-72,-1,-47): Cannot cast array data from dtype('int64') to dtype('int32') according to the rule 'safe'
Traceback (most recent call last):
  File "./minetestmapper-numpy.py", line 707, in generate_map_info
    plist = map_block(mapdata, version, ypos, maxy, plist, cdata, hdata, dnddata, day_night_differs, id_map, ignore, air, face_swap_order)
  File "./minetestmapper-numpy.py", line 343, in map_block
    cdata[po] = content[opaques]
TypeError: Cannot cast array data from dtype('int64') to dtype('int32') according to the rule 'safe'
And the generated image contains nothing but blue sky (or whatever blue means).

spillz
Member
Posts: 138
Joined: Thu Feb 13, 2014 05:11

by spillz » Post

thetoon wrote: Still, when running the script, I got hundreds of the following statement :
Try pulling the latest version and testing again. I suspect it won't fix, but you never know...

What OS are you using? What version of minetest was the map made with? Have you tried on a different world? Also, try using the default colors.txt if you haven't already.

thetoon
Member
Posts: 106
Joined: Tue Dec 11, 2012 12:55

by thetoon » Post

Holy smokes, Batman! It works. Just pulling the latest version, and it worked. Out of the box. No need to change colors.txt or anything.

Congrats on the quickest fix ever :)

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

by paramat » Post

spillz, the cross section images facing north, south etc. work but have been reversed left to right, try comparing a cross section with an overhead view and you'll see.

spillz
Member
Posts: 138
Joined: Thu Feb 13, 2014 05:11

by spillz » Post

paramat wrote:spillz, the cross section images facing north, south etc. work but have been reversed left to right, try comparing a cross section with an overhead view and you'll see.
I thought I had fixed those issues. But thanks, I will look into it.

spillz
Member
Posts: 138
Joined: Thu Feb 13, 2014 05:11

by spillz » Post

Try the latest on my github repo (see here). It looks like north/south were reversed but not east/west, which I don't really understand. (Suspect there's another bug somewhere else)

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

by paramat » Post

Seriously, this mapper is the best thing to happen to Minetest since voxmynips.

EDIT tested and works, thanks.
Last edited by paramat on Sun Apr 13, 2014 00:38, edited 1 time in total.

spillz
Member
Posts: 138
Joined: Thu Feb 13, 2014 05:11

by spillz » Post

Update: Added LevelDB support

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

spillz wrote:Update: Added LevelDB support
Yay!


minetestmapper-numpy.py sais:

Code: Select all

Traceback (most recent call last):
  File "E:\Programme\minetest\util\minetestmapper-numpy.py", line 30, in <module
>
    import cStringIO
ImportError: No module named 'cStringIO'
please use

Code: Select all

import io

cStringIO.StringIO replace with io.StringIO
Edit: Any working py-leveldb out there for python 3.3?
Last edited by Krock on Sat Apr 19, 2014 09:15, edited 1 time in total.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

spillz
Member
Posts: 138
Joined: Thu Feb 13, 2014 05:11

Re: numpy-izing minetestmapper

by spillz » Post

Thanks re stringio.

This is probably as good as it gets but you will have to point it at a levedb dll and i would have to add support because the API is different: https://code.google.com/p/leveldb-py/

dgm5555
Member
Posts: 245
Joined: Tue Apr 08, 2014 19:45

Re: numpy-izing minetestmapper

by dgm5555 » Post

Using the code from the repo I get the following fatal error for a variety of commandlines :-(:
(running Ubuntu 14.04 python 2.7)

Code: Select all

~/.minetest/mods/minetest/util$ python minetestmapper-numpy.py ~/.minetest/worlds/stampyworld/ stampyugb.png --drawunderground --minheight -32
Result image (w=752 h=832) will be written to stampyugb.png
Error at (-23,3,-23): initial_value must be unicode or None, not buffer
Traceback (most recent call last):
  File "minetestmapper-numpy.py", line 619, in generate_map_info
    f = db.get(ps)
  File "minetestmapper-numpy.py", line 429, in get
    return io.StringIO(r[0])
TypeError: initial_value must be unicode or None, not buffer
Block data: Traceback (most recent call last):
  File "minetestmapper-numpy.py", line 1005, in <module>
    main()
  File "minetestmapper-numpy.py", line 1000, in main
    world.generate_map_info(str_to_uid)
  File "minetestmapper-numpy.py", line 781, in generate_map_info
    for c in r[0]:
NameError: global name 'r' is not defined
As a wild shot, I also tried python3 (after installing python3-numpy and python3-pil, but also errored with:-

Code: Select all

~/.minetest/mods/minetest/util$ python3 minetestmapper-numpy.py ~/.minetest/worlds/stampyworld/ stampyugb.png --drawunderground --minheight -32
Traceback (most recent call last):
  File "minetestmapper-numpy.py", line 1005, in <module>
    main()
  File "minetestmapper-numpy.py", line 987, in main
    uid_to_color, str_to_uid = load_colors()
  File "minetestmapper-numpy.py", line 198, in load_colors
    f = file("colors.txt")
NameError: name 'file' is not defined
Using minetestmapper.py instead of minetestmapper-numpy.py produces a png though:
python minetestmapper.py -i ~/.minetest/worlds/stampyworld/ stampyugb.png --drawunderground --minheight -32

dgm5555
Member
Posts: 245
Joined: Tue Apr 08, 2014 19:45

Re: numpy-izing minetestmapper

by dgm5555 » Post

BTW, is there any way of creating a mod which displays the pregenerated png as a map with player location (or even without would be cool).
Also wondering how difficult it would be to use the script to produce a 3D model which could be output to blender?

spillz
Member
Posts: 138
Joined: Thu Feb 13, 2014 05:11

Re: numpy-izing minetestmapper

by spillz » Post

Try changing all occurrences of StringIO to BytesIO and file to open.

Re pre generated map I am not sure. There are already in game mappers.

Re blender, probably not hard just need something to handle blender output

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests