Game Development Community

Blowin' crap up

by Bryce · in Game Design and Creative Issues · 08/22/2007 (11:29 am) · 12 replies

Hello GG.
One of the things I would love to do but seems to be absent from a lot of games is the ability to have destructible environments. Not just give an object a maxDamage field, and when it hits that, make a huge explosion and collapse it with some kind of pre-made animation. I mean be able to chip it apart piece by piece. I have this burning desire to launch a rocket at the base of a giant tower and watch the top separate, fall onto the rest and send the whole structure up in a cloud of dust.
I posted this is the game ideas section, so here's my idea. I remember an earlier thread here where the poster thought about building the structures in tiles. Good idea, but very hard to make a big structure by placing tile by tile in a short period of time. My idea is to define a bunch of break points in the mission along breakable parts of the structure, give them a maxDamage variable, and set a variable defining what structure the break point belongs to. The cry engine, if I recall, uses a break point system to destroy objects.
If I could figure out how to make some kind of Boolean Subtract function in Torque (I'm doubting it, but maybe somebody out there has coded something that allows cutting things up in-game), this might work. When a rocket or vehicle hits a wall with break points, a circle is calculated based on the impulse of the rocket or the force of the vehicle. The breakpoints are "damaged", and the outermost breakpoints within the radius that have been damaged enough are cut from point to the next point, creating a new shape in the very middle of those outer points. The new object that was cut out is given rigid body physics, an impulse is applied based on how the wall broke in the first place, and it breaks! If at any time a piece of the structure is in mid air (like if you broke the edges of a ceiling leaving a single piece in the middle), it gets rigid body physics and falls to the ground.

Sound a little far-fetched, and I doubt I could get this working, but I am hoping that I somehow can.

BrYcE

#1
08/22/2007 (10:16 pm)
Y'know, I realize that I said the same thing in the other thread, but seeing as this idea is coming up yet again, I'll say my piece again too.

If you can somehow find a way to incorporate Agea's PhysX SDK into Torque, then even without the PhysX PPU card, you can still calculate the kinds of destruction you want to achieve. The wonderful part is that the physics software in PhysX is able to take a single mesh model, and dynamically segment and deform it. You don't have to pre-design break points and seams. Only basic variables like material type per face/segment/vertex and max stress values.
The software/hardware does the rest.

Model an airplane, complete with cockpit, doors, landing gear, propellers, engine housings, engine components.
The main hull is a single mesh, each engine is a single mesh; propeller, landing gear.... You get the idea.
Now, assign the needed values to each piece of the plane and pipe it through PhysX.
Now crash it into a water tower (full of actual water simulate through fluid dynamics).
Watch as the port wing snaps off, the port engine explodes into fragments, the propeller spins free and flies off like boomerang. One of the pilot seats crashes through the windshield...

This is a only slightly dramatized description of a PhysX demo video.
As more and more big studios start picking up advances physics simulations as part of their games, the PPU may well become as essential to a gamer's machine as the GPU is today.
It may well be inevitable, so why not get in on the 'early adopter' and beat the big boys to the punch?

Oh, just in case you're curious... No, I don't work for Agea. I've used a game system with a PPU, and I've seen first hand how much it rocks, and how much raw potential for amazing games there is.
#2
08/23/2007 (5:43 am)
Sorry, I read that, but I didn't know PhysX did all that breakage, I thought it only handled rigid body and other physics more effeciently. Thank you for letting me know that, I'll have a look at the PhysX resource that is up.
#3
08/23/2007 (6:55 am)
Is Agea physics something I have to buy? Does it require hardware?
#4
08/23/2007 (7:03 am)
I would recommend either writing your own octree data format for destructible interiors or using something like Sauebraten that you can modify in the way you want. I believe Red Faction used a similar approach in its geometry. Using octree data, it was much easier to calculate a blast radius to tear up geometry in a reliable way.

For something on the level of Red Faction, Psyx would crawl. For blowing up things, like the example with the planes, it wouldn't be as bad. For tunneling through level geometry, it could be nightmarish to not only figure out a system to add in all of the information to Physx to process but for Physx to process.

EDIT:
No. You do not have to buy it. You can download the Physx SDK. It does not require a physics card, but it works much better with one.
#5
08/23/2007 (7:58 am)
In defence of my original idea, I would generate buildings procedurally, so you don't have to place tiles by hand. Just give the building's dimensions and hit 'add'.

But on-topic, yes, PhysX is probably your best bet for what you describe. Specifying 'break points' within a mission is sort of half way between the two, allowing more control than letting the computer do everything. For example, if you want to make really sure something will break in a certain way, I guess that'd be useful. But it's a lot more work for the mundane things.
Maybe a hybrid between the two. Actually, from the sound of the PhysX description, you could just specify 'weak spots' in your mesh with a certain material.
#6
08/23/2007 (9:24 am)
Are you sure, David? One of the member posted this in the PhysX resource:

Quote:
1) PPU is PhysX Processing Unit
2) The PhysX is only activated if the end-user has PhysX
3) Coming out in may at 217.37 pounds
4) Its free if you make significant use of the ppu

Edit:

5) Can buy them now

From what I've been reading, you have to pay about 50k to use Ageia PhysX without a PPU, correct me if I'm wrong or this has changed.
#7
08/23/2007 (9:41 am)
From the website:

The AGEIA PhysX SDK is now free for use on PC under our new EULA--for both commercial and non-commercial use.

More info on the website.
#8
08/23/2007 (9:47 am)
Login to the dev forums.

To make use of it for free, you have to:
* Must keep registration information currect
* Must agree to the EULA at the time of download (pops up, but is copied below)
* Available for Windows & Linux (soon)
* No PhysX HW support requirement

Now, for XBox 360 titles, you will need to license it. It is included with the PS3 devkit, according to the site.
#9
08/23/2007 (9:55 am)
Looks like you beat me to it, thank you for the fast response. But I'll post this quote anyway:
Quote:
AGEIA TECHNOLOGIES has announced an End User Licence Agreement (EULA), which will allow its physics engine, the PhysX SDK to be used and its runtime components distributed commercially and otherwise, royalty free.

The EULA means that game developers, be they big name developers or working on smaller projects, will be able to use the PhysX engine with a no-fee licence.

I am so glad I don't have to pay to use it!
#10
08/23/2007 (3:54 pm)
Makes sense for them to let developers currently use it for free, if some amazing games come out that use physx it makes physx look great, and then people think about buying the ppu and once some people buy it and more games come out that use the ppu and people see how amazing that can make a game, more people buy it, etc etc.
#11
08/23/2007 (4:12 pm)
Does the physX resource for TGE cover object breakage? I'm so sorry for asking all these questions, but I don't own TGE yet ($8 away!) and I can't do the engine mods right now. When I look at the videos in that resource, I see objects falling, hitting the ground, rolling, whatever. The joints video shows a bridge and a rope, both of these have an example in which they break, but that's with a jointed object, not one single mesh.
#12
08/24/2007 (7:38 am)
Most likely not. I'm not sure exactly what the hooks are into the Physx SDK, but I do know that it is not fully functional with the SDK.