Armor Effects Running

Hope everyone had a good weekend!

It took most of the day, but I've got armor up and running in my test build:

IMAGE(http://www.bluebottlegames.com/img/screenshots/screenshot-2014-01-27.png) Didn't a guy do this once with a bear?

Basically, I walked up to a dogman unarmed, wearing body armor and a helmet, and let him have at me. As you can barely read in the message log, his melee surge was a mixed success. My leg was grazed, but two of his other swipes glanced off my armor. I'd call that a qualified success!

The math under the hood is a bit complex, but I think it makes sense. I spent the better part of my morning reading documents on bulletproof armor, watching ballistics videos, and trying to come up with some abstraction that works.

I was going to type out an explanation, but that took too long :)

So here's the code:

public function Damage(fBluntAmount:Number, fCutAmount:Number, fPenetration:Number, strSource:String, strWith:String, bUnsocket:Boolean = true):void { //if attack's penetration is within armor tolerance, transfer cut dmg to blunt var fAbsorbed:Number = 0; if (m_fCutArmor > 0) fAbsorbed = fPenetration / m_fCutArmor; if (fAbsorbed <= 1) { fBluntAmount += fAbsorbed * fCutAmount; fCutAmount = 0; } else //transfer as much blunt as we can, and remainder is still cut damage { fBluntAmount += (1 / fAbsorbed) * fCutAmount; fCutAmount -= (1 - 1 / fAbsorbed) * fCutAmount; } //blunt armor just subtracts from blunt damage (i.e. blocks all damage below certain amount) fBluntAmount -= m_fBluntArmor; //now that armor has adjusted damage, apply owner's damage multipliers to what's left (e.g. fragile trait) fCutAmount *= m_sprOwner.DefDmgMult fBluntAmount *= m_sprOwner.DefDmgMult //apply damage m_fCutSeverity += fCutAmount; m_fBluntSeverity += fBluntAmount; ...some messaging code, limit checking, and other administrivia follows

Basically, ballistic armor does two things:

  • It converts cutting damage into blunt damage.
  • It reduces blunt damage.

And it does them in that order. I haven't been able to test it extensively yet, but I roughly modeled the body armor after Type III ballistic armor (designed to stop handgun and some rifle bullets from penetrating), and the helmet after Type IV (designed to stop even AP rifle bullets from penetrating). Essentially, it'll prevent or reduce penetration by bullets, though you'll still get bruised. And in the case of powerful weapons, possibly experience fatal blunt trauma.

In theory, most weapons should just glance off of the armor or do minor bruising through the armor. This includes things like sticks, stones, bottles, knives, and punches. Ideally, it'll be a useful safety net that drastically reduces the chance of fatal wounds, but doesn't prevent them all the time (like in real life).

More testing tomorrow!

Comments

Commander Cupcake's picture
Commander Cupcake

Looks like armor will be one of the Uber items, along with the fully upgraded eyes.
Hard to get, but worth it sooooo much.

Melvarius's picture
Melvarius

I just love your dedication to authenticity! Keep up the great work, Dan!

~The Pirate

dcfedor's picture
dcfedor

@Cmdr Cupcake, I think you're right. I totally expect everyone to hunt DMC guards for their first few games in the next build.

@Melvarius, thanks! Though, I think perfectionism is going to be my undoing someday :)

Dan Fedor - Founder, Blue Bottle Games