Crashday Redline Edition

Crashday Redline Edition

74 ratings
Heightmap Tutorial
By DromEd
Heightmap tutorial for Crashday. Learn how to master heightmap design and create tracks of your dreams.
   
Award
Favorite
Favorited
Unfavorite
Introduction
Welcome to this Heightmap Guide. Heightmaps are used in the track editor to set elevation data on specific places of your tracks.

Many of the players who became friends I've met since 2006 (Crashday's initial date release) know it, the heightmap edition is a part of the game I love to work on. 11 years of editing and more than 100 tracks related helped me to improve and to push to the limit what Crashday has to offer in terms of heightmap edition.

I don't pretend to know everything and my method to be the best. This guide is just about sharing the knownledge acquiered over the years. If some parts are not well explained or not mentionned at all, please feel free to ask in the comments and I'll try to answer as best as I can.

This guide is divided in the following categories :
  • Basics
  • Advanced editing
  • Technical explanations
  • Tips and things to avoid
  • Enabling higher than 100% heightmap slope
  • Track & heightmap exemples
  • Conclusion

While reading this guide, please remember to click on the pictures, so they show on real size !

Good Luck !


Basics
If you don't know what a heightmap look like or never understood how it worked, let's explain the basics to know. The basics are pretty easy to understand.

A heightmap is a colourless (greyscale) picture. In other words, only shades of black and white as shown below.



Okay then, black and white. And how do I read that ?

The main information to remember about heightmaps is simple : black colour is representing minimum height and white representing maximum height. An exemple always tells more than thousand words :



An exemple heightmap and it's rendering in Crashday. In this exemple you can notice a flat floor, a dune on the right side and a pit on the left side. This exemple is evocative enough to understand that the black shades will set the terrain at a minimum height and as it gets more and more bright, the elevation terrain increases.



Have you ever noticed that every heightmap you can find on internet looks blurry ? Even the one shown in the exemple above. There is a reason for that. Some of you may have understand already that this blur is necessary to make a smooth link between 2 different elevations. The exemple from above without the blur will make the terrain change with no smooth transition as shown below :


Terrain with no smooth link between different elevations

Some map makers, me included use much this technique as it can be useful in some situations. Take care of the level design or the map might be either unplayable or difficult to understand.

Got it, how do I start ?

To make a heightmap, you need a picture editing software as we work on a picture file. There is many such as Windows Paint, Paint.NET, Gimp, Photofiltre or Photoshop between others. Just use your personnal favorite and it will do the job.

One very important information to remember while working on your heightmap is to save as 24-bit bitmap (.bmp) otherwise some colour information will be lost, making the terrain bumpy and unplayable.




  • The Gaussian blur

Okay, you have your picture editor opened and know in the big lines what to do. If you want to make smooth terrains such as the dunes shown in the very first exemple, the "gaussian blur" is gonna be your friend. Just draw shapes of different colours without focusing yet about how to do the smooth link between the different elevations, or if what you're actually drawing looks ugly. Most of the picture editing softwares should allow you to use effects such as the blur ones. The one you have to set is the "Gaussian blur".


Notice you can also specity the gaussian value. Higher the value is, smoother will be the link between 2 elevations


So, this will be my starting point :



The same heightmap with the same effect, the same slope elevation and with only the gaussian value that differs can change drastically the track style :


The heightmap with a low gaussian blur value, the hills are pretty rough


The heightmap with a high gaussian blur value, the hills are more smooth


How do I know if my heightmap is greyscale ?

2 methods to do it :

  • Set correctly your colours

Any shade of black/grey/white is supported, and long as is has no color (red, green and blue) on it. You have to know a colour is divided in 3 channels : Red, Green and Blue (RGB). All the colours you will use need to have all the values of the 3 channels equals, whatever the colour value is. It can be (0, 0, 0) or (255, 255, 255) or (128, 128, 128) etc...


The 3 values in the red, green and blue channels have always to be the same, whatever the value is

  • Set a greyscale filter

This method is probably even faster : apply a greyscale filter. Most of the picture editing softwares have such a feature. It is very simple : you just have to click on it and your picture gets greyscaled immediatly.


How to find the greyscale filter in Paint.NET

Now, you are ready for the next step of the tutorial.


Advanced editing
Things are getting serious now. The following steps need more attention and more accuracy.

  • The grid

From now, it will be necessary for our track and our heightmap to match their sizes. A different ratio will alter how the terrain will look like in-game. As exemple if you track is size 25x25 (square) and your heightmap 800x400 pixels, the terrain will be stretched vertically. Don't worry, for any specific size you can find a matching value. To help us in terms of size and editing, we will use the grid.

