"Destructable Dirt" As in Liero

Posted By: Metal_Thrasher

"Destructable Dirt" As in Liero - 01/23/08 03:21

I was at work when this idea hit me. To design a game like Liero. Which, for you guys who aren't familiare is like Worms, except for it isn't turn based, and instead of being on land, you're inside of it. and you dig through it or blast through it. Like this::


Well, the point here is. Does anybody have even the slightest clue to whether it's possible to create a "dirt" that could be destroyed from any angle. It would matter whether it was done 2D or 3D. But I couldn't even think of a single way to acomplish this effect. But i can believe it's entirely immpossible.
PS: I posted here because I awsnt sure where else to post, but I figure like anything in programming a game, it starts with script.
Posted By: xXxGuitar511

Re: "Destructable Dirt" As in Liero - 01/23/08 03:36

Hey bro...

The first (and only) way that comes to mind is be created an "array" of blocks (like minesweeper). Then just removing them to create a tunnel. However, on the front of the block, draw a somewhat round shape thats bigger than the block, so it all looks rounded...
Posted By: Metal_Thrasher

Re: "Destructable Dirt" As in Liero - 01/23/08 04:06

hmmm, it's inventive. but I'm kinda afraid it might come off corny in appearence and functionality. Esp. in comparison to other cames of that kind

((PS: sorry about metal forum dude, I'm having server problems so it's been down))
Posted By: Metal_Thrasher

Re: "Destructable Dirt" As in Liero - 01/23/08 04:20

I'm thinking that to render an effect like this (at least in 2D) you'd need to use direct x. Like what it you could have it draw a circle or clear away vertices or a model being rendered, and some how player entities could only pass through that... Just an idea. thought it's kinda way out there.
Posted By: Nems

Re: "Destructable Dirt" As in Liero - 01/23/08 04:21

Lotsa sprites could do it really well You need both horizontal and verticle types for ground and ceiling plus walls or just walls if you already have a hollow enviro to use.
No matter which way you approach the shot the effect should be created with good results I reckon
Posted By: Metal_Thrasher

Re: "Destructable Dirt" As in Liero - 01/23/08 04:29

Quote:

Lotsa sprites could do it really well You need both horizontal and verticle types for ground and ceiling plus walls or just walls if you already have a hollow enviro to use.
No matter which way you approach the shot the effect should be created with good results I reckon



I'm not sure I'm following ya. How would I use the sprites to get this effect?
Posted By: Ready

Re: "Destructable Dirt" As in Liero - 01/23/08 10:19

A friend of mine wrote a terrain system where verticle positions are stored in voxels (so you can deform it any way you like) ... that would work. Would probably be a bit overkill for 3dgs though
Posted By: Nems

Re: "Destructable Dirt" As in Liero - 01/23/08 18:15

Picture files (sprites) are used to show the underground surface area to the camera . The sprites cover the camera view and when shot at, they are replaced with the explosions, dust and debri of a tunnel being formed by force.
Small tunnel areas would have their walls represented by the sprite inages of the walls whilst the resulting 'cave' look would be shown as the base model or blocks.

Larger areas would do the same or similar.
Posted By: Germanunkol

Re: "Destructable Dirt" As in Liero - 01/23/08 18:25

I just had a similar (or the same?) idea as ready's friend had:

you have one huge block. floating above it, there's a terrain, that is straight. when moving forward or shooting, you move the affected vertecies back behind the block, so that the block's visible at these places...

?

Micha
Posted By: HeelX

Re: "Destructable Dirt" As in Liero - 01/23/08 19:45

Pixel instructions on bitmap tiles.
Posted By: Metal_Thrasher

Re: "Destructable Dirt" As in Liero - 01/24/08 02:59

Quote:

Pixel instructions on bitmap tiles.



That would work well, although, I'm not sure how I would handle collision between that and 3d or even 2d objects.

Quote:

I just had a similar (or the same?) idea as ready's friend had:

you have one huge block. floating above it, there's a terrain, that is straight. when moving forward or shooting, you move the affected vertecies back behind the block, so that the block's visible at these places...

?

Micha




I think you and ready's friend have very good ideas. I like this one alot. Except for one problem being that you can't, at least the last time I checked, tilt a terrian so that it's on it's side. but, on the other hand I could probably creat a terrain that is very verticle, like 89ish degrees upward. Hmm, what do you guys think? In the mean time I'll try this.
Posted By: xXxGuitar511

Re: "Destructable Dirt" As in Liero - 01/24/08 20:02

...you could use a model for this as well, then just find the closest vertice and move it back...
Posted By: Metal_Thrasher

Re: "Destructable Dirt" As in Liero - 01/24/08 20:57

Quote:

...you could use a model for this as well, then just find the closest vertice and move it back...



Yeah but I'm pretty sure that a model with the same amount of faces as a terrain would run slower...but I dunno, i could be wrong.
Posted By: Metal_Thrasher

Re: "Destructable Dirt" As in Liero - 01/26/08 04:17

