Dynamically destroying terrain ALA Worms ...
by Mic Pringle · in Torque Game Builder · 11/14/2008 (7:36 am) · 5 replies
Hi,
I would really like to implement a terrain system (perhaps based on tilemaps?) that would allow dynamically destroying parts of it based on certain factors from any collision, just like in Worms where you could use different weapons to destroy parts of the landscape, the better the weapon the bigger the damage. Or like in Lemmings where you could set a Lemming as a digger and he would dig down vertically, destroying the terrain as he went.
Is it possible to implement this type of thing in TGB, and if so does anyone have any ideas of how to go about it ?
Thanks
-Mic
I would really like to implement a terrain system (perhaps based on tilemaps?) that would allow dynamically destroying parts of it based on certain factors from any collision, just like in Worms where you could use different weapons to destroy parts of the landscape, the better the weapon the bigger the damage. Or like in Lemmings where you could set a Lemming as a digger and he would dig down vertically, destroying the terrain as he went.
Is it possible to implement this type of thing in TGB, and if so does anyone have any ideas of how to go about it ?
Thanks
-Mic
About the author
#2
You will basically have to work with a tilemap of dynamically created textures and modify the pixels of those textures at runtime for the holes etc.
Not sure thats possible through script
05/14/2009 (2:45 pm)
This type of thing is possible but is no trivial thing.You will basically have to work with a tilemap of dynamically created textures and modify the pixels of those textures at runtime for the holes etc.
Not sure thats possible through script
#3
One of them takes a lot of math, but I believe it may work...
05/14/2009 (3:50 pm)
Well... I had a few theories on how to do it, but I could not actually make it work...One of them takes a lot of math, but I believe it may work...
#4
They do 3D accelerated worms like terrain deformation and basically use an approach similar to what I mentioned above as this is required to keep the amount of pixels on all to be reuploaded textures low.
with tiles you can basically decide which tile you need to modify, modify the texture there with pixel operations and reupload it.
an alternative to this is an opacity map, to which you draw with alpha 0 whereever the pixel is meant to be gone and use that to blend with the original terrain texture(s). For a pure worms like game this would also work.
Where it would struggle more is when it comes to "pixel sand physics" as you would need to update the opacity map all the time which would become costly due to the masses of reuploads.
05/14/2009 (5:09 pm)
One of the simplest way to learn about potential options is to give the Clonk Endevour sources a go if they are still offered.They do 3D accelerated worms like terrain deformation and basically use an approach similar to what I mentioned above as this is required to keep the amount of pixels on all to be reuploaded textures low.
with tiles you can basically decide which tile you need to modify, modify the texture there with pixel operations and reupload it.
an alternative to this is an opacity map, to which you draw with alpha 0 whereever the pixel is meant to be gone and use that to blend with the original terrain texture(s). For a pure worms like game this would also work.
Where it would struggle more is when it comes to "pixel sand physics" as you would need to update the opacity map all the time which would become costly due to the masses of reuploads.
#5
For those interested, here's where I found a link to the source for Clonk Endeavour: www.clonk.de/source.php
05/15/2009 (10:19 am)
@Marc: Thanks for the tip on Clonk Endeavour. It look like it does almost exactly what I would want to do, as far as destructive environment. Unfortunately I'm an artist, not a programmer. Also I'm on a Mac. So I'm probably going to have to shelve my idea for awhile until I can learn quite a bit more.For those interested, here's where I found a link to the source for Clonk Endeavour: www.clonk.de/source.php
Torque Owner Collin Burton