The grid is very important to use for accuracy heightmap design, you don't want tiles to cross different hills and be stretched randomly. This is really important especially if your track has more than 100% slope elevation.


The grid

First, download[upload.dinhosting.fr] the grid. We will use it for the next steps of this guide. It has been made for a default size map (25x25). If your map has a different size, please scroll down below to get more grids and don't hesitate to ask for one if you can't find one of the size you wish.

I insist on the fact that this is vital to use the grid to get our heightmap and track size match each other, otherwise unexpected and ugly behaviours will happen.


Industrial tiles matching perfectly in the pit


Do not use the grid and you might see this kind of stuff often

But Why ? And how do I use this grid ?

Without entering into technical details yet, you have to know that a combination of 4 dots on a square shape has the size of a tile. I might explain it later for information but not right now as I want you to understand as clearly as possible.


One square area of 4 dots is one 1x1 tile of your track


That should help to understand why the grid from this exemple has been designed for a 25x25 track size

Just draw coloured (greyscale) shapes that match the black dots. Just an exemple with no specific size to see how to works.

This will be my random exemple...


I kept the black dots to help you to see the kind of aera to draw, but you will have to remove them once your heightmap is completed !

...and how it look like in-game


Preview with the black dots removed

Don't hesitate to invert the colours of the heightmap (an option generally called "negative"). Sometimes, the terrain is even more interesting this way.


Our terrain after using the "negative" effet (or also called "invert" in some softwares)


And the in-game preview

You can edit your grid the way you want to, but remember that you have to draw your terrain on the areas delimited by the black dots. Also, rememeber that one 1x1 tile is as big as a square of 4 dots area. You guessed it, enlarge the area until the next dots will fit a 2x2 tile (such as the gas station, the supermarket, the cooling tower...). The blue area shown below explains how big the areas should be depending of the tiles you plan to use.



Please find here[drive.google.com] grids for the following track sizes :

  • 25x25
  • 25x44
  • 25x80
  • 26x27
  • 27x74
  • 28x71
  • 29x47
  • 30x35
  • 31x64
  • 36x34
  • 38x40
  • 43x43
  • 44x44
  • 45x30
  • 50x22
  • 50x40
  • 55x27
  • 57x24
  • 57x35
  • 60x33
  • 64x31
  • 74x27
  • 76x22
  • 80x25
  • 83x24
  • 100x20

  • The Tile "links"

Pay attention when you want to set an elevation change : set a tile's elevation correctly can sometimes mess up completly the tiles next to it ! A difference of 1 pixel length/width of your drawing can affect considerably the track and your expectations (please click on the pictures to see them in a bigger size)


Industrial tiles matching perfectly between the terrain elevation change and wall fence

The terrain above look how it has been imagined. Look at the black area. It is exactly 4 tiles width. The size (covering all the dots) has been respected. It works as planned.


A mess caused only by a pixel of difference in the width of the heightmap

It dosen't work anymore now, but what has changed ? You can only notice it by clicking on the picture to see them in their real size. On the second picture, if you compare to the first one, the black area is a bit smaller. On the first picture, the black colour stops horizontally in the same place as the black dots while on the second picture it stops 1 pixel earlier, as shown below :



Please take this in consideration while working on your heightmaps. It is not easy, especially in the beggining. You will learn from your mistakes and understand how it works by practicing.


Technical explanations
Please note that the following details are optionnal. Understand these or not should not have an influence on your ability to make heightmaps.
Have you ever counted the number of pixels contained on 1 tile on the grid ? It is an area of 5x5 pixels, meaning a 1x1 tile has 25 different locations where the elevation slope can change. This is because Crashday tiles were made this way by the developpers. The grid was make with this parameter in consideration. Knowing this information was crutial and is the reason why the grid works perfectly if you know how to use it.


Illustrating with red dots (vertices) "a 1x1 tile has 25 different locations where the elevation slope can change"





A 2x2 tile (or 4 1x1 tiles) is an area of 9x9 pixels and has 81 different locations where the elevation slope can change


Illustrating with red dots (vertices) "a 2x2 (or 4 1x1 tiles) has 81 different locations where the elevation slope can change"

In other words, one pixel of your grid = 1 red dot (vertex) from your tile. Setting a color of a pixel = setting a elevation for a red dot (vertex) of a tile. These explanations shows why the grid of a 25x25 tiles track equals 101x101 pixels and no other value.

Wait ,25x5=125. Then the grid should be 125x125, not 101x101 !

Not really, because of some important thing to know about how the tiles in Crashday works. Without entering into too complex and unecessary details, this is because of the link between tiles.

Okay, 101x101 instead of 125x25. But why ? And what is the "links" you keep talking about ?