I had the idea that I could, just use the terrain and still have it laying across "the ground". but give the illusion that it's straight up and down. But that might get tricky with the physics engine. And more ideas out there?
Posted By: xXxGuitar511

Re: "Destructable Dirt" As in Liero - 01/26/08 20:05

...well you can always change the direction of gravity for physics, so that won't be a problem. However, I don't think physics will react to the new deformations.
Posted By: lostclimate

Re: "Destructable Dirt" As in Liero - 01/26/08 20:35

you could modify model files directly and then reload them, but that would be hard as hell to do.
Posted By: Metal_Thrasher

Re: "Destructable Dirt" As in Liero - 01/27/08 00:16

Well what if I made the terrain a physics object it self. PH_POLY. would it work then?
Posted By: xXxGuitar511

Re: "Destructable Dirt" As in Liero - 01/27/08 00:23

...nope
Posted By: Metal_Thrasher

Re: "Destructable Dirt" As in Liero - 01/27/08 02:46

Even using this?:
Code:
ent_fixnormals (my, my.frame); // recalculate the normal vectors, not really needed 


I dont understand why it wont work like that?
Posted By: xXxGuitar511

Re: "Destructable Dirt" As in Liero - 01/27/08 19:08

thats just the normals, you'd need:

c_updatehull(ENTITY* ent, var frame)

"Recalculates collision hulls for the given entity to match the vertex positions of a certain frame (starting at 1 for the first frame). Call this function when you need the collision hull of a certain frame, or when you have applyied mesh manipulation functions to a frame. "
Posted By: Metal_Thrasher

Re: "Destructable Dirt" As in Liero - 01/27/08 21:23

Quote:

thats just the normals, you'd need:

c_updatehull(ENTITY* ent, var frame)

"Recalculates collision hulls for the given entity to match the vertex positions of a certain frame (starting at 1 for the first frame). Call this function when you need the collision hull of a certain frame, or when you have applyied mesh manipulation functions to a frame. "



Ohh, alirght, that makes sense. I'll try this.

PS: In the mean time, and just out of curiosity. Can anybody think of any other ways to accomplish this "destructable dirt" efftect?
Posted By: HeelX

Re: "Destructable Dirt" As in Liero - 01/28/08 10:16

If you use your fake-method with terrain which is inwardly pulled against a plane, you can only achieve good results if you use a very high detailed terrain. The same for models. This could be quiet nasty, especially because the areas where "the floor will be" are not orthogonal at all.

When going the pixel way, you have a high degree of details. The collision detection is a good point, but doable.

Have you already achieved some promising results?
Posted By: ulf

Re: "Destructable Dirt" As in Liero - 01/28/08 10:33

there was a 3d game called redfaction that used a so called "geo mod engine" there you could build tunnels like in liero have a look here:

http://youtube.com/watch?v=yHLRlb16w0g

to get the idea. here is some information on how it works directly from the geomod programmer:

http://john.slagel.com/Geomods.html

hope this helps you.
Posted By: iuselitec

Re: Destructable Dirt As in Liero - 01/28/08 13:12

if you want it to be 3d i would look for a voxel engine. for example you could try voxlap by ken silverman.

if you want it to be polygon based then it would be like writing a modeling application. with functions like extrude and so on.
Posted By: Scorpion

Re: Destructable Dirt As in Liero - 01/28/08 16:31

omg you do it all much too complicated!
use an easy bmap, which reprensent the level and if you want a tunnel paint the accoring texel, just as heelx said before.
As far as I heard it here, I guess you want to make a kind of 2.5D game?
The way I would think of how to make the map 3D is to use a kind of parallax shader. (OR you could use maybe 20 or more sprites that use that bmap and put it on top of each other, but that would still give you some small seams between it).

To realize it in 2D is pretty easy, but there is no common method I can think of that could accomplish that without some strange behavior in some case.
Posted By: xXxGuitar511

Re: Destructable Dirt As in Liero - 01/29/08 03:00

...the only problem with that method is collision.

However, I guess you could also do some pixel-reading instructions to see if that area is cleared first, before moving.
Posted By: HeelX

Re: Destructable Dirt As in Liero - 01/29/08 05:47

You can do that -or- create an approximation of polygonal regions which are tested against simple collision shapes likes circles or rectangles. I shouldn't have said "polygonal" regions, because you might think I'm talking about meshes.. I talk only about a datamodel of it for calculations.

If you have this, you move your collision shape and if it intersects with an edge of a region, it collides - bingo!.. *stop moving*. To test if a shape collides you can test certain (or special) contact points per shape. This is non-trivial to beginners, because you have to basic knowledge about vector geometry and planes & lines in particular. Though, you can make a polygonal shape around your sprite and test this agains the environment shape.. then you have pixel precision.

To simplify it, DirectX has (through Lite-C) a lot of functions for this kind of stuff to quickly make a prototype... well, this is how I would try it.

I think if you google for "pixel based collision" or something like that you will get some articles, on gamedev.net (I think) there are some.
© 2024 lite-C Forums