This tutorial will explain how Bodygroups, Gibs, Ragdolls and decals work in Underhell, and which features has been added.
Posted by Mxthe on Jul 23rd, 2012
Basic Mapping/Technical.
Very early on in the development, I knew I wanted a dismemberment system, which is why for Prologue I relied on SMOD and made my own "Gib" models, the system was experimental and buggy, but it was okay.
But now that Carlos is on the team, I was able to design a more thorough system for said dismemberment, as well as a few other add-on along the way.
Bodygroups are a part of a model that can be toggled on and off at will via ingame code, or a hammer input. There can be multiple and different "Bodies" within that group.
A perfect example is a Helmet Bodygroup, which can have multiple sets of helmets, and thanks to this you can change the helmet on an NPC with just changing the bodygroup "Helmet".
Unfortunately the Hammer input that came along with the Source Engine was very vague, see there are 2 ways to Identify bodygroups, either via the Group name and the Value of the bodygroup, or via a binary calculation code that will "add" each part of the bodygroup to each other and render it to a number, like the FLAGS system in hammer.
Unfortunately when you have over 5 bodygroups each with 2 or 3 models per group, this value can go over a thousand, since there has to be a number for each combination of any Group/Value.
This is why a String Parser was added to a Hammer Keyvalue we implemented, to facilitate BodyGroup selection via Hammer :
Say you have a Bodygroup named "Arms", a Bodygroup named "Legs" and a Bodygroup named "Helmet".
In Hammer, you want him to have Helmet number 2, Arms number 1 and Legs number 4.
The value to enter in hammer would be the following :
The string parser "separates" strings and numbers to form the correct values, and reads them accordingly.
This is a VERY powerful and risky system, if you enter a wrong bodygroup, the game WILL crash.
Just double check your bodygroup names on the models you are using, and it should be fine.
Here is a quick list of Underhell's Soldiers Bodygroups :
COMBINE_SOLDIER.MDL :
COMBINE_SOLDIER_PRISONGUARD.MDL :
More BodyGroup lists will be added soon...
The gibs are engine generated ragdolls, that do not enter the same category as usual ragdolls.
When a body part is shot off, the Bodygroup of the original model is changed to "remove" that part on it, and a "gib" is spawned at the correct body attachment to make it look like it was "detached" from there.
The gibs models were carefully "severed" from their original models at the exact same location where the original model's bodygroup is cut.
The following console commands allow to set the desired effects :
The Ragdolls in Underhell aren't just "neat visual effects" they are real entities that can be interacted with.
If specified, NPCs will fire an OutPut when a ragdoll is spotted, triggering any desired effect.
Players can therefore pick up any "limb" on a ragdoll like a physic object and drag them around to hide the ragdolls, therefore avoiding detection in some situations where "discretion" is important.
Dragging ragdolls will leave a "Blood_Drop" decal specific to this behavior, it looks lighter and different than other blood decals.
Ragdolls can also be "dismembered" completely (head, arms and legs).
The following console commands allow to set the desired effects :
Hammer placed prop_ragdolls are excluded from any of those rules, they will not be turned to clientside.
The Keyvalue to add to an NPC to make them find bodies is the following:
An input can also be called to toggle this function On and Off
When the SpotBodies is on, the NPC will fire the following outputs when they spot a body:
OnSpotSoldierBody : Fires when a Soldier body was found
OnSpotI******dBody : Fired when a SPOILERS body was found
OnSpotDefaultBody : Fired when any other type of npc ragdoll was found
In this output link "!caller" is the body itself, and "!activator" is the NPC who spotted the body.
Here's a way it can be used :
This output will make the person who found the body (!activator) Walk to the dead body (!caller)
Some enemies will drop random objects upon death.
This "loot" is not only randomized but dynamic, an enemy with a helmet will drop it if you shoot his head, an enemy with a riot shield will drop it, ect...
There are functional items, such as the helmets that give the player "Armor" points when picked up, but there are also "Cosmetic" objects, like gibs that detach when shot.
GasMasks or respirators is a good example.
The following console command allows to limit these "dropped objects" for optimization purposes.
Underhell's Decal system has received a bit of a overhaul as well.
Here are the new Decals :
New decals isn't the only change that has been made to the decal system.
The "Blood" decal's shader has been modified to receive better lighting.The shader type has been split into 2 types :
This gives a unique look to the blood, that reacts to the flashlight's light, instead of just "disappearing" when lit, which is a common Source Engine glitch.
Thank You so much for this update!
Also i have one question about the gore and entites effects. Will we be able to further dismember a already seperate enity from the body like blowing a arm in half or doing so on a already attached arm? Thanks Again really looking forward to this great mod!
Nah, that would be kinda overdoing it.
It's very fun and "tactical dismemberment" the way it is already.
There are entities that can be dismembered alive, so yeah dismemberment isn't only cosmetic.
A "SPOILERS" body, eh?
Infected is my guess. game gave hints of some sort of zombie so I am guessing that's it.
Thanks For replying!
I like these technical posts. It really shows us all the things you've been doing, how hard some of it can be, and how it's done. Maybe things like this will be used in other mods, and I guess this would be the lesson ;)
The bullet holes in those dead guys reminds me of KingPin Life of Crime with a mix of Soldier Of Fortune on the side.
This is some wickedly awesome ****. Good luck on the mod. :)
Would I be right in saying that NPCs will react to blood_drop decals in some way but not to normal blood decals? Seems like you've got some very cool ideas here.
is it true you created smod?? such an amazing mod, though if its rude to ask or accourse it is, but many wonder why not release source code to have mods just as great as smod or even better? though im not suggesting.Im simply asking.
I did not create smod.
Smod was created by a Japanese Programmer called "The Author".
Smod.wikidot.com