I'm working on a simple and small game were I don't want the map to be dynamically generated from random perlin noise. In fact I already have the map mapped out in 2800x2800 greyscale image. I'm going to use a scale of 1 pixel to 1 voxel/meter.
Essentially I just wish to use this as a fixed height map data for the game so overriding all the generic biome etc generation.
I've had a look at https://forum.minetest.net/viewtopic.php?f=9&t=19387 but this seems to go a step to far for my needs and is limited to gisTIFF, plus Im having a shocker getting python to run with the required libraries on win10. im way out of my depth and I cant seem to find a simple tool that will read the brightness value of each pixel and spit out the result into some form of "xy:brightness" value - understand thats 7.8 million odd values but I only need to do this once.
For example I found this on stackoverflow using lua and its very close to what I need to do, although expect it'll take me a few weeks to make it work - https://stackoverflow.com/questions/8827948/how-do-i-convert-image-file-sources-into-csv?rq=1
If I can get that data in some sort of format, I was then going to:
~ Delete any xy coord were brightness is == 1 height - this removes about half my data points, I'll just have a match check and if its nil assume height == 1, I may even be able to set this to alpha on initial run in and save me a step.
~ Feed the left over points into a single large table in lua or if I need split it into a few tables if performance is to degraded.
~ use that as the basic height map, and build the basic map gen elements on from there (I have a very small 20x20 data pt version running via map gen already)
~ generate the whole map once using the minetest engine
~ save all the sqlite, map meta et al data inside my game directory somewhere.
~ When someone first loads the game have lua check if the above files exist in the world folder if they don't copy them over
~ For every new "world" created for the game the player will effectively start on the exact same world map and a fixed pt.
If those last two points cant be done I'll just have to run the map gen each game creation but I figured copying files around is way quicker than running the mapgen code each time unessecarly.
I did play around with worldedit/mapedit, but Im not keen to manually set 7.6 million data pts by hand when I'm pretty sure the computer can do this for me off a nice image.
Anyways before I go through the process of the above I just wanted to check theirs:
~ Not a simpler/easier/faster way to have a pre-designed game map run into a game so its always fixed?
~ The approach above is not way off the wall or theres not a better/faster/cleaner approach?
~ Can Lua copy world map data around on load?
~ Any other suggestions :)
Thanks again for any help