Author Topic: Heightmap Generator  (Read 9392 times)

forget no id rather make my own library for that stuff lol

the engine doesnt support it so just write your own library to write it out following the file format
nvm im dumb and didnt check the specification for the format

If someone could make a heightmap generator using modtier that would be incredible

wouldn't be too difficult to convert a heightmap into modter bricks
I had a similar test a few years back, but it was generating near the player and making its own terrain as it went
a heightmap would actually be a bit easier

Generating ModTer terrain using a heightmap shouldn't be too difficult; PTG does this already, but using arrays of height value data relative to chunks. You would just need to check the height of the current cell you want to place a brick in, then check the height of surrounding cells, generate a string of boolean values via a marching cubes algorithm (i.e. 11110101), then choose one of the ModTer bricks and orientate it depending on the string value that was generated.

enough nerd stuff let me generate slopes in modter >:(

enough nerd stuff let me generate slopes in modter >:(
:'-(

We're working on it lol.

I have something similar, but it uses a 2x2 modter for each chunk
would need to modify it a bit to be 1x1 per chunk instead, and have it handle cliffs correctly

finished the heightmap converter
converts between .txt and .png depending on what you give it

can't post executables on the forums (badspot is against it, for good reason), so attached is the source code (rename HeightMaps.java.txt to HeightMaps.java)
compile using "javac HeightMaps.java" (you need the java development kit (JDK)) or use an online compiler like compilejava.net
run using "java HeightMaps" to print usage information
to convert heightA.png to heightA.txt and heightB.txt to heightB.png, use "java HeightMaps heightA.png heightB.txt"



will have to look into using a singular modter brick per chunk, instead of a 2x2 of bricks
I seem to remember that  there were some situations where 1 modter brick wouldn't fit well, so I went with 2x2 instead and that fixed the border issue (but flattens out the terrain and makes weird slopes)

Great! How do you use this again once compiled? You double-click the executable or drag-and-drop an image unto it?

Great! How do you use this again once compiled?
currently it's still command line, run using "java HeightMaps <files>", <files> being your file(s) to convert
if you'd like I can make it so you can double click the .class file and then it will prompt for files

drag-and-drop an image unto it?
forgot to test that at the time
doesn't look like windows lets me do that, must be a .bat feature or something