Smooth Terrain Heightmap/Colormap Importer Release!

I’m surprised by how fast this actually is. I’d expect it to take at least 2 minutes to generate a 1000x1000 image, but it barely took me 20 seconds.

4 Likes

Update: I wrote my own implementation of the height map importer in pure Lua using my PNG library. It restores the instant terrain importing functionality

As with the PNG library itself, I am not releasing this publicly right now.
The intent here is to amplify the point I was trying to make previously.

19 Likes

Got the OK to release this!
https://www.roblox.com/library/3980893189/Terrain-Importer

Plugin Source:
https://github.com/CloneTrooper1019/Roblox-Terrain-Importer

19 Likes

Wow, That looks awesome, is it going to be a game or a showcase?

Just a showcase. I made it to see if I could.

3 Likes

it looks great! I really like it. keep up the good work!

Thanks so much! Ima check this out when I have time.

I took a break from Roblox so I haven’t had a chance to really check this out. Now that I have had a chance to try it, have to say, not bad! It definitely has problems, but it is far better than the alternatives.

  • It is far too thin though, making it difficult to modify, occasionally leaving holes.
  • Having to upload the height and color map leaves a lot of waiting for moderation, on an asset that really shouldn’t need to be uploaded in the first place.
  • Relying on only a single channel for the height greatly reduces the potential resolution. Imagine going from a 256 to a 16777216 resolution! Especially for mountainous terrain.
  • A lot of the time, it either requires a lot of iteration, or another program to visualize the height map before it is imported.

I look forward to a day when we can just apply height maps directly to surfaces like a brush.

  • Don’t really see what you mean here. Yes it will leave holes if you make your map too thin, which is why we have scale and offset. If you don’t want any holes, either avoid using the 0 value, or fill the entire space below with terrain before importing the heightmap and offsetting it by 4 on the Y scale.
  • True, I won’t go into details because I ranted about this enough already.
  • I don’t know if Roblox discards this once uploaded, but you can use 16 bit RGB images. Heightmaps aren’t meant to be used raw. Most games apply some kind of smoothing post-processing, unless their world height limit is capped. Roblox doesn’t need this as you were supposed to apply the details yourself.
  • Same goes with 3D models, textures and everything else that is a visual. The advantage that heightmaps have is that you can opt for a standard image editor or a specialized program.

Yeah, sorry, but the moderation requirement here is absolutely absurd and places a gigantic burden on the developer trying to use this feature. I understand why it works like this, but this ruins the feature. At this point, I’m considering just writing a new tool to grab the data from a locally-run web server.

Now, considering that I can do that, perhaps this limitation isn’t the most well thought out. If you can’t get the board members to budge on this using moderation-approved images, at least propose allowing pre-moderated images, but tag the asset ID as having been used to generate terrain in whichever place ID. Then if moderation blocks the image, you can also flag it for a human to determine whether or not it contains inappropriately shaped terrain.

That being said, please don’t automatically block places if they’ve had an associated heightmap blocked by moderation. Moderation is still extremely prone to false-positives, especially in grayscale images like a heightmap. I know this probably sounds obvious, but it’s worth saying.

EDIT: In fact, in the 10+ minutes I spent thinking about this post and writing it, my test heightmap still hasn’t been approved by moderation. We need some sort of faster development loop here if this tool is going to be useful.

EDIT 2: Forgot to mention, I just ended up using CloneTrooper’s version. Though it looks like there’s a bug where the terrain isn’t completely filled on occupancy, so the Erode and Smooth tools have really intense effects even on the lowest strength setting.

11 Likes

This is a must have plugin. I do have one thing slowing me down… is there a way to choose which materials are used with the colormap? As of right now I get a default set of materials not of my choosing. Also, If I could request one feature it would be the default no colormap material be changed to grass or ground as opposed to slate that’s used now. Slate seems rare vs how many maps consist primarily of ground or grass.

1 Like

If you turn your graphics down it won’t slow you down

1 Like

Oh sorry. I meant slowing down my workflow. Right now I have to hand paint every inch of terrain. If I could choose the materials it would be closer to built in terrain tools. Like how mountains that are generated by the standard tools always have snow, rock, mud, then ground. With the plugin all that needs painting.

There is a lot of tutorials on YT on how to make heightmaps. They are just monochromatic images on which black represents the lowest and white the highest point of your map.

If you want to change the default import material, you sort of can. Just have a image that is just a solid color corresponding to the material you want to use and use that as a color map.

Alternatively you could use some quick photo shopping of your height map to make a color map (ala make X shade of grey rock, Y shade of grey grass).

1 Like

Could you clarify one thing… if I want to have my map generated with grass and rock where do I tell Studio to give me those specific materials? I tested it using the greyscale heightmap used also as a colormap. The terrain generated was mud and rock. Where or how do you control x shade of grey and make it rock?

You cant do this though studio. You will need a image editor like paintdotnet where you can use a paint bucket or magic wand tool to select all the pixels of a certain shade of grey (as the shade of grey corresponds to the height) and change all pixels of that color to whatever the material you want it to be.

The color codes for all the materials as provided by longlongchien are

Asphalt - RGB[115, 123, 107] - #737b6b
Basalt - RGB[ 30, 30, 37] - #1e1e25
Brick - RGB[138, 86, 62] - #8a563e
Cobblestone - RGB[132, 123, 90] - #847b5a
Concrete - RGB[127, 102, 63] - #7f663f
CrackedLava - RGB[232, 156, 74] - #e89c4a
Glacier - RGB[101, 176, 234] - #65b0ea
Grass - RGB[106, 127, 63] - #6a7f3f
Ground - RGB[102, 92, 59] - #665c3b
Ice - RGB[129, 194, 224] - #81c2e0
LeafyGrass - RGB[115, 132, 74] - #73844a
Limestone - RGB[206, 173, 148] - #cead94
Mud - RGB[ 58, 46, 36] - #3a2e24
Pavement - RGB[148, 148, 140] - #94948c
Rock - RGB[102, 108, 111] - #666c6f
Salt - RGB[198, 189, 181] - #c6bdb5
Sand - RGB[143, 126, 95] - #8f7e5f
Sandstone - RGB[137, 90, 71] - #895a47
Slate - RGB[ 63, 127, 107] - #3f7f6b
Snow - RGB[195, 199, 218] - #c3c7da
WoodPlanks - RGB[139, 109, 79] - #8b6d4f
Water - RGB[ 12, 84, 92] - #0c545c

2 Likes

Wow thank you so much. I didn’t realize that was actually possible. You’ve really helped me out!

1 Like

I have now written up a tutorial regarding how to convert a heightmap into a color map if anyone wants a more detailed explanation. Its pending moderation, but you should be able to see it by direct link Using Paint dot Net to generate a color map from a heightmap

4 Likes