Game Development Community

Show terrain inside

by Bert Heuvingh · in Artist Corner · 11/23/2005 (6:09 am) · 12 replies

For interior models there is a checkbox for "show terrainInside" that causes terrain not to be rendered inside the interior. So far, so good. But how can i get TGE to not use terrain collisions inside ?
its nice not to see terrain inside a building thats half burried in a mountain, but when i still bump into it (the invisible terrain) it's not much use.
Any idea's ?

#1
11/23/2005 (6:10 am)
One solution is to clear the terrain tile inside your building. Trouble is, the terrain tiles are a fixed size. so you'll have to make your building cover the hold you make in the ground.
#2
11/23/2005 (6:36 am)
Sounds reasonable, do you know any tutorials that show how to do this ?
#3
11/23/2005 (6:42 am)
Just set the action of your brush in the texture painter to Set Clear and you'll start cutting holes in the ground.
#4
11/23/2005 (6:43 am)
Clearing blocks in the terrain is extremely simple.

Go into the mission editor, go to the terrain mode
In the menu with the block sizes and stuff, there's a set and clear option I think.
Choose Clear and then were ever you click on the terrain, a big square hole will appear.
If you want to fil the holes, you choose the other option.

Please forgive any inaccuracies in my description, I'm not next to a Torque machine so I may have inaccurate names for things, but the process is sound.

Good luck.


Just remember to cover over any holes with a building or something or your player will fall to forever...
#5
11/23/2005 (7:31 am)
Thanks for the quick replies Jason and Neil.

I cut one hole in the terrain and now my terrainblock looks like this:

new TerrainBlock(Terrain) {
rotation = "1 0 0 0";
scale = "1 1 1";
detailTexture = "~/data/terrains/detail1";
terrainFile = "./test1.ter";
squareSize = "8";
emptySquares = "219264 219520 219776 99744 443522 443778 444034";
bumpScale = "1";
bumpOffset = "0.01";
zeroBumpScale = "8";
position = "-1024 -1024 0";
locked = "true";
};

anybody knows what those number in

emptySquares = "219264 219520 219776 99744 443522 443778 444034";

are ? I'm trying to generate the .mis file myself, so I need to be able to asign the holes in the map this way too.
#6
11/23/2005 (8:09 am)
Hmm, don't know. But the general way to do this is described here.
#7
11/23/2005 (3:12 pm)
As I understand it, torque generated a bit-wise mask for the terrain that is used for cutting holes. The emptySquares = "219264 219520 219776 99744 443522 443778 444034";
bit in the .mis file defines where the holes go ean d how big they are. I just can't figure out what those magic numbers are.
I guess they're not coordinates, but what else ?

btw, is there any documentation about the .ter file format (the terrain file) ? I'm trying to make completely random generated missions, including terrains.
#8
11/23/2005 (10:20 pm)
This one's from James Urquhart: "terrain/terData.cc.
The heightmap data comes after the version, which is one byte.
The heightmap data is an of S16's, of the size "TerrainBlock::BlockSize * TerrainBlock::BlockSize"."

So you basically look at terData.cc to find your way.

Interesting project btw.
#9
11/24/2005 (3:10 am)
Thanks, I'll look into terData.cc
maybe I can find the hidden meaning of the magic emptysquare numbers in there too :)
#10
11/28/2005 (9:03 am)
In the meantime i found out that the numbers in
emptySquares = "219264 219520 219776 99744 443522 443778 444034"
are start and end indicators of strips of empty tiles in the map.
I dont know how exactly but i by guess is that the map has some kind of quad-space division system wich results in very strange numbers for the tile indices. Hopefully someone can understand what i am talking about and explain to me how I can calculate the numbers myself if i wanted to place the holes with a texteditor (theoretically)
#11
11/29/2005 (2:45 am)
The numbers were less complicated then I thought.

" U32 offset = mEmptySquareRuns[i] & 0xffff;
U32 run = U32(mEmptySquareRuns[i]) >> 16;"

from terrData.cc says it all. On to the next problem !
#12
11/29/2005 (8:58 am)
Now that I found out how the emptysquares work, i bumped into the next problem.

My type of level requires sometimes very small holes (emptysquares) in the terrain, but when I zoom out, or look from a distance, the dynamic lod-system of the terrain causes the holes to be filled up, thus visually blocking entrances, which looks very weird.
Is there a way I can asign certain parts of the terrain to NOT turned into larger polygons at bigger distances ?

I you dont get what I'm talking about i could try to post some screenshots to make it clear.