Per-slot armor rating

Feedback on past, current, and future development.
Post Reply
User avatar
akortunov
Posts: 169
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation
Github profile: https://github.com/akortunov

Per-slot armor rating

Post by akortunov » 13 Jan 2018, 13:29

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: 606
Joined: 26 Nov 2015, 03:25

Re: Per-slot armor rating

Post by AnyOldName3 » 13 Jan 2018, 13:55

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.
AnyOldName3, Master of Shadows

User avatar
akortunov
Posts: 169
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation
Github profile: https://github.com/akortunov

Re: Per-slot armor rating

Post by akortunov » 13 Jan 2018, 14:21

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: 1315
Joined: 04 Sep 2011, 08:33

Re: Per-slot armor rating

Post by Chris » 13 Jan 2018, 15:51

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).

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests