Digging trenches, ponds, etc...
by Stephen McGreal · in Torque Game Engine · 05/06/2004 (3:28 am) · 4 replies
Hi,
I'm making a game which features man-made structures which exist in holes in the terrain (for example an ornamental fountain set into the ground with tiled waterways running off it, that kind of thing). I'm building the structures as DIFs. When I put them into Torque, I can arrange them such that the top edges sit flush with the terrain, but of course the terrain continues right through them. Trying to lower or delete the terrain inside these structures doesn't work because the tiles are too big relative to the structures. I know I can decrease the tile size (in fact I plan to, as my levels will be pretty compact) but I'll still have troubles matching up the edges properly and will get holes/overlaps on (for example) the non-axis aligned edges of hexagonal structures. I'm toying with the idea of building edges onto the diffs to cover up any holes but I still foresee problems with getting it all to match up. I guess what I really want is something like the "CSG carve" functions you get in BSP editors, to cut a neatly fitting hole into the terrain for my structures to sit in, but I know that heightmaps don't work that way.
I hope I've explained this properly. Any ideas as to how I might get around this problem?
I'm making a game which features man-made structures which exist in holes in the terrain (for example an ornamental fountain set into the ground with tiled waterways running off it, that kind of thing). I'm building the structures as DIFs. When I put them into Torque, I can arrange them such that the top edges sit flush with the terrain, but of course the terrain continues right through them. Trying to lower or delete the terrain inside these structures doesn't work because the tiles are too big relative to the structures. I know I can decrease the tile size (in fact I plan to, as my levels will be pretty compact) but I'll still have troubles matching up the edges properly and will get holes/overlaps on (for example) the non-axis aligned edges of hexagonal structures. I'm toying with the idea of building edges onto the diffs to cover up any holes but I still foresee problems with getting it all to match up. I guess what I really want is something like the "CSG carve" functions you get in BSP editors, to cut a neatly fitting hole into the terrain for my structures to sit in, but I know that heightmaps don't work that way.
I hope I've explained this properly. Any ideas as to how I might get around this problem?
About the author
#2
05/06/2004 (9:27 am)
The edges in the DIF approach sounds best. You're welcome to implement BSP carve on the terrain but it's probably not gonna be as easy a solution as just adding a nice tiled border to your hexagons.
#3
What about looking at the problem from the other angle - is it possible to export the heightmaps to .MAP files, say? That way I could chop out the piece I need, carve my structure into it, and export a DIF which should slot nicely back into the landscape I took it from...
05/06/2004 (10:08 am)
That's kinda what I thought, but it's far from an ideal solution, if only because I'd suddenly be tied into a terrain tile size, which I couldn't change without changing all my DIFs, and I have no real way of relating terrain tile size to how big to make the squares in the DIFs, short of trial and error (unless someone knows a cunning solution to that one?). It also limits me somewhat in how I texture areas around them, as getting them to match up in scale, offset etc strikes me as a bit of a nightmare :o(What about looking at the problem from the other angle - is it possible to export the heightmaps to .MAP files, say? That way I could chop out the piece I need, carve my structure into it, and export a DIF which should slot nicely back into the landscape I took it from...
#4
05/06/2004 (11:25 am)
I would do a rocky border "wedge" that was big enough to cover the removed square. Shouldn't be too hard to tweak - and it shouldn't be exact, because the CLOD on the terrain will make geometry shift around. I think some of the tribes1/2 interiors did this, if you need examples (they're both up for download on fileplanet).
Torque Owner Stefan Lundmark
Didn't get a solution to the problem though.