minetest / minetestmapper

Generates a overview image of a minetest map.
BSD 2-Clause "Simplified" License
111 stars 40 forks source link

Option for fixed image size #49

Closed neko259 closed 5 years ago

neko259 commented 6 years ago

I am trying to use some tile html viewer to paint a map of tile images as a map, instead of trying to generate it as one. But the mapper supposedly tries to limit the image size to the actual existing map, and the tiles have different size. E.g. if I specify 1000x1000 tiles, some of them make 32x32 empty images (for the area not generated), some 800x1000, and some even 1008x1008 (not sure why it's bigger then specified geometry). Obviously such images cannot be used to be tiled along as a map.

Poikilos commented 6 years ago

I agree, some kind of predictability is needed for making tools that use the output of minetestmapper. If the map was a fixed size, that would be ideal. Another thing that would be helpful is some standard output such as:

min_chunkx: -48
min_chunkz: -219
max_chunkx: 67
max_chunkz: 86
is_empty: False

(which would define the image's placement in the world using minetest world coordinates) I provide similar output with my fork python version which, albeit slower, I use for my single-image generator for my HTML5 canvas map because I have no other option. I forked my minetestmapper-numpy.py from spillz' to provide output such as above. A fixed size image would also solve the main issue, which is where the output image is actually displayed by a map viewer that uses multiple cropped images (that mode of my HTML5 canvas map is not working, so I have to use a single image mode).

The is_empty flag in standard output would let a multi-chunk generator (that processes the standard output above which minetestmapper could generate) know when it has reached an area where no chunks exist even with a fixed output image size, so that it can have a clue where the edge of the map exists (regarding further clues, see https://github.com/minetest/minetestmapper/issues/52).

sfan5 commented 5 years ago

ac15bacf36f31e0fde1880fe3acc10fe3f812ff3