Game Development Community

Terrain / Object questions

by Frank Bignone · in Torque Game Engine · 09/19/2001 (5:27 pm) · 7 replies

I have some questions regarding terrains and objects in V12, mainly related to scale of the different objects. I know that 1 unit is equal to 1 meters in V12, but :

a) What is the scale of a terrain ? What is the V12 size of a terrain in V12 unit ?
b) By analogy, what is the correspondence of the pixel size of a png map used as a dem to create a terrain and V12 unit ?
c) Is there any way to set the scale of a terrain in a mission file (it may be a dummy question, but I did not look at the mission file for the moment) ?

thx

About the author

Real programmers don't waste time recompiling; they patch the binary files... ... Real programmers don't waste time patching binary files; they patch memory.


#1
09/20/2001 (4:19 am)
Not sure if this is right exactly, but the terrain heightfields are 256x256 images, and the tile size is defined by the mission (generally its 8) so I'd imagine the size of a terrain tile is generally 256*8x256*8, or 2048x2048

and the terrain textures are stretched and blended to fit onto a tile, so that's also defined per mission

-nohbdy
#2
09/20/2001 (6:56 am)
The textures are 256x256 and stretched over an 8x8 grid of squares, so each terrain square (8mx8m) is covered by 32x32 texels. This makes the terrain about 4 texels per meter, as compared to the interiors which usually have 32 texels per meter. Much lower resolution, but then the interiors don't need to cover as much visible area :)
#3
09/20/2001 (11:43 pm)
As stated in the replies, is it possible to change the scale of the terrain in the mission file to something different than 8 ?
#4
09/21/2001 (12:42 am)
Yes, but there are risks.

Water areas may end up with 'holes' in them - areas where there is water, but it is not visible. This is because the engine visually removes areas of water that are under terrain, but it assumes a square size of 8, so other values result in the water being mis-sized and the missing areas can be exposed. Someone did post a way to fix this by preventing the square-removal process - don't remember where it was, but it was here on GG.

The second risk is with the AI routines, which did not account for unusual square sizes in T2. This will hopefully be fixed when the AI is re-written for the V12 (it IS being re-written isn't it?).

In any case, if the above is not a problem for you, look at the terrain object in the .mis file. You will find a setting for squareSize. Change it to something besides 8...
#5
09/22/2001 (2:58 am)
The AI stuff that we're working on is not going to care about terrain square size.
#6
09/22/2001 (8:10 am)
Excellent! Looking forward to that.