LWJGL Forum

Programming => General Java Game Development => Topic started by: Rene on November 07, 2009, 15:07:48

Title: Terrain 'destruction'
Post by: Rene on November 07, 2009, 15:07:48
Hi all,

I just made some progress with my engine allowing it to destroy (well, actually distort) terrain in real-time. It still needs some more optimization and freedom in the code where you define the distortion, but the basics already work. Here is a link to a video showing the effect. If anyone's interested, I can share the code with you.

http://www.xyzw.nl/DynamicTerrain.wmv
Title: Re: Terrain 'destruction'
Post by: delt0r on November 07, 2009, 15:34:49
Looks good. How do you intend to deal with path planing in such a environment? What about the terrain becoming impassable.
Title: Re: Terrain 'destruction'
Post by: Rene on November 07, 2009, 15:43:00
It's pretty easy to calculate the terrain normal on a cell. So every time the terrain is altered, a 'slope map' would be updated containing the slope of the terrain at each cell.

When a path is calculated, the unit can only use the cells with slopes lower or equal to what the unit can handle.

Or at least, that's what I'm planning ATM
Title: Re: Terrain 'destruction'
Post by: delt0r on November 07, 2009, 15:59:46
Thus the question about impassible terrain. All i need to do to defend my base (for an RTS) is bomb the crap out of the access areas or all around. Gives turtles a pretty strong hand. Otherwise there is the issue of mission can't be completed cus you can't get to your goal. I realize that "encompassing" terrain due to bombs etc is part of real battles but is it fun?

I was going to have deformable terrain in my game. But the pre-calculation i used for path planing and other AI pre-calculation data about the terrain was going to make it very difficult. So i dropped it.
Title: Re: Terrain 'destruction'
Post by: Rene on November 07, 2009, 16:12:41
The destruction isn't something I just wanted to add to the game, but it would really be one of the game play features.

A part of the level bombed to crap so it's impassable can be bombed by some kind of 'averaging-bomb', averaging the terrain height to some degree so it becomes passable again.