Author Topic: What determines exactly which armor side is hit by a projectile?  (Read 3204 times)

Offline Buscher

  • Colonel
  • ****
  • Posts: 167
    • View Profile
What determines exactly which armor side is hit by a projectile?
« on: February 15, 2017, 01:49:00 am »
When playing the X-Piratez mod I made the experience that not necessarily the expected side is hit by a projectile. When facing the enemy and being shot at by it there were multiple instances that one of the side armors was hit instead of the front armor. More specifically it was observable that the side armor was damaged after health reduction.

I have expected that the armor side was determined by the relative position of the shooter. So if fired from the front it hits the front, same for left, right and back. This doesn't seem to be true.

Code: [Select]
\ F /
 \ /
L o R
 / \
/ B  \
F = Front; L = Left, R = Right; Back = Back; Assuming 90° angles for each side.

Question 1: Does position of the shooter matter at all or only the hit pixel location of an unit?
Question 1.1: Is the facing side damaged by explosives which are not nearby enough to hit the under armor?

Of course there is this paper doll (seen in the MediKit screen) consisting of head, chest, left arm, right arm, left leg, right leg. Also a projectile can hit any pixel of an unit which is probably linked to these six zones.

Question 2: Does hitting one of the six zones determine which armor direction is used? For example if the left arm or left leg is hit, is the damage reduced by the left armor despite the shooter being in front?

Question 3: If neither assumptions are correct, what exactly determines which armor side is considered?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: What determines exactly which armor side is hit by a projectile?
« Reply #1 on: February 15, 2017, 03:06:14 am »
it's not 4 regions, it's 8, 45 degree angles instead of 90.

as depicted below, the red zones indicate front/back, the blue zones indicate left and right, and the purple zones are spooky nebulous zones that include both the front/back and sides, and will be resolved as either one by chance.

1: the hit VOXEL. the pixels you see on the screen are merely graphical representations, and are irrelevant in terms of resolving hits. the second picture i have included is how the game sees things internally. the purple cylinder is a floater, the yellow cylinder is a tank, and the green cylinders are street lights.

1.1: see here

2: the location of a wound is determined by which voxel is hit, again there is a random element to this determination, but higher shots will generally hit the head and lower ones will generally hit the legs, and shots from the left shouldn't damage limbs on the right.

3: see anwer to question 1.
« Last Edit: February 15, 2017, 05:48:59 am by Warboy1982 »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8598
    • View Profile
Re: What determines exactly which armor side is hit by a projectile?
« Reply #2 on: February 15, 2017, 11:32:44 am »
Everything Warboy said is true.

I'll just add that in OXCE 3.6 and 3.6a (PirateZ 0.99f), there was a bug, which shuffled the side "randomly" after it was correctly calculated: https://openxcom.org/forum/index.php/topic,2915.msg78514.html#msg78514

This has been fixed in OXCE 3.6b (PirateZ 0.99f.1).