Game Development Community

Tunnels

by Cory Anderson · in Technical Issues · 05/24/2007 (8:51 am) · 3 replies

"Okay so I have spent the last hour reading up on the different techniques for placing tunnels in the terrain. I now understand the set empty thing, but the problem is that it removes large chunks of the terrain. I need to be able to just remove terrain within the interior. Is there some sort of code of code or dynamic field I can set that would set all terrain within the bounds of the interior invisible and non-collidable? Thanks guys."

I placed this thread on the art forum, and I got a lot of helpful answers about creating empty squares and matching the tunnel interiors to the squares, or blending the interior into the terrain using DTS shapes to prevent gaping holes on the outsides where the empty squares don't quite match interior dimensions. These are great but it just seems like a lot of extra steps.

I don't see why it wouldn't be possible to script somewhere, telling the engine to render all terrain data within certain interiors non-existant, or at list invisible and non-collidable. It seems that rendering them non-existant would create problems because the terrain is based on squares, so I think the best option is to code it to make it invisible and non-collidable.

Any ideas? Thanks.

#1
12/03/2007 (2:20 pm)
It already makes the terrain invisable inside of interiors, but still colidable. Maby you should find the source code that tells the game to make that terrain invisable, and modify it so that it also makes it so you can't collied with it.
#2
12/03/2007 (3:21 pm)
You would probably be better off setting the tile size smaller and deleting the offending tiles over trying to set collision to off for those tiles.
#3
12/03/2007 (8:22 pm)
*nod* ..I noticed the default tile size was not conducive to popping tunnels as well. Soon as I shrank the tile size? not so much problem. Then I looked at the lighting demo (in 1.5)? Hah - they merely shank the tile a small bit and made an entrance "plug" around the the lip of the hallway and filled in the gap. Pretty suave solution - and easy to do.