Tuesday, January 29, 2013

Inventory and Survival

Notice the Left 4 Dead style glow to the items on the desk. This effect is not exactly a shader and was added with the use of the stencil buffer.
Inventory items, and player stats have not really been staples of the Half-life saga so they had to be added to the mod. One of the features we've added is an endurance meter which functions similarly to player hunger in RPG's. Over time, the player's endurance decreases. Energy-intensive actions such as running for prolonged periods of time, stress-heavy situations, and healing also decrease the endurance over time. The player can refill their endurance by consuming food items and beverages scattered randomly in the game.

Disclaimer: This map is not in the final game, it is a map from the Dawn of the Dead source mod used for testing purposes only
We also have the standard HealthPoints and Armor Items which regenerate the player hp and armor respectively. HP items are very rare in the game and can only be found (if at all) at infirmaries, hospitals or other logical locations. HP items include Health kits, health vials, health sprays, and bandages. Armor items are more common, as they are usually carried by enemy npc's and can be looted off of them. Armor decreases the amount of incoming damage, and also prevents the player from bleeding. If the player gets damaged while having little to no armor, he gets a chance of bleeding, which can only be stopped by taking health items, or by bleeding out. Some armor items include helmets and kevlar.

Disclaimer: This map is not in the final game, it is a map from the Dawn of the Dead source mod used for testing purposes only
We then also have utility items such as Flares, flashlights, glow-sticks, gas-masks, night-vision goggles, and silencers (this is not a complete list). All of these items have their own special behavior. Some help towards combat, others with sneaking, others with health/armor.

Lastly, but definitively not least, we have our weapons. Underhell's weapon system is something of a hybrid between modern shooters and older shooters in the weapon capacity sense. The player can carry as many weapons as he wants, but he can only carry one of each type. These are all the weapon types in the game:

  1. Melee
  2. Pistols (may or may not be one-handed)
  3. Sub-Machineguns
  4. Shotguns
  5. Rifles
  6. Explosive
These are all governed by a Free-aiming and Iron-sighting aiming styles which I will demonstrate on a later post.


Click Here for a video demonstration of some (and more!) of the features I've talked about here

BodyGroup Usage in Source


Dismemberment is one of the new features I've added to Underhell. The game take's advantage of Source's implementation of bodygroups. A bodygroup is an index of a specific mesh within a model. This index can be used to toggle the presence of a mesh, or altogether swap it out in real time.

For dismemberment, a hitbox and the corresponding model bodygroup for the damaged npc is either swapped out or toggled off to demonstrate harm. The corresponding model for that limb is then instantiated as its own object.



As seen, bodygroups provide an easy implementation for gore, but also nice way to randomize the appearance (and sometimes the behavior of ) the same npc type. For example, below we have a standard soldier npc with randomized bodygroups on spawn. On spawn the following attributes are decided: health, armor, weapon, skin, extra equipment, and ( for our zombie friends) any limbs that they might already be missing.


Even hitboxes are swapped out: