Destructible Terrain

I am trying to create destructible terrain, but am having trouble with it. I am wanting to create a ground that will be destroyed by other objects, such as missiles, much like in a “worms” game.

I tried using transparency masks to achieve this, but it seems like each item can only have one mask. Then I found a crop library which saves a custom image to disk and then uses that for a custom mask, but it doesn’t seem like this solution will work either.

Was wondering if anyone has encountered a way to achieve this?

Any help would be much appreciated!
Thanks in advance! [import]uid: 202828 topic_id: 36322 reply_id: 336322[/import]

Haven’t got any suggestions, but was very interested in this awhile back and came to a brick wall - so be interested if anybody has any creative solutions.

I started down the same path, using the masking concept that I believe Team17 used for Worms, but couldn’t get very far.

Sorry for lack of input, but hopefully we might get some further opinions on the subject. [import]uid: 33275 topic_id: 36322 reply_id: 144285[/import]

Hi guys,
I probably can’t find the link anymore, but the developers behind the Corona game “Little Generals” (similar game style to the classic “Scorched Earth”) once discussed how they accomplished this through a fairly advanced but intuitive method. If I recall, they basically constructed the terrain out of a series of physics objects (boxes), with the objects nearer to an “edge” (i.e. a cliff, or the surface) being constructed of smaller squares, and the “deep” areas being constructed of very large squares, because nothing would at the time affected those deep areas and they didn’t need to be compiled of hundreds of tiny boxes.

As the ground was destroyed, larger boxes would be dynamically “broken down” into smaller bits, with each new bit joined to its neighbors by a physics joint. Thus, the terrain could be slowly destroyed, creating a quite nice effect.

This might not be what you had in mind, but it’s worth considering as an option.

Brent [import]uid: 200026 topic_id: 36322 reply_id: 144291[/import]

How would one go about accomplishing that? I am absolutely stumped, and this issue is kind of the deal breaker for a game that requires you to fall through the ground because it’s exploding… XD [import]uid: 232582 topic_id: 36322 reply_id: 144362[/import]

Thanks to everyone for their input!

Still having trouble finding a solution to this. I had a look at “Little Generals” as suggested by Brent. Thank you for that reference. It does manage to achieve a similar effect, but wasn’t really what I am after unfortunately.

I am still trying some possible alternatives, and any further help would be greatly appreciated!
Really hoping that my team and I don’t have to try looking into another kit to accomplish this.
Thanks again in advance! [import]uid: 202828 topic_id: 36322 reply_id: 144395[/import]

jwong, how is your project coming along? I am looking to maybe get on board somewhere small I can contribute some original art, and maybe develop some coding skills. I have a pretty good idea for a small app but I don’t know anyone in this area to get started myself. [import]uid: 232582 topic_id: 36322 reply_id: 144419[/import]

Hi @jwonglc,
Can you provide a detailed description of what you’re trying to accomplish in terms of “destructible terrain”? I think the community will be able to help you further if you provide a detailed example. Some screenshot links or sample YouTube videos would be even more helpful.

Thanks,
Brent [import]uid: 200026 topic_id: 36322 reply_id: 144449[/import]

Thanks for looking at this Brent,

Basically, what I am looking for is terrain that functions exactly like worms:

  • floats in mid air
  • parts of it can be destroyed by blasts

The problem is, Corona doesn’t support drawing pixels on the screen. We have to compromise by drawing rects.
The thing is, if we want detailed, art drawn terrain (like worms), we will need to draw many rects on the screen.
With 2x2 and 1x1 rects, the simulator slows down too much and frame skips a lot.
With 3x3 rects filling half the screen, its smooth, but looks quite pixelated.

But if we implement zooming out, the number of rects needed on the screen could double or triple.
I don’t think dynamically resizing the rects while zooming is feasible, and would cause the terrain to become too pixelated.

Using an image for the terrain and masking destroyed parts is out of the question, since each image can only have one mask, and you can’t dynamically create masks on the fly.

I am currently out of ideas. Would there be a possible solution to this to achieve the kind of terrain with the flexibility I am after?

Thanks again!
@tyler.a.nichols
Hi Tyler, would be great to see some of your artwork if you have them up somewhere? [import]uid: 202828 topic_id: 36322 reply_id: 144504[/import]

Haven’t got any suggestions, but was very interested in this awhile back and came to a brick wall - so be interested if anybody has any creative solutions.

I started down the same path, using the masking concept that I believe Team17 used for Worms, but couldn’t get very far.

Sorry for lack of input, but hopefully we might get some further opinions on the subject. [import]uid: 33275 topic_id: 36322 reply_id: 144285[/import]

Hi guys,
I probably can’t find the link anymore, but the developers behind the Corona game “Little Generals” (similar game style to the classic “Scorched Earth”) once discussed how they accomplished this through a fairly advanced but intuitive method. If I recall, they basically constructed the terrain out of a series of physics objects (boxes), with the objects nearer to an “edge” (i.e. a cliff, or the surface) being constructed of smaller squares, and the “deep” areas being constructed of very large squares, because nothing would at the time affected those deep areas and they didn’t need to be compiled of hundreds of tiny boxes.

