Game Development Community

Raising/Lowering The Level Of the Terrain

by Jared Kidd · in Torque Game Engine · 09/21/2009 (11:23 pm) · 13 replies

in the mission flat.mis i want to raise the terrain so i can lower the terrain as well as raise. i can already raise the terrain but i can't lower it. if you need more detail on my problem just let me know because i don't think i explained it well but thanks for any help :)

About the author

i'm 16 and i really enjoy making games and testing them. i started making games when i was 11 using game maker, but then i started using torque when i was about 13 and now i fell in love with game designing and look forward to making a career out of it.


#1
09/21/2009 (11:58 pm)
The flat terrain is just that. It's no more than a flat plane. You need to raise it in order to make anything from it. What I normally do is to open up Paint Shop Pro (or any Good paint program) and make a medium grey (solid) image to use as a heightmap then fix from there.
#2
09/22/2009 (12:02 am)
how do u use heightmaps? yeah problably noob question lol :P
#3
09/22/2009 (6:55 am)
It's simple. Place your hightmap.png file (name it whatever you want) in "~/data/terrains/heightmaps/" (you'll need to make that folder) then go into your game, press F11 then F7. (you want the terrain terraformer)
From there, click on "operation" to bring down the drop down menu and pic bitmap. Browse to your heightmap and click it, apply it, save your game. Now you'll need to adjust your spawn point so you don't spawn under your ground.
#4
09/22/2009 (11:10 pm)
Most likely your terrain is set at 0, you cant lower the terrain beyond 0.

Try set your terrain at 100 and you should have more control over it.
#5
09/22/2009 (11:13 pm)
thanks guys i finally got it working but i used detail.png as the bitmap for the terraformer. i tryed making heightmap. png using a medium grey i made but for some reason it wouldn't wort, but CSMP how do you set the terrain to 100?
#6
09/22/2009 (11:27 pm)
I am sure there are easier ways, such as going into the .mis file and setting the height at 100(Which "should" keep your current terrain deformations), but I usually just use the 25x25 brush and Set Height to "paint" the entire terrain at 100.

Though this strictly gives you a flat terrain.
#7
09/23/2009 (1:46 am)
In essence a heightmap is sort of like a contour map with the contours of your terrain mapped to different colors (typically grayscale). All black corresponds to the lowest point and the lighter/whiter the other areas are then the higher up they are.

In the Terrain Terraform Editor you can set a MinTerrainHeight and a HeightRange. The MinTerrainHeight corresponds to the lowest point of your terrain. The terrain block then fills in the terrain height based upon these two settings and the gradation of your heightmap. If you set MinTerrainHeight to greater than zero you will be able to dig/excavate below the lowest point on your heightmap until you reach the zero height. If however, the MinTerrainHeight is set to zero you will not be able to dig/excavate below the lowest point of your heightmap.
#8
09/23/2009 (1:56 am)
To follow up:

In order to set your terrain height to 100 simply, make the MinTerrainHeight equal to 100 and set the HeightRange to the maximum height you want on your terrain.

If you're having problems with creating new heightmaps: in TGE you need to make sure that they're 256 X 256 in size and must be in the .png format -- I don't think that color depth matters (just don't hold me to that last one).
#9
09/24/2009 (2:22 am)
So this should allow you to lets say make underground tunnels?
#10
09/24/2009 (2:31 am)
Quote:
So this should allow you to lets say make underground tunnels?
No, due to the nature of the Legacy terrain this has nothing to do with underground tunnels. In order to make such you would have to create your tunnel or cave as a mesh (TSSTatic) or an Interior. You would then place this "underground" object under the terrain and use the "setEmpty" action to cut a hole in the terrain in order to gain access to the "underground".
#11
09/24/2009 (10:58 am)
Is there a MinTerrainHeight in T3D? I have been having trouble using the lower height tool on some terrains I import from L3DT.
#12
09/24/2009 (3:37 pm)
@Steve:
I know that Torque3d's terrains can be positioned and rotated in almost any matter, but I'm not really sure how it determines the equivalent to the Legacy Terrain's "height range".

When you import your terrain heightmap from L3DT, you can adjust the meters per pixel and a "Height Scale" in the Torque3d dialog -- it's in this height scale that I believe is where the equivalent type of height range is determined.

It seems to me that this forces a cap on the maximum amount of different elevations that can be untilized. Which come to think of it, I think this also happens in the old terrains also if there is an extreme abount of diversity in the elevations.

Perhaps, if you need more room for digging/lowering, you might be able to open your heightmap in an image-editor and adjust your color range (not the color depth) so that your heightmap would be a little "higher" off the ground so to say -- I hope that makes sense ;)
#13
09/24/2009 (9:15 pm)
Thanks for the info, Michael, but I found out what the problem was. For some reason, in L3DT if you use the "clip heightfield" tool, you can never (in T3D) lower the heightfield below that level. Therefore, all the terrain editing tools will work, but not lower height. Guess I just won't use L3Dt's clipping tool.