Jumps and berms
Creating heightmap features in Photoshop
Setting up the heightmap
Different types of layers
Create a jump
Create a berm
If you struggle to follow the tutorial, here is my heightmap.psd file which was used to make this tutorial.
In this tutorial we will take a look at creating basic heightmap features such as jumps and berms. I won't go into detail on this one, I'll just show you the basic concept on how I make my heightmaps in Photoshop. I also won't show you how to get this in game. Geo has made a great tutorial on how to do that: http://forum.mx-bikes.com/index.php?topic=2560.0
You'll need basic knowledge of what how and why a heightmap works, and you need to know your way around photoshop.
This is what we'll be creating:
Setting up the heightmap
Open Photoshop and create a new document with a size of 2049x2049 pixels*, grayscale color mode with 16 bits and a resolution of 72 Pixels/Inch. A heightmap must be either 1025x1025, 2049x2049 or 4097x4097 to make it work.
Once you've created the document, fill the background layer with the hex code color #808080. This color is the absolute center of black and white. This way we can make a ditch and hill equally as 'tall'.
Create a new layer and rename it. In this case we're creating the lip of a double jump, so call it 'lip' and put it in a folder called 'double'. Select the layer and choose the Rectangular Marquee tool on the left hand panel. Select a portion of your document. Reset your foreground and background colors to black and white by pressing D and fill the rectangal with a linear gradient as shows below:
Now, hit ctrl+d on Windows or cmd+d on Mac to deselect everything.
With the layer still selected go into the layer modes dropdown and choose 'Screen'.
That looks promising already, doesn't it? Now the real magic begins.
Right click the layer and choose 'Convert to smart object'. Now double click the layer thumbnail. Photoshop will open a new document file. In this new document, click on the small 'Create new fill or adjustment layer' icon at the bottom of the layers tab on the right and choose 'curves...'. This will create a new adjustment layer in the layers tab. Select this layer.
With this layer selected, you'll see a propeties panel open. In my case this is above the layers tab. In here you'll see a basic curve editor. This is the place where we'll be creating our jump.
The following is all in the curve editor
The first thing you have to do is drag the top right anchor point to the bottom. This'll create a black rectangal on your screen. Now, click somewhere on the curve line. This'll create a new anchor point for you to use. Drag this anchor point up a bit. You should now see your jump reapear on your screen, though it will look different than before. I hope you can guess what is happening. If not, the curve editor is basically the side view of your jump. However you shape your jump in there, that's how it'll look in game from the side view.
Fiddle around with the curve until you've got the jump shape that you're happy with. This is what I've done:
Now to use the black and white values to the fullest, add a 'levels' adjustment layer on top of the curve layer. Select it and in the propeties panel and drag the right arrow close to the first white spike you see in the preview window.
Hit ctrl+s on Windows or cmd+s on mac to save the document and close it. Go back to your heightmap document and you'll see it has changed. You'll also see that the curve and level layers are gone in this document. Don't worry! It's a smart object. Once you double click the smart object layer ('lip') it's thumbnail again, it'll open the document with curve and level layers right back up for you to edit. This method keeps your initial heightmap document clean.
In the heightmap document right click the 'lip' layer and choose 'New smart object via copy'. Rename this layer to 'landing' and use the move tool to move this layer over in the document so it sits right behind the lip.
Double click the thumbnail to open the layer's document. First thing you want to do is delete the levels adjustment layer. Right click it and click 'Delete Layer'. We do this to prevent any clipping to happen. Click on the curve layer and change around the curve until you have a nice landing jump. Once you've created a nice shape, add a new levels adjustment layer and repeat the step we did earlier. Select it and in the propeties panel drag the right arrow close to the first white spike you see in the preview window.
Hit ctrl+s on Windows or cmd+s on Mac to save the document and return to your heightmap document.
Voila, there is your double jump. Save this as a 16bit RAW file and test it in game. If you don't like the jump, just open up the specific jump layer and edit the curve until you like it! (Don't forget the levels adjustment layer! It's easy to make the whites clip!).
We can make awesome jumps now, but what about berms!? Don't you worry pal! If you can make jumps, berms aren't hard for you.
Do the exact same steps as making a jump except for the layer mode. Keep the layer mode of the layer at normal, but change the layer mode of the folder the layer sits in, at screen. Even the curve editor has the same idea as the jump layer. The shape you make your curve line, will be the shape of your berm (in this case if you cut your berm right in the middle, if you don't get it, you will in a second!).
This is what you should have. I know it looks like a jump, we'll transform it into a second.
With this layer selected, go to Edit -> Transform -> Warp. Now a new propeties bar will appear on the top of your document and you'll see a box around your berm:
Click the Warp dropdown on the left, and choose Arc. In my case, the orientation is wrong. Change it by clicking on the button right next to the dropdown 'Change the warp orentation'. This is what we've got so far:
In my case, the berm is bend the wrong direction. You'll see a small square on the outside of the box around your berm. Click and drag this square the other direction to change the shape of the berm. Hit enter to conform the warp changes.
That looks good, doesn't it? To finish it, we need to smooth the ends. Copy the berm layer once by hitting ctrl+j on Windows or cmd+j on Mac. Select the copied layer and go to Edit -> Transform -> Warp again. Set the drop down to None and hit enter. Now press ctrl+t on Windows or cmd+t on Mac to open the free transform tool. Rotate the layer 90 degrees and place it next to the berm like in this picture:
Hit enter to finish the transform. Do the exact same step for the other end of the berm:
Now select the folder, which in my case is called 'Berms'. With this folder selected, hold alt and click on the 'Add layer mask' icon beneath the layers panel (left of the adjustment layer icon). This will create a black mask, and you won't be able to see your berm anymore. Right click on the mask thumbnail on your folder and click 'Disable mask'. Choose the gradient tool from the left toolbar and make sure your foreground and background colors are default by pressing D. Then press X to invert the foreground and background colors. Drag a linear gradient over the berm as shown in this picture and re-enable the layer mask the right clicking on it and choosing 'Enable layer mask'.
And there it is! A finished berm.
If you want to rotate or scale a jump or berm, just hit ctrl+t on Windows or cmd+t on Mac and you can transform it the way you want!
- To control a jumps or berms height, use the opacity of the layer.
- Use a gausian blur on jumps or berms to smooth them out a bit.
*In mathematics, a power of two is a number of the form 2n where n is an integer, i.e. the result of exponentiation with number two as the base and integer n as the exponent.
In a context where only integers are considered, n is restricted to non-negative values, so we have 1, 2, and 2 multiplied by itself a certain number of times.
Because two is the base of the binary numeral system, powers of two are common in computer science. Written in binary, a power of two always has the form 100...000 or 0.00...001, just like a power of ten in the decimal system.
Yay! Photoshop! I was just going to start learning Geo's tutorials but I'm much more familiar with PS and would rather start there. 8)
Thanks Sandbiter for writing this up. Another great addition to all the tutorials :)