question about cities and destroying part of a mesh

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
krazyscotsman
Gnoblar
Posts: 17
Joined: Thu Aug 21, 2003 7:17 pm
Location: San Diego, CA
Contact:

question about cities and destroying part of a mesh

Post by krazyscotsman »

I'm not sure if this should be in content creation or in the programming section - so mods please move if necessary.

My group is working on a flight sim that will also fight a real time war (meaning if you do not fly, the war continues without your assistance). Myself, I would like to do the cities as meshes instead of painted tiles. I know we are sacrificing some fps; however, for the sensation of speed, locking targets, etc a real model is more appealing than painted textures. I know by collapsing multiple buildings into a single mesh we can save on the feel rate. However, my concern (and I am not a programmer) is that when a player drops a bomb on a city building, I do not want the entire mesh (city block) to be affected, only the building and maybe surrounding buildings. In 3D Max, you can accomplish this with a bomb and setting fall off amounts. Can this be accomplished in OGRE or by programming? How difficult would it be?

Thanks,
Krazyscotsman
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

If you want, you can simply export different levels of destruction from max, and different materials as well.
Drop a bomb, load up a soot material - drop another, and switch the mesh to another ...
:)

If you add some fog, fire and smoke - and make the differences between the meshes small enough - it will probably do the job without heavy programming.
But, you could use a shader or two -> meshdeform, decals, etc.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
krazyscotsman
Gnoblar
Posts: 17
Joined: Thu Aug 21, 2003 7:17 pm
Location: San Diego, CA
Contact:

Post by krazyscotsman »

Wouldn't this cause a lot meshes and swapping to be required? Meaning if you had a block of 5 buildings, you would need 32 meshes to accomodate the combinations of possibilities (building a= damaged building b = not damaged, etc.).

Thanks,
Krazyscotsman
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

This is kind of why I wanted the StaticGeometry stuff to support a freeze/thaw paradigm;

- Build your city from lots of independent nodes and entities
- Freeze them into static geometry
- When a bomb hits a building;
- Thaw the static geometry
- Delete the exploded building (or replace it with a "rubble" model)
- Re-freeze the geometry

As it is, you could do this manually;

- Build your city from lots of independent nodes and entities
- Freeze them into static geometry
- When a bomb hits a building;
- Delete the static geometry
- Recreate the city as before, but with rubble in place of the exploded building
- Freeze the city into static geometry

In that case you're probably going to get a performance hit when you explode a building and you do all the deleting, creating and re-freezing. So what would probably be better is to do it even more manually;

- Create your entire city as a single node
- Each building is a separate Entity (i.e. mesh) with positions baked into them
- All buildings are attached to the city node
- When a building gets hit;
- Detach that Entity from the city node
- Attach a rubble node with positions baked in as the position of the exploded building

Or, simply create your city manually in a single vertex buffer and update that buffer as buildings get exploded.

Hope some of that makes sense!
User avatar
semicolon
Halfling
Posts: 94
Joined: Sun Jul 04, 2004 4:42 pm
Location: Bangkok, Thailand
Contact:

Post by semicolon »

For Bombing FX, I did create 2 set of mesh. The first one is the base model for general use. The other one is the cracked chunk of the first one with the bone set on each chunk for simulted explosion. When the base model is bombed, I erased the first one and replace the cracked-chunk model at the same position. Adding some particle fx to fake the blow-out fire and some smoke.

That's just an idea to simulate the explosion fx as far as I could figure out. Any ideas are very welcome.

Semicolon
"Nature is the mother of learning"
krazyscotsman
Gnoblar
Posts: 17
Joined: Thu Aug 21, 2003 7:17 pm
Location: San Diego, CA
Contact:

Post by krazyscotsman »

semicolon wrote:For Bombing FX, I did create 2 set of mesh. The first one is the base model for general use. The other one is the cracked chunk of the first one with the bone set on each chunk for simulted explosion. When the base model is bombed, I erased the first one and replace the cracked-chunk model at the same position. Adding some particle fx to fake the blow-out fire and some smoke.

That's just an idea to simulate the explosion fx as far as I could figure out. Any ideas are very welcome.

Semicolon
Yeah, I was thinking this as well... myself, I'm concerned that the frame hit will be quite terrible flying over a city scape with moving surface vehicles and swapping buildings. Any idea how bad of a hit it would cause?

Thanks for the responses.
Krazyscotsman
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

monster wrote:This is kind of why I wanted the StaticGeometry stuff to support a freeze/thaw paradigm;

- Build your city from lots of independent nodes and entities
- Freeze them into static geometry
- When a bomb hits a building;
- Thaw the static geometry
- Delete the exploded building (or replace it with a "rubble" model)
- Re-freeze the geometry
Isn't it even easier than this? The static geometry keeps the old "before freezing" node structure around, so you can leave out the "thaw" step.
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

The static geometry keeps the old "before freezing" node structure around, so you can leave out the "thaw" step.
Does it? Well that's even better then! Sorry, I've never actually looked at it!
User avatar
CombatWombat
Greenskin
Posts: 138
Joined: Fri Feb 04, 2005 11:05 pm
Location: Melbourne, Aus

Post by CombatWombat »

I notice there's no StaticGeometry::removeEntity() to match the StaticGeometry::addEntity(). So it looks like one has to destroy the whole StaticGeometry object to remove entities.

Is there a particular technical reason why a removeEntity() should not be on the StaticGeometry?

(Please don't mistake this post for complaining - I just started using the StaticGeometry class today, and quite simply, it rocks! :))

Thanks,

Mark/CW
User avatar
RyanN
Halfling
Posts: 82
Joined: Thu Aug 19, 2004 6:41 am
Location: Victoria, Australia
Contact:

Post by RyanN »

couldn't a shader that affects the verts create a damage look to a specific mesh object? ie: a shader could manipulate the verts and make cratters in the terrain mesh at a dynamic point. or could always do a OFP mesh noise effect.
User avatar
litobyte
Halfling
Posts: 64
Joined: Mon Mar 28, 2005 7:03 pm
Location: Somewhere in Italy
Contact:

Post by litobyte »

Shader would be the best bet.

Look at the ooze.rfx or morph.rfx in RenderMonkey 1.6,
Those are procedural generic morphing, but I guess a physic impact on surface could be calculated somehow :)
arcane
Gnoblar
Posts: 6
Joined: Fri Mar 12, 2004 2:24 am
Location: Victoria, Australia
Contact:

Post by arcane »

Not wanting to continue this off topic, but PS3.0 shaders would provide an excellent basis for realtime deformations. You could store a very simple (64x64) texture for each building, and using a dependent texture read in the vertex shader, you could deform the mesh.

Of course, it wouldn't fall-back very well to old hardware.
User avatar
Mr.Bloodworth
Halfling
Posts: 91
Joined: Fri Mar 25, 2005 3:19 am

Post by Mr.Bloodworth »

Why wouldnt you just make a mesh with an animation of distruction?

as in, Frame 1 = Static. Frame 2-120 = Animation of "Chunks" flying all over. Frame 121 = New static Demolished building.

?
RoundSparrow
Greenskin
Posts: 145
Joined: Wed Jan 19, 2005 4:36 am
Location: Arica, Chile

Post by RoundSparrow »

I think that last idea nailed it... seems like the perfect way to do it!

// disclaimer: I have no real experience at doing ANY of this.
/// disclaimer: I do have a lot of experience recognizing good ideas :)
Looking to hire people working out of their home to do C++ Ogre programming. Blender artists also wanted. Looking for long-term relationships. PM on forums or contact via AIM or email Art@Arica3D.com
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

What kind of animation are you planning to use for the chunks flying all over the place? As I understand it the animation that Ogre supports is skeletal; the number of vertices and polygons in the mesh remains constant and a skeleton defines how that mesh moves when animated. Not sure you could get chunks of masonry flying around the place using that approach. But I could well be wrong.

Also, if all your buildings are animated meshes then performance might be an issue. I thought the original question was how to have a big city (i.e. baked static geometry) and explode bits of it?
User avatar
Mr.Bloodworth
Halfling
Posts: 91
Joined: Fri Mar 25, 2005 3:19 am

Post by Mr.Bloodworth »

monster wrote:What kind of animation are you planning to use for the chunks flying all over the place? As I understand it the animation that Ogre supports is skeletal; the number of vertices and polygons in the mesh remains constant and a skeleton defines how that mesh moves when animated. Not sure you could get chunks of masonry flying around the place using that approach. But I could well be wrong.

Also, if all your buildings are animated meshes then performance might be an issue. I thought the original question was how to have a big city (i.e. baked static geometry) and explode bits of it?
Well, nothing is stopping you from using one bone in each "Chunk".

On the modeling side, yeah it would take a bit of work. Each chunk would have to be made like a piece of a puzzle. I thought that ogre uses parts of a timeline. So you could use some for of code that starts the animation when a certain situation is met. This isn't really an uncommon practice, its currently used.

As far as the "Hit" it would fall under the same factors as every thing else. How many "Chunks" ETC...

I understood the original question. But I think from the start is was the wrong approach. For one, this method doesn't require loading and unloading of anything, the mesh and all animations are already loaded. Its just waiting for something to trigger it. and when the animation is complete, the last frames or whatever are the "Static" mesh of the burning building. lol.

From my understanding this is a flight sim of some sort, So the geo for the buildings would not be that complicated in the first place. most likely just a cube with the correct textures. With the correct view distance. 2 or 3 different buildings (in the method I described) would give you slightly more geo than originally, but keep the diversified building (rotate them, offset them, ETC to make it not so repeated). I don't think it would be that much of a hassle as the way some one else suggested.

Would just fall more on the artiest than the coder.
monster wrote:What kind of animation are you planning to use for the chunks flying all over the place? As I understand it the animation that Ogre supports is skeletal; the number of vertices and polygons in the mesh remains constant and a skeleton defines how that mesh moves when animated.
Think of it like a pre-assimbled puzzle, Now... explode the puzzle from the middle out.

When your looking at the puzzle, its one whole, when it "explodes" it is not.

The number of polys ETC... never change.

I have never seen a shader that will take one pice og geo, chop into pices...and fling it.

Deformation is not the same as "exploding".
krazyscotsman
Gnoblar
Posts: 17
Joined: Thu Aug 21, 2003 7:17 pm
Location: San Diego, CA
Contact:

Post by krazyscotsman »

Thanks for all the advice... We are wanting to take this sim beyond truly basic models such as a cube. One of the initial loctions will be Nellis AFB in Las Vegas. We want to accurately model the "strip" with the casinos of the era (early 80s) at least as well, but preferrably MUCH better, as Microsoft Flight Simulator 2004. Interesting thought about using bones as a means to destroy the building.

Krazyscotsman
P
OGRE Expert User
OGRE Expert User
Posts: 421
Joined: Fri Jan 07, 2005 9:49 pm
Location: UK
x 2
Contact:

Post by P »

I m maybe wrong cuz i don t know if it s possible, but you can maybe rebuild the chunk which has a destroyed building along multiples frames using a temp mesh and send it to static geo as soon as the processing of this mehs is finished.


And it s maybe not needed if the chunk is small enough ( in the other hand you ll multiply render operations by going to small chunks )
User avatar
Mr.Bloodworth
Halfling
Posts: 91
Joined: Fri Mar 25, 2005 3:19 am

Post by Mr.Bloodworth »

krazyscotsman wrote:Thanks for all the advice... We are wanting to take this sim beyond truly basic models such as a cube. One of the initial loctions will be Nellis AFB in Las Vegas. We want to accurately model the "strip" with the casinos of the era (early 80s) at least as well, but preferrably MUCH better, as Microsoft Flight Simulator 2004. Interesting thought about using bones as a means to destroy the building.

Krazyscotsman
There is allways the particle emiters that could throw chunks of rocks and bricks all over, dosnt change the "building" thoe lol.
Post Reply