numpy-izing minetestmapper
-
- Member
- Posts: 158
- Joined: Sat Aug 03, 2013 15:16
- In-game: naro
- paramat
- Developer
- Posts: 3700
- Joined: Sun Oct 28, 2012 00:05
- GitHub: paramat
- IRC: paramat
- Location: UK
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.
Last edited by paramat on Mon Mar 24, 2014 04:20, edited 1 time in total.
Latest update to the mapper. Let's go caving...
Had no idea caves were so numerous. (Though maybe just bugs in my code?)
Code: Select all
python minetestmapper-numpy.py worlds/stampyworld/ stampyugb.png --drawunderground --minheight -32
Had no idea caves were so numerous. (Though maybe just bugs in my code?)
What's the problem?thetoon wrote:Am I the only one having trouble on 64bits python?
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.
I'm using Python 2.7, so it shouldn't be a python3 problem.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)
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'
Try pulling the latest version and testing again. I suspect it won't fix, but you never know...thetoon wrote: Still, when running the script, I got hundreds of the following statement :
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.
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Yay!spillz wrote:Update: Added LevelDB support
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'
Code: Select all
import io
cStringIO.StringIO replace with io.StringIO
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>
Re: numpy-izing minetestmapper
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/
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/
Re: numpy-izing minetestmapper
Using the code from the repo I get the following fatal error for a variety of commandlines :-(:
(running Ubuntu 14.04 python 2.7)
As a wild shot, I also tried python3 (after installing python3-numpy and python3-pil, but also errored with:-
Using minetestmapper.py instead of minetestmapper-numpy.py produces a png though:
python minetestmapper.py -i ~/.minetest/worlds/stampyworld/ stampyugb.png --drawunderground --minheight -32
(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
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
python minetestmapper.py -i ~/.minetest/worlds/stampyworld/ stampyugb.png --drawunderground --minheight -32
Re: numpy-izing minetestmapper
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?
Also wondering how difficult it would be to use the script to produce a 3D model which could be output to blender?
Re: numpy-izing minetestmapper
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
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
Who is online
Users browsing this forum: No registered users and 7 guests