minetestmapper
minetestmapper copied to clipboard
Tiled output idea
I currently use minetestmapper to generate tiles for a slippy map using the --geometry option to create the tiles.
For a big map, this is very inefficient, because minetestmapper will loop over all blocks (chunks?) in the whole world to generate each tile.
Generating the whole world as 1 big image and then chopping it up currently leads to crashes (in gd?) because the image gets too big. But even when fixed this would lead to very unwieldy big images.
I have some ideas about looping once over the blocks (in loadBlocks) and keeping multiple m_position arrays for different tiles, sorting the blocks into the different m_position arrays. and then afterwards call rendermap which each position array to generate the differing tiles, re-using the gd image.
However, this would add quite some new functionality, so I didn't want to jump in and just create it without first deliberating a bit about the api and implementation
I propose a new flag:
-- tiled
then we also need a convention to generate the output filenames. I'd think it would be best to keep it simple end just use an xxxx_yyyy_basename . with xxxx and yyyy the tile numbers and basename the name specified with -o. I put it at the end to not have to worry about the extension :-)
or I could use the actual coordinates in the filenames?
What do you think?