Per-slot armor rating

Feedback on past, current, and future development.
Post Reply
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Per-slot armor rating

Post by akortunov »

Inspired by Daggerfall and Wizardry 8: https://github.com/akortunov/openmw/tree/armorclass
Screenshot_20180113_155604.png
Vanilla Morrowind (OpenMW too) calculates the mean armor rating and uses it to reduce damage for any slot, which takes the damage.
With this feature OpenMW takes actual armor rating for slot, which takes the damage. For example, cuirass will not protect from arrow in the head. Shield magic effect supposed to increase armor rating for all bodyparts. If there is no armor in slot, the Unarmored skill is used.

Notes:
1. I have no GMSTs to localize strings
2. This feature is not aimed to be merged upstream (without discussion, at least).

Feel free to provide any feedback.
User avatar
AnyOldName3
Posts: 2666
Joined: 26 Nov 2015, 03:25

Re: Per-slot armor rating

Post by AnyOldName3 »

This was something I wanted to have eventually in my somewhat far-fetched vision for a future VR version of OpenMW where it mattered where you hit someone. In my envisaged version it would also require knowing which parts of a mesh are actually armour and which are exposed skin so you could get a sneaky jab into a soft bit, but I don't think that's necessary until way after VR OpenMW is a thing.

In the short term, though, I'm not even sure that our hit detection system knows which part of an actor has been hit and that's obviously a prerequisite for this feature.
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: Per-slot armor rating

Post by akortunov »

AnyOldName3 wrote: 13 Jan 2018, 13:55 I'm not even sure that our hit detection system knows which part of an actor has been hit.
It does not know. For now, we use collision box for hit detections. When NPC takes hit, we choose which slot to hit randomly (in Npc::onHit()).
I suppose mentioned games behave in the similar way.

From the other hand, we generate blood particles in the hit point somehow.

UPDATE: the Npc::onHit() has the hitPosition parameter. Can we determine which armor part to select, using this parameter?
As rough approximation instead of random generator:
1. Take the distance from hit position to some bodyparts position (e.g. chest, groin, feet, etc.)
2. Select minimum value
3. Select the related slot (e.g. if the nearest bodypart is Chest, select the cuirass slot)

Of course, this approach is not good for some mods with extravagant armor (e.g. boots covering Head bodypart).
Also AI is not supposed to take advantage from this feature yet.
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: Per-slot armor rating

Post by Chris »

akortunov wrote: 13 Jan 2018, 14:21 UPDATE: the Npc::onHit() has the hitPosition parameter. Can we determine which armor part to select, using this parameter?
Probably not. That's the position where the hit box intersects the NPC's capsule collision shape, and there's no easy way to map that to the limb. You'd need to give a basic collision shape to each of the body parts and test collisions against those to see what's actually hit (some kind of 'accurate hit detection" mode).
Kageseigi
Posts: 7
Joined: 06 Jun 2017, 15:32

Re: Per-slot armor rating

Post by Kageseigi »

Wow, locational damage is one of my big wishes for Morrowind. While it may not help the player yet, is there a way to favor the odds of hitting a specific body part based on the attacker's attributes (such as Luck or Intelligence... or maybe Agility) to simulate their ability to notice if and where the opponent is wearing no/light armor?

Or is there an ability to replace a character's hitbox with multiple invisible objects/hitboxes, then apply the damage taken from those objects to the character's associated location?
User avatar
Thunderforge
Posts: 503
Joined: 06 Jun 2017, 05:57

Re: Per-slot armor rating

Post by Thunderforge »

Is locational damage a thing in Oblivion or Skyrim? Just wondering if we can use those as inspiration for how that might work in a post-1.0 feature or if we’d be making it up on our own.
User avatar
Capostrophic
Posts: 794
Joined: 22 Feb 2016, 20:32

Re: Per-slot armor rating

Post by Capostrophic »

It isn't.
User avatar
AnyOldName3
Posts: 2666
Joined: 26 Nov 2015, 03:25

Re: Per-slot armor rating

Post by AnyOldName3 »

The later Elder Scrolls games don't have locational damage, and indeed don't even have enough body parts for it to be added nicely as a mod. The Fallout games on the same engine do, though. It's a critical part of VATS and is in the original games, so Bethesda would not have been clever if they removed it.
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: Per-slot armor rating

Post by akortunov »

Chris wrote: 13 Jan 2018, 15:51That's the position where the hit box intersects the NPC's capsule collision shape.
That would be enough for me. The problem is that is true only for ranged combat. For melee combat that position is somewhere INSIDE target capsule. That is a quite weird.

Anyway, I uploaded the prototype for limb detection.
Post Reply