I just created this heightmap to triangle terrain software and script and I thought I’d share it with you.
The images are dropped in a software that I wrote.
The software converts the image to a table with values from 0-1.
Then my Roblox script will convert that table into a terrain.
I remember when I made something like that I had to have it skip every few pixels because otherwise I got a 40 mb+ text file. XD MapGen - Roblox link for the pre generated map if anyone is curious. Used C++ in order to transfer from the heightmap to text. I had it working for upto 2k+ size images I think. [EDIT] So I just spent awhile looking and I couldn’t find an even remotely working version but I did find out that I used opencv in order to go through the image. So I leave that in someone hand’s who is smarter than me.
Yea I don’t think I’ll expand it to take major images. Reason being that the resolution of the terrain usually doesn’t have to be so large. It works fine on 100x100 Images, and I don’t think people would need higher resolution on their terrain. Besides, people who knows how to handle these scripts knows how to shrink an image so I dont have to implement a “skip certain amount of pixels” approach.
If they just need larger maps, then that is regulated in the lua script anyways so it doesn’t depend on the image size.
I made a Python program that does this, and using a scaling technique it can support some pretty large files. What I did was have it generate a .lua file in a folder, and after it reaches a certain size, it creates a new one, and each of these are set up like a ModuleScript. Once completed, I import them into Roblox, and just require the chunks to load the terrain.
Using a program called World Machine, I created a heightmap that was 512x512 pixels. Using my program I split it into 64 (8 by 8 ) modules that each covered a square on the map. What I did for one of my projects is have the client procedurally generate the terrain as it approaches, making it manageable to support a massive map of around 30,000x30,000 studs.
I don’t have any images at the moment to show how it works, but if your computer can handle my unoptimized procedural forest generator and non-streamed buildings, go here.