Game Development Community

Deformable Terrain!

by Alexander Porter · in Torque Game Engine · 08/09/2002 (9:00 pm) · 11 replies

Okay, so I haven't successfully done it but i know how we could do it. heres my plan:

We need a function to be called on the projectiles explosion that will call on the LowerHieghtAction used in the terrain editor to lower the terrain. but we also need to create a brush the size of the explosion radius. I haven't been able to do so yet. Maybe someone could help us all with this idea.

~Alex

I've tried but my programming knowledge hinders me when it comes to the engine

#1
08/09/2002 (10:04 pm)
The problem with doing this is that the terrain uses a static lightmap, so the lighting will not be updated when the terrain is deformed. (meaning it will look very strange).

-Snowman
#2
08/09/2002 (10:56 pm)
maybe we could have that area be "re-lighted". or possible add a small light to the the area to make it look ok? in tribes etc, if it was lit wrong, a dynamis light changed it to be right.
?
~alex
#3
08/10/2002 (1:31 am)
I *think* at the moment, the speed of torque's lighting system would really lag the game if you kept updating the lightmap of an area of the terrain.
#4
08/10/2002 (2:54 am)
maybe there could be a light on the player that only lights certain stuff. ie deformed terrain?
#5
08/10/2002 (11:18 am)
Ya know now that I think of it, when you edit the terrain in the editor and then exit the editor and play, the lighting isn't messed up at all. but in any case i think we should still try it. would anyone be willing to help me with the code?

~Alex

No hurt in trying.
#6
08/10/2002 (11:33 am)
place a big building or something.. relight --> it will leave a gigantic shadow. Now deform the terrain.. the shadow stays there. You have to relight.
Now.. even more drastic. Find a hill that blocks the sun... flatten it. You'll still see the shadows on the ground.
Also, when you have deformable terain chances are big .dif can no longer be used.. even if you define areas that cannot be deformed because a building is on it.. you'll be able to "dig" around that area until only that area is left skyhigh. You see, there's a lot more to it then you would think.
I'm sure there are workarounds for all of this. But they all seem more of a hack then a real solution. You'll have to do some heavy work to have a real solution for this problem.
#7
08/10/2002 (1:19 pm)
k- ill think on it
#8
08/10/2002 (6:15 pm)
Perhaps if you didn't give completely free reign to the deformation. If it could only be deformed a little bit, like maybe a crater or something, then a) the lightmap problem would be less (not gone tho) and b) you wouldn't have the "digging around a .dif" problem really. You could also maybe do something with texturing of the deformed area to hide the lighting problem a little.
#9
08/11/2002 (4:06 am)
But then if you want to create a crater in a crater?

No the lightmap problem needs to be solved before deformable can be implemented.
#10
08/11/2002 (4:12 am)
hm, there are some guys claiming to have dynamic per pixel lighting in Torque... but they don't seem to be willing to give out any details or even code... would solve the major problem here, I guess...
#11
08/11/2002 (4:28 am)
@stefan: not sure that it will as their current implementation works for the object only. Moreover, you will still need to re-compute shadows, ...