Deformable terrain


(JJeep) #1

I was just fleshing out some ideas for little projects I could do myself on etqw, and this is basically a thought process dump on deformable terrain, with a few serious questions scattered throughout. I’m taking a not so wild stab in the dark here and guessing that etqw doesn’t have deformable terrain built in by itself? So I was wondering how easy/hard it would be able to do?

I know that with the mega texture it would make it harder than normal because you’d have to deal with the deformaing texture, but if one were to stamp a large enough decal over the area then surely that would cover up the “bad” texture area? As for the networking side, I think it would just be a question of sending the position of the center of the dip and the depth, then the client side could calculate the necessary things and deform the terrain suitably? What are the networking and technical repercussions of such a system and would it be worth it in terms of gameplay, like with extra hiding/sheltering places and stuff?

Also, this same sort of question applies to buildings and stuff, I assume in this it’s a question of the building being modelled with predetermined ‘break-points’ where if the building is hit it will splinter along these lines. Would something like this be able to be added in if it doesn’t already exist?

Thanks for any help/insight/suggestions/tapirs :), really looking forward to playing and modding the game :smiley:


(Hakuryu) #2

I think buildings would be much easier to implement, but both would hurt framerates considerably. For instance, a solid rectangular wall that can break into 5 pieces changes from 12 faces total (2 tri’s per side) into a mess of tri’s that makeup the breakable parts. When whole, you would see just a solid rectangular wall, but the engine is drawing all those extra tri’s to make it up. This used sparingly (only on certain buildings) might not be so bad, but all buildings like this probably would be horrible for framerates.

Deformable terrain would also be a hog for all the extra added geometry, and even slow loading since clients couldn’t just load a map, but must get an updated deformed map loaded when joining an existing game. Considering the terrain is a mesh, and has the megatexture baked on it, without some serious programming I don’t see how it would be done. It would be easier to try something like that with old style brush terrain imo, like some sort of modified mover that alters height, but still the domain of a serious programmer.


(carnage) #3

consider the actuly performace needed to calcualte the deforming vertices or the terrain and think about carmacks keynotes at quakecon. i agree with him that its probably better to have a averagely detailed mesh rather then spending the peformace on trying to fiddle the terrain in lower tris number that in itself causes a hell of a lot more mechanical and visual problems that in turn would probably result in the overall performace of the map to be higher

on another note i wouldnt expect any problems apply the mega texture to deformabe terarin if the x y demensions are the same since you would just be applying the same texture over the same area just made of lower tris


(JJeep) #4

mmm, I hadn’t thought about the affect of having to draw all those extra faces in the buildings… but surely like you say using it sparingly and only on a few buildings would be alright and the resultant frame rate loss wouldn’t be too much? I guess it’s something to do and find out, as that’s going to be the only real way of deciding whether it’s too much or not. And at the end of the day if it doesn’t work out cos of the frame drops, then hey I’ll have learnt a bit about it :slight_smile:

The point that you made, Hakuryu, about the loading clients needing to also load the points that have been deformed, I hadn’t thought about that at all. So carnage, what you’re saying about the lower tris thing is, if I’ve understood it correctly, that if I were to implement this somehow, it would be better to have a lower detail mesh to help with the formation of the craters? I did watch Carmacks keynote, but in the early hours of the morning and I haven’t had the time since. I don’t think that calculating the new mesh would be that hard would it? Given that it would be a small localised area that was being affected, and that it would be a, I’m presuming, simple set of intersections assuming that the craters basic shape is defined as a parabola of some kind determined by the height as I was thinking of doing it.

The megatexture in interesting, one of you is saying that it wouldn’t be possible without some hardcore programming, the other saying it should be fine :P… I had thought that the textures weren’t getting baked onto the mesh, rather being draped over. The only baking I remember being talked about was decals onto the megatexture, but then again I could be mis-remembering.

Thanks though, somethings to think about, which is always good. Discussion can only lead to better outcomes :slight_smile: