Modifying glass "chunks" that are broken out when damaged

  • Thread starter Thread starter chojinlocke
  • Start date Start date
C

chojinlocke

Guest
Hi,

I searched the forums pretty well, but I have yet to find any info on changing the size or shape of the chunks that are broken out when a breakable window is hit and damaged. I am guessing that the func_breakable_surf (or maybe the glass shader) takes care of all of that.

Is it even possible to drill into this section and change the pieces that get knocked out (not the gibs that fall out, or particles that fly out and land) when a window is damaged? It seems like it would be pretty expensive to store a bunch of tiny objects that all have collision, just to be knocked out. I've been looking for textures or models that might be controlling this, and I've turned on and off every debug command I can think of that would let me look at what the "break out piece" might look like, but I can't seem to find it. It looks like there is a small object or "alpha only" decal that gets tiled and rotated to fill up the size of the bullet impact or crowbar hit (perhaps like an escher drawing) but I just can't find it to change or mod it.

I know it is not a very important mod thing, but it has become a quest/obsession now, since I started digging around. I'm not sure I can make it any better, but I wanted to monkey with it. Any info you have would be cool.
 
You have to create new gibs. There is no dynamic gib support in the Source Engine. Also you can change gib models (func_breakable, gibmodel key). Alternatively, you can use env_shooter.

The code is there for Half-Life: Source, but it works for Half-Life 2 too. Only known problem is gibs fade away after short amount of time.

For models, gib code is stored inside of model files (*.mdl). You have to create/modify *.qc files [1] in order to change gibs for models.

See VDC (developer.valvesoftware.com), fore more information.

Note: Don't even try to get an example code from Valve's models. MDL Decompiler does not extract gib code.

developer.valvesoftware.com/wiki/Breakable_Gibs [1]
 
Just to make sure I am on the same page. When I shoot the breakable window, and get anything from a tiny x to a big glass chunk, It's taking out a bunch of gibs?

Hmmm... none of the glass pieces that I looked at in the mdl viewer seemed to match the holes in the glass that are generated when you hit it. I was under the impression that it was a small pieces that got tiled all around (as seen in the screenshot [took a while to get that one], it looks like 4 of them form an x). I didn't see a gib that looked like this, but maybe I should dig deeper. I've seen the ones that drop and fade, and the bigger chunks that drop out and disappear when you shoot out enough of the glass, but never the oddly shaped "knockout" pieces. It was after I was messing around shout out small pieces that I started wondering how this technique was accomplished and how to modify the pieces.

I was hoping to see all the pieces when I turned on the wireframe, but it still treats a broken window as a brush, even after pieces are knocked out.

Thanks!
 

Attachments

  • small_glass_piece.jpg
    small_glass_piece.jpg
    67 KB · Views: 175
Oh you're talking about func_breakable_surf. Those gibs are just sprites (you can find the textures in "effects/fleck_glassX.vtf" folder).

Only thing you can do is: replace them with something else or code a new material.
 
Ok, I was thinking that it might be. Any clue how to get to those sprites? I am guessing they just tile them around depending on hit location and spread of the bullet/how much damage is dealt to the glass.

I dig the system they have going, since it seems to react to how much damage the brush has taken and falls apart in a a fairly realistic way most of the time. I just thought it would be interesting to get to mess with the breaking sprite (I thought it was some form of decal or sprite since those pieces don't display and having a ton of them would be super expensive if they were polys).

Cool, I'm going to go searching through the gcfs now.
 
aha, I think I found all pieces that I am looking for in materials\models\BrokenGlass\

Now I think I see how the vst files fit together. Neat trick.

Thanks for the info, test! It started me thinking the right way about the pieces.
 
You're welcome. :)

By the way, models wouldn't lag that much. If you have a chance to code them, add them.
 
I'm just an art monkey.. :)

If it was changed to be a ton of tileable models, you would have to swap out a window with a ton of tileable pieces. When I thought it was models, I thought that the smallest piece (that made an x in my screenshot) fit together like an escher puzzle and that the developers had figured out a way to make it cheap to put those together. Also, I though the artists must have worked quite a while to get a piece that tiles so well and is seamless when put together (no mean feat!). The beauty of decals is that you can put down any size and or permutation to fill in (knock out) the size of the blast. So it is a simpler, cheaper, way. Especially if you tons of huge breakable windows that would have to filled with 100s of (at least) 2x2 inch meshes. Once again, I tried to make things overly complex when I thought about it. One of my fatal flaws.

The poly trick would be cool to try to get working, especially if they could tile seamlessly and fall out with physics. Crowbarring a windshield would look really awesome in the game.
 
Back
Top