This is where 2 tiles are touching each other. Every tile in Crashday has 4 links. An exemple below with a concrete floor tile surrounded by grass floor tiles.


The links are represented as the red lines



One link is where 2 tiles match, so as one tile takes 5 pixels size, the next one takes only 4. The number of links is always the track size -1 on both directions. This is possible to know the right size of a grid for a specific track size with this formula :
  • (track size (length) * 5) - (track size (length) - 1)
  • (track size (width) * 5) - (track size (width) - 1)

With the exemple of a 25x25 track size, there is 24 links with both directions. 125 (result of the multiplication) - 24 (number of links) = 101.
  • (25 * 5) - (25 - 1) = 125 - 24 = 101
  • (25 * 5) - (25 - 1) = 125 - 24 = 101
Proving that a grid of 101x101 is for a 25x25 track size

Another exemple with a 80x20 track size.
  • (80 * 5) - (80 - 1) = 400 - 79 = 321
  • (20 * 5) - (20 - 1) = 100 - 19 = 81
The same with a 80x20 track size. The grid will be 321x81


This might be unclear to understand, it is not a problem if you don't get this part : it is only optional, just for information.


Tips & things to avoid
  • A smooth transition between 2 different elevations
Some effects such as the motion blur might look useful, but they are to avoid if possible.
On the paper it looks great because it makes a progressive transition between 2 different elevations.


Principle of the motion blur

Although you cannot see it with your eyes, this kind of blur often generate problems with heightmaps. It can make your terrain bumpy and uncomfortable to play on.



The only trustable way to be sure to get like "the trasition you want" is to do it manually.
Let's do with with a tile colour 100-100-100 (RGB) on the left and a tile colour 180-180-180 (RGB) on the right :



3 pixels, then you have to draw 3 lines of 3 different colours between the tiles.

How do I know the colours to use for each line ?

The colours of your tiles are 100 and 180. As it's a transition between these colours, you know it is gonna be between 100 and 180 for all the 3 lines. There is a formula to find the value for each line :

  • ( highest colour - the other one ) / 4

In this exemple :
  • ( 180 - 100 ) / 4 = 80 / 4 = 20

The value you find using this way determinates the gap between each line, 20 in this exemple then. Now it is easy : you start from the highest colour (180 in this exemple) and you decrease of 20 for each pixel, as shown below :




The in-game preview



  • Soften even more this transition
This transition still looks too rough for me !

No problem, it won't be hard to fix it but you have to really understand what is explained below :

Let's start from the previous exemple, with the 100 and 180 colour tiles and the lines of 120, 140 and 160 in between.



The goal is to make the edges smoother, like this :



In this case, we change the value of the lines. In our exemple, we had 120, 140 and 160. We do not change the value from the middle (140). We decrease a bit the lowest value (120) and increase the highest value (160).
Try different value to see the influence on your terrain, as long as you proceed this way and stay between the value of the tiles (100 and 180 in the exemple) . This is one example between others to do it :

  • Modify the value from 120 to 110
  • Do not modify the value 140
  • Modify the value from 160 to 170


The in-game preview



  • Flat/straight tunnels and bridges

You may have noticed some map makers used the terrain as their advantage and manage to make flat tunnels and bridges entrances. Please find here[drive.google.com] an archive that contains a track exemple that includes both the tunnels and bridges flatten entrances, and the heightmap so you can copy/paste the samples on your map easy.


the in-game preview of the flatten tunnels & bridges entrances

Please have in mind that these samples were made for a 99m terrain ! (maximum height). Any other value will result in a non-working, very bumpy and completly messed up terrain.

Cool, but I cannot include these samples to my track. I need to move up/down your samples !

In my exemple, if you use the colour picker tool from your favorite picture editing software (most of times represented by this icon ), you can see that the elevation of a normal tile that isn't a bridge or a tunnel has the colour 64-64-64 RGB (don't hesitate to compare the heightmap exemple and how look like the track in the track editor to see on which tiles the terrain act).

So, this exemple is good for a road that is set on the colour 64. But mine is [xxx] !

That is easy to fix. Let's say the road where you want to put flatten tunnels and bridges is colour 150-150-150 RGB. Open the terrain with your picture editing software. We will add the ammount of white colour required to the terrain for it goes from 64 to 150 without altering the flattening we want. You have to find a "brightness" effect. I tend to recommand the one from Paint.NET as it never disappointed me, but that should work somewhere else such as Photoshop or Gimp too.


Finding the brightness effect in Paint.NET

Okay, in our exemple you want to switch the sample from a road aimed for a colour 64 to 150, so you have to brighten the terrain of 86 because 150 - 64 = 86. Let constrast to 0.



You can set any value you want as long as you let contrast to 0. Now this sample can be adapted to any of your tracks.

  • Flat ski ramps

It is also possible to play with the terrain to make the ski ramps flat, as shown in the picture below :



You can download a track exemple and it's terrain below that includes :
* the flat tunnel
* the flat bridge
* the flat ski ramp
DOWNLOAD (click)[drive.google.com]
Enabling higher than 100% heightmap slope
The original game restriction do not allow the track maker to exceed 100% slope elevation. The limitation can be removed by opening with notepad game.config located at C:\Users\*YOU*\AppData\Local\Crashday\config. Change "MaxSlopeSuppression": from false to true and save.






A track editor now ready to use from 0 to 2000%


Track & heightmap exemples
Interesting shapes can be drawn as heightmaps and can make interesting tracks ideas :
  • Shapes


The inclined road


The Canal


The Pyramid


The stairs

Please find here[drive.google.com] a zip file including a track with these shapes and it's heightmap.


  • Track exemples


From "[dromed] failed states"


From "[dromed] highlands"


From "[dromed] industrial cliffs"


From "[dromed] Bermuda Triangle"



Conclusion
Advanced heightmap editing can lead to very interesting track types : the main limitation is probably your imagination. If you have questions, do not hesitate to ask them in the comments. I'll try to answer them as best as possible.

Remember to save your heightmaps as 24-bit bitmap (.bmp), otherwise some colour information will be lost, making the terrain bumpy and unplayable.

Have a great heightmap editing :)




26 Comments
Gran_Torino 21 Apr, 2024 @ 3:08pm 
I am impressed by this tutorial, I was able to learn a lot, but why nobody makes a pack of heightmaps layouts, the Enabling higher than 100% of limitation is really good
DromEd  [author] 8 Jun, 2018 @ 7:35am 
@bknoble : The heightmaps must be located in the following directory :

...Steam\steamapps\common\Crashday\user\heightmaps

Once done, you will be able to apply an heightmap to a track by clicking the "terrain" button on the track editor. Here, you can choose the heightmap of your choice and it's elevation.
bknobel 7 Jun, 2018 @ 8:50pm 
Quick question, how do I get my heightmaps into the game?
\4ZO\5DI\1AC 29 Jan, 2018 @ 9:40am 
@DromEd: ahh okay so i try it again with bigger map size and Report from the result. Thank you again.
\4ZO\5DI\1AC 29 Jan, 2018 @ 9:37am 
@DromEd: Hmm Strange i copyed the Terrain example from you only the black drawn field. and set it into a 25x25 track with 100m highness and it don't work. when i draw White walls left and right and set it to 84% highness the Ski jump part works perfect but the Bridge and tunnel Elements don't work. I hope you know the Problem and can explame me my mistake.
DromEd  [author] 29 Jan, 2018 @ 9:36am 
@Zodiac: Yes you can, but not with a map as small as the exemple track. The exact explanation is, you can but not when you are too close of the map limits, regardless of the track's size. So, unlike my exemple, try to put your flat effets as far as possible from the map limits
\4ZO\5DI\1AC 29 Jan, 2018 @ 8:40am 
@DromEd: Thank you for your update i have found my mistake. i have delete the 100m walls to the left and right of the Terrain under the Ski , Bridge and tunnel tileset's. This has led to the faulty representation of Terrains in game. so my finally question is, is there a way to have that flat effect without 100m walls on the left and right side of Terrain?
DromEd  [author] 29 Jan, 2018 @ 2:30am 
@Zodiac: Sorry for the late answer: The guide is updated and you can now find a terrain and track exemple to download that includes the 3 elements (flat tunnel, flat bridge and flat ski ramp). Find it at the end of the "Tips & things to avoid" section. Hope that helps :)
\4ZO\5DI\1AC 18 Jan, 2018 @ 12:23pm 
i have a question to the flst tunnel entrance flat bridge ways and flat sky jump tiles to use as a bridge i understand this part of the guide but i can not reallise it via Paint.NET i have test it many times to draw that part for my self but its a little bit ... ''flat'' so its not really flat.

so a step by step guide to makee this 3 tiles as flat ways / entrances will be nice
DromEd  [author] 2 Nov, 2017 @ 9:45am 
@Kyro: Check the size of your terrain. For a 25x44 track size, the BMP file should be 101x177 pixels. Also make sure the size values are not reverted. (177x101 will not work fine !). Did you save your terrain as a 24 bit BMP format ? With a lower value such as 16 or 8, colour information will be lost making the terrain bumpy and not render as expected. Did you draw the parts that are supposed to be elevated from the black dots, like shown above when the guide talks about the grid ?