Flat Earth Theory - An Exploration of Creating Heightmaps

Instructions for using and creating mods.
28 posts Page 1 of 2
Buffet_of_Lies
Mapper
Mapper
Posts: 402
Joined: Tue Nov 20, 2012 11:25 am


Hello. I've been meaning to write a tutorial for quite some time now and am going to attempt to do so right here, right now.

I hate flat maps. There, I said it. I like contour and texture. I like nooks and crannies. Obstacles to get around and corners to hide in. Flatness is a malady which I see many custom-made maps suffering from, whether it be by accident or design. In this tutorial I will try to explain a couple of easy ways to remedy flatness in a map design. Hopefully you'll have a better understanding of how to use the AoS heightmapping application known simply as Bildramer's Bitmap Converter.

Bildramer was an early player of Ace of Spades. I'm not sure if he plays any longer. But, if he's reading this, I'd like to give him a big shoutout for creating this nifty simple program that has the potential for making a playable map for Ace of Spades out of virtually any image.

The map we are going to create is a relatively shallow map with an irregular, but not totally random, contour. It was intended to sort of resemble a grassy meadow. It should resemble this:
Image
It's green. It's not too deep. And, more importantly, it's not totally flat on top, but rather has some exaggerated terrain contours and some irregularities allowing people to hide in and behind blocks. Creating it is relatively simple using a few basic image-editing tools.

Firstly, you'll want to download BCT from the link above. It's a Windows command-line program, sorry Apple & Linux fans. Unzip that to its own folder.
Image

Secondly, you'll want an image editor, preferably one that saves 24-bit bitmap images. If you need one, I suggest GIMP although I will be using Photoshop CS3. You will also need to acquire some basic computer skills such as using a text editor (Notepad) to edit batch files.

Launch your image editing program and open a new image. This image should be the standard Ace of Spades map size, which is 512 pixels by 512 pixels.
Image
You should now have a blank image that looks something along the lines of this:
Image
Now you'll want to paint a nice green, grassy texture on there. You can do this however you like, but I suggest doing the following:
Use your color picker and choose a lovely verdant shade of green to your liking. Then select the Fill Bucket tool and click inside your currently colorless, empty image. You should now have a green square image, like so:
Image
This green is currently, in my opinion, too uniformly one color. So we need to add some variation. We will do that with a Noise filter.
Image
Fiddling around with the amount of noise (you don't need much) rewards us with this:
Image
This is your primary image map. This is what the players will see when they view the map. Save this as a 24-bit bitmap (.bmp) and give it a filename so you can identify and find it again, for example, greengrassy.bmp
Image

Now we want to create a second image. This image will be the heightmap image. This image will be a grayscale image which will inform the converter program what the elevation of each pixel should be. White is the highest elevation at 64 pixels and black is the lowest level and is, therefore, the water level. Just for the sake of demonstration I don't want this green grassy field to be terribly deep, so our heightmap is going to be very dark. I want there to be some terrain contour features (remember I said I hate flat maps?) so we will be using the Difference Cloud filter in Photoshop.
Image
The Render Difference Clouds filter gives us this image:
Image
At this point it is still too bright and high contrast. This would give us fairly exaggerated peaks and valleys in our terrain contours and I don't that. I also like my heightmaps to be grayscale, but I am not positive it is completely necessary. This is what I do in Photoshop to make change it:
Image
This gives the following result:
Image
The problem I always run into is that Greyscale is 8-bit colordepth and when I save this in Photoshop it won't give me the option to save it as a .BMP so to fix that just convert it back to RGB again. No big deal. But it's still too bright so lower the brightness and contrast like so:
Image
Which results in this image:
Image

The nice thing about using Difference Clouds is that, at least in Photoshop, the images it creates are tileable. That means that when you get to the map's edge, there should be a reasonably seamless merging with the wrap-around effect that AoS does to the map boundaries.

Anyhow, you will now want to save this image as a 24-bit bitmap (.bmp) and give it a name to keep track of it in relation to the previous image map we saved but add something to distinguish it as the heightmap. In this case we'll just add a "_h" to the end of the filename. The file name could be something like, for our example, greengrassy_h.bmp.

So now we actually want to take these two images and merge them via the bitmap converter and create a .VXL map!

Remembering where you unzipped Bildramer's Bitmap Converter to, copy both of the images you created (greengrassy.bmp & greengrassy_h.bmp) over to that folder. In that folder, among a couple other files, there should be two .EXE programs, one called convert.exe and the other called converth.exe. "Convert.exe" will load a bitmap and make a flat featureless .VXL of the depth you specify in the batch file. I hate flat maps, so I don't use this one much. We are only interested, for the purposes of this tutorial, with the program named "converth.exe" which is the one that does the heightmap "magic".

You should see a EXAMPLE.BAT file, which is a batch file or, rather, a set of commands in a text file that tell the program what to load and what to do. Open up this file in a text editor (for example, Notepad) and you should see the following:
Code: Select all
converth.exe moon.bmp moonh.bmp
pause
You are going to want to change the image names in the text file to the filenames you used for the two images we created up above. So it should read as follows:
Code: Select all
converth.exe greengrassy.bmp greengrassy_h.bmp
pause
...and Save As a new batchfile with a name like greengrassy.bat, for example.

Okay. Now for our moment of truth! Move to the folder that has your images, the converterh.exe program and your new image map and heightmap image... DOUBLE-CLICK on greengrassy.bat!

If all has gone correctly, a window should pop up and, after a short wait, you should see this:
Image

If you go look in the folder you should see a new file has been created by the name of MAP.VXL. Now might be a good time to rename this to something unique such as greengrazzy.vxl.

If, unfortunately, there is no new file in there and your window pop up indicated some sort of error or wasn't able to locate the filename... it shouldn't take a genius to figure out that they've done something wrong. I suggest going back and making sure you entered the filenames correctly in the batch file and saving it again and also check that you actually moved the files into the right folder.

If you've done everything correctly as outlined above, you should have a map like this:
Image

This looks pretty much like the effect I was going for. Speckled green-colored blocks and some terrain contouring. But it's a little too extreme for my taste. And if we take a look at it with Isorender we see a problem:
Image
The problem being that the heightmap I created was too dark, resulting in the map being too shallow. A lot of that "grass" will be water when played in game. (On a sidenote, if you load this map result into the Pyspades map editor you could color the water layer blue and you'd probably have a pretty interesting map of small islands in water.) So back to Photoshop and brighten up the heightmap image again. I also lowered the contrast again. This should both raise the map level a bit and make the terrain less-exaggerated. Also I did something else new to the heightmap.
I added some Gaussian Blur filter (just a small amount of blur will do) to smooth out the terrain contour features a bit.
Here's what it looks like now:
Image
After double-clicking my batch file again and checking the resulting map.vxl, we have this result:
Image
Much smoother! Also it isn't too shallow nor too deep!
Image

This result leaves some fairly flat spots to build and run on but also stops players sprinting across the map. There's also a decent amount of cover and the color of the grass has some variation to keep it from being monotonous.

There's no shortage of other things you could do using the techniques I've outlined in this tutorial. I didn't even get to what various paintbrush types can do, but I think you might be able to figure that out for yourself.

Here's a link to the files used in this tutorial if you wanted to examine them for some reason. I hope this tutorial has been helpful. Let me know if I need to clarify anything. My next tutorial may possibly be on how to use Poly2Vox to convert 3D polygon models into voxels that you can import into Slab6 and Voxed.
Silnius
Assistant Moderator
Assistant Moderator
Posts: 274
Joined: Mon Nov 05, 2012 8:15 am


Very nice tutorial ! Blue_BigSmile
It will help lot of people to start some map, nice job (again) Buffet_of_Lies !
TB_
Post Demon
Post Demon
Posts: 998
Joined: Tue Nov 20, 2012 6:59 pm


This is a really nice tutorial buffet, thanks for taking the time!
I knew the basics of this, but I still learned a couple of new things.

A question though, is it possible to convert a .vxl map into a bitmap?
I know things like buildings and tunnels won't come with it, but I'm just looking for the basic terrain of maps into a bitmap file.
Buffet_of_Lies
Mapper
Mapper
Posts: 402
Joined: Tue Nov 20, 2012 11:25 am


TBS wrote:
This is a really nice tutorial buffet, thanks for taking the time!
I knew the basics of this, but I still learned a couple of new things.

A question though, is it possible to convert a .vxl map into a bitmap?
I know things like buildings and tunnels won't come with it, but I'm just looking for the basic terrain of maps into a bitmap file.
Well. I think Blockman3D has some sort of option like that, but I am not entirely possible. It's been a while since I've used it but I feel like there was some sort of option to create a heightmap from a VXL file which results in something like what you are talking about. But again, I am not entirely positive where that function is in the program. Ask FaultCheck, perhaps.

Another even simpler method would be to bring up a map in-game and simply hitting shift-PrintScreen and pasting that into an image editor. Crop the map and resize to 512X512 and you'd have an image of the map. Not that I know why you'd want to do that.
TB_
Post Demon
Post Demon
Posts: 998
Joined: Tue Nov 20, 2012 6:59 pm


Ok, I might try that.
And the reason why I was asking is because I'm planning to make a "classicgen lite" for smaller matches. And I need some way of reducing the hills by a third or something like that.
Buffet_of_Lies
Mapper
Mapper
Posts: 402
Joined: Tue Nov 20, 2012 11:25 am


TBS wrote:
Ok, I might try that.
And the reason why I was asking is because I'm planning to make a "classicgen lite" for smaller matches. And I need some way of reducing the hills by a third or something like that.
I can think of several ways of doing that. One would be loading it up in voxed and simply deleting the parts you don't want. If you're clearer on what you want, PM me and I could take a stab at it.

UPDATE: TBS, I may be thinking of something in jojoesticky's heightmap terrain package, which I don't currently know the location of. But I was fooling around with voxed and came up with this:

Image
Is this kind of what you were thinking of? I just used voxed, the delete key and the numpad. You could do this with heightmap too if you were so-inclined.
Cajun Style
Deuced Up
Posts: 145
Joined: Fri Dec 07, 2012 11:04 am


Pyspades map editor can export a heightmap.
Buffet_of_Lies
Mapper
Mapper
Posts: 402
Joined: Tue Nov 20, 2012 11:25 am


Cajun Style wrote:
Pyspades map editor can export a heightmap.
Maybe that is what I was thinking of. Thanks.
TB_
Post Demon
Post Demon
Posts: 998
Joined: Tue Nov 20, 2012 6:59 pm


Buffet_of_Lies wrote:
UPDATE: TBS, I may be thinking of something in jojoesticky's heightmap terrain package, which I don't currently know the location of. But I was fooling around with voxed and came up with this:

Image
Is this kind of what you were thinking of? I just used voxed, the delete key and the numpad. You could do this with heightmap too if you were so-inclined.

Oh man, that looks really cool :)
What I had in mind though, was the classicgen map in the size of pug with water around. And the hills would be slightly lower, like maybe 3/4th. But seriously though, you don't have to make it or anything, unless you really want to, of course.

I can't even load up blockman without crashing.
Buffet_of_Lies
Mapper
Mapper
Posts: 402
Joined: Tue Nov 20, 2012 11:25 am


TBS wrote:
What I had in mind though, was the classicgen map in the size of pug with water around. And the hills would be slightly lower, like maybe 3/4th. But seriously though, you don't have to make it or anything, unless you really want to, of course.
The size of "pug"?
Image
You might need to explain that better to me. Sounds like a jojoestinky map, though.
If you want the hills lower then, yeah I'd need to probably play around with this in the heightmapper. But I'm willing to take a stab at it. The one problem with me map was that I clipped off too much of the blue side on the left and the blues all spawn in water. But I was just trying out an idea.
Jdrew
Mapper
Mapper
Posts: 4808
Joined: Tue Oct 30, 2012 10:48 pm


The tutorial was really great. I use paint.net as gimp didn't seem to work that well. I was able to make a simple map in a few minutes too! Here is what I did: went on google and found a grass texture and put it in paint.net. Next I saved the image and used an effect that made the image have light and dark stuff all over it by accident but it worked out ok. Saved that image and put them both in the folder. Finally I edited the batch file and ran it. It seemed to turn out just like the moon images though from when I first ran the example. I guess I will have to mess with it a bit. Here is the end product, I have your name in the .txt file by the way. Thanks!

http://www.mediafire.com/?qcr36fi9qc2bbh3
Buffet_of_Lies
Mapper
Mapper
Posts: 402
Joined: Tue Nov 20, 2012 11:25 am


jdrew wrote:
The tutorial was really great. I use paint.net as gimp didn't seem to work that well. I was able to make a simple map in a few minutes too! Here is what I did: went on google and found a grass texture and put it in paint.net. Next I saved the image and used an effect that made the image have light and dark stuff all over it by accident but it worked out ok. Saved that image and put them both in the folder. Finally I edited the batch file and ran it. It seemed to turn out just like the moon images though from when I first ran the example. I guess I will have to mess with it a bit. Here is the end product, I have your name in the .txt file by the way. Thanks!
No need to credit me. But I appreciate the sentiment. It sounds like you've figured out the first and most important thing about heightmapping which is that accidents often result literally in the discovery of new territory. Mess around with it and do things wrong and eventually you will discover something new.
Jdrew
Mapper
Mapper
Posts: 4808
Joined: Tue Oct 30, 2012 10:48 pm


Yes, I just had a great idea! I have been meaning to make a moba gamemode for AoS for a while. It will be based off of CTF but I always had a problem making the map. So let me get this straight, darker colors are short and lighter colors are tall? What do you think the color for 10 voxels tall is? I have also checked out your models tutorial and have to say it is very well made. Thanks for your help ether way.
Yourself
Coder
Coder
Posts: 28
Joined: Mon Nov 05, 2012 5:24 pm


TBS wrote:
This is a really nice tutorial buffet, thanks for taking the time!
I knew the basics of this, but I still learned a couple of new things.

A question though, is it possible to convert a .vxl map into a bitmap?
I know things like buildings and tunnels won't come with it, but I'm just looking for the basic terrain of maps into a bitmap file.
I implemented this in the pyspades map editor ages ago. Also the bildramer program has a bug in it where it crashes if the color values are too high. The effect is that you can't create blocks on the highest z level using that program. The pyspades map editor doesn't have this bug. Also, I added subtractive heightmapping. The effect is that you can make several different heightmaps which, when applied sequentially, can create caves, tunnels, overhangs, etc.
Buffet_of_Lies
Mapper
Mapper
Posts: 402
Joined: Tue Nov 20, 2012 11:25 am


I should also mention that Yourself made a nice little javascripted tool that refines some of the heightmapping process and allows you to manipulate the shading that is baked onto the colormap. That is, if I am understanding it properly. You can find it here.

There is also, of course, the pyspades map editor which is a deceptively simple tool yet extremely powerful for manipulating maps. It does, however, make the colors on your map appear funky in Voxed after you run it through the map editor and then view it in Voxed, but I don't think it actually causes any visible issues when the map is finally viewed in the game. I use it primarily for coloring the water level when I need to. I also used it on my map Tree Bunkers to draw the walkways hanging between the trees and the "foliage" of the trees themselves. I'm also led to believe that it's possible to write scripts for it to extend it's functions but I've never heard of anyone actually doing that. If someone reading this wants to do something clever I'd love to see some functionality added to it that allowed you to rotate map layers and, more importantly, view the layers of the map as a sideview on the X & Y axis as opposed to the Z axis which it currently does.

And last but not least I'd want to mention Blockman2D, a really amazing program developed by FaultCheck. It has a full suite of tools at your disposal and he's still adding features to it regularly.
Image

I'm leaving out a set of heightmapping tools that jojoestinky threw together because I never used them much and they're impossible to download any longer. He also used Blender to make his maps which is outside of the realm of my experience. Perhaps someone else knows more and will add something about those to this thread.
28 posts Page 1 of 2
Return to “Guides / Tutorials”

Who is online

Users browsing this forum: No registered users and 1 guest