As the ground was destroyed, larger boxes would be dynamically “broken down” into smaller bits, with each new bit joined to its neighbors by a physics joint. Thus, the terrain could be slowly destroyed, creating a quite nice effect.

This might not be what you had in mind, but it’s worth considering as an option.

Brent [import]uid: 200026 topic_id: 36322 reply_id: 144291[/import]

How would one go about accomplishing that? I am absolutely stumped, and this issue is kind of the deal breaker for a game that requires you to fall through the ground because it’s exploding… XD [import]uid: 232582 topic_id: 36322 reply_id: 144362[/import]

Thanks to everyone for their input!

Still having trouble finding a solution to this. I had a look at “Little Generals” as suggested by Brent. Thank you for that reference. It does manage to achieve a similar effect, but wasn’t really what I am after unfortunately.

I am still trying some possible alternatives, and any further help would be greatly appreciated!
Really hoping that my team and I don’t have to try looking into another kit to accomplish this.
Thanks again in advance! [import]uid: 202828 topic_id: 36322 reply_id: 144395[/import]

jwong, how is your project coming along? I am looking to maybe get on board somewhere small I can contribute some original art, and maybe develop some coding skills. I have a pretty good idea for a small app but I don’t know anyone in this area to get started myself. [import]uid: 232582 topic_id: 36322 reply_id: 144419[/import]

Hi @jwonglc,
Can you provide a detailed description of what you’re trying to accomplish in terms of “destructible terrain”? I think the community will be able to help you further if you provide a detailed example. Some screenshot links or sample YouTube videos would be even more helpful.

Thanks,
Brent [import]uid: 200026 topic_id: 36322 reply_id: 144449[/import]

Thanks for looking at this Brent,

Basically, what I am looking for is terrain that functions exactly like worms:

  • floats in mid air
  • parts of it can be destroyed by blasts

The problem is, Corona doesn’t support drawing pixels on the screen. We have to compromise by drawing rects.
The thing is, if we want detailed, art drawn terrain (like worms), we will need to draw many rects on the screen.
With 2x2 and 1x1 rects, the simulator slows down too much and frame skips a lot.
With 3x3 rects filling half the screen, its smooth, but looks quite pixelated.

But if we implement zooming out, the number of rects needed on the screen could double or triple.
I don’t think dynamically resizing the rects while zooming is feasible, and would cause the terrain to become too pixelated.

Using an image for the terrain and masking destroyed parts is out of the question, since each image can only have one mask, and you can’t dynamically create masks on the fly.

I am currently out of ideas. Would there be a possible solution to this to achieve the kind of terrain with the flexibility I am after?

Thanks again!
@tyler.a.nichols
Hi Tyler, would be great to see some of your artwork if you have them up somewhere? [import]uid: 202828 topic_id: 36322 reply_id: 144504[/import]

Haven’t got any suggestions, but was very interested in this awhile back and came to a brick wall - so be interested if anybody has any creative solutions.

I started down the same path, using the masking concept that I believe Team17 used for Worms, but couldn’t get very far.

Sorry for lack of input, but hopefully we might get some further opinions on the subject. [import]uid: 33275 topic_id: 36322 reply_id: 144285[/import]

Hi guys,
I probably can’t find the link anymore, but the developers behind the Corona game “Little Generals” (similar game style to the classic “Scorched Earth”) once discussed how they accomplished this through a fairly advanced but intuitive method. If I recall, they basically constructed the terrain out of a series of physics objects (boxes), with the objects nearer to an “edge” (i.e. a cliff, or the surface) being constructed of smaller squares, and the “deep” areas being constructed of very large squares, because nothing would at the time affected those deep areas and they didn’t need to be compiled of hundreds of tiny boxes.

As the ground was destroyed, larger boxes would be dynamically “broken down” into smaller bits, with each new bit joined to its neighbors by a physics joint. Thus, the terrain could be slowly destroyed, creating a quite nice effect.

This might not be what you had in mind, but it’s worth considering as an option.

Brent [import]uid: 200026 topic_id: 36322 reply_id: 144291[/import]

How would one go about accomplishing that? I am absolutely stumped, and this issue is kind of the deal breaker for a game that requires you to fall through the ground because it’s exploding… XD [import]uid: 232582 topic_id: 36322 reply_id: 144362[/import]

Thanks to everyone for their input!

Still having trouble finding a solution to this. I had a look at “Little Generals” as suggested by Brent. Thank you for that reference. It does manage to achieve a similar effect, but wasn’t really what I am after unfortunately.

I am still trying some possible alternatives, and any further help would be greatly appreciated!
Really hoping that my team and I don’t have to try looking into another kit to accomplish this.
Thanks again in advance! [import]uid: 202828 topic_id: 36322 reply_id: 144395[/import]

jwong, how is your project coming along? I am looking to maybe get on board somewhere small I can contribute some original art, and maybe develop some coding skills. I have a pretty good idea for a small app but I don’t know anyone in this area to get started myself. [import]uid: 232582 topic_id: 36322 reply_id: 144419[/import]