UFO: Alien Invasion Issue Tracker
UFO: Alien Invasion
Go to the previous open issue
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
icon_project.png UFO: Alien Invasion / Closed Submit Patch #4683 Reaction Fire fixes
Go to the next issue (open or closed)
Go to the next open issue
This issue has been closed with status "Closed" and resolution "Not determined".
Issue basics
  • Type of issue
    Submit Patch
  • Category
    General
  • Targetted for
    Not determined
  • Status
    Closed
  • Priority
    3. Normal
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (0)
There are no items
People involved
Times and dates
  • Posted at
  • Last updated
Issue details
Attachments (0)
There is nothing attached to this issue
Duplicate issues (0)
This issue does not have any duplicates
Description
[http://sourceforge.net/p/ufoai/patches/556 Item 556] imported from sourceforge.net tracker on 2013-01-28 20:43:43

changes:
- no recalculation of reaction TU, when enemy attacks faster
- shooting will trigger reaction targeting before the actual shoot, not after, allowing soldiers to react, who didn't see the enemy until he shoots
- draw duel is resolved with the right values, allowing faster reaction shooters to fire before enemy attacks and don't mess things up
- after reaction shot took place, reaction TU is reset according to full TU cost of the reaction, giving the enemy new time to act

see also http://ufoai.ninex.info/forum/index.php?topic=5000.msg40943#msg40943
===== Comments Ported from Sourceforge =====

====== nobody (2010-07-10 14:11:23) ======


====== tlh2000 (2010-08-11 06:39:16) ======

from the forum topic:

After examining the source of 2.3 some time, I've come to conclusions, that:
RF can only be used by right hand.
Mind or speed skills are meaningless for RF.
There are no random parts, RF is fully predictable (and thus avoidable by AI).
It's buggy. Badly.

RF will never happen, if:
1. RF is set to left hand
2. chance to hit is smaller than 30%
3. friendly fire possibility greater than 5% (depending on mental state higher)

RF will be triggered immediately, if:
1. target aimed at, while new enemy is moving or attacking in LOS (line of sight) OR enemy turn is ending
2. target is attacking with a fire mode, which uses more or equal TU than RF fire mode (buggy, won't work most time)

The intended logic for RF seems to be, that every soldier is aiming at a single target, while it is moving in his LOS. And when the target's TU drop below a certain number, he fires on every further move of the target. So every soldier has a reaction target and a reaction TU value. When reaction target is set (enters line of sight), reaction TU is set to [actual targets TU] - [rf fire mode TU] / 4.
If an alien enters LOS with 20 TU and the Soldier with assault rifle is in 3 shot rf mode (12 TU), reaction TU is 17. If the alien moves 2 squares, the soldier will open fire. The machine gunner on full auto will have a reaction TU of 14 on the alien.
If the alien moves out of sight and enters sight again with less TU, soldiers who spotted it first will open fire immediately. Also, if another enemy moves, execution of the reaction shot is performed on the spot (and hopefully also on the former, now deceased, target).

Now comes the buggy part. If the alien attacks with his crappy plasma pistol, the TU of the attack (for comparison with RF) is calculated by the same function, which calculates the TU of the RF. That's just plain wrong, because it checks the aliens rf mode instead of the actual attack. And this function is limited to the right hand. And there is a wrong parameter, the alien attack is checked with the reacting soldiers right hand weapon. So there are at least 3 reasons, why this results in an error nearly every time. The function gives back the number -1, but the error is not checked. Instead the remaining rf calculations will be based on an alien attacking with an -1 TU action. So the reacting soldier will lose the duel every time. Best part, now the reaction TU are recalculated on the formula [actual targets TU] - ([rf fire mode TU] - [targets fire mode TU]. With the miscalculated target attack value this results in 15 - (-1 - 12) = 2 TU. This means, the alien can move freely and even attacking multiple times, without triggering RF, as long the AI takes it out of line of sight in the end.

So, RF is flawed. Use any weapon, and RF won't be triggered. I'm not sure, if this TU recalculation on attack should happen at all.
====== tlh2000 (2010-08-11 06:39:54) ======

assigned to btaxis to get his opinion about this.
====== btaxis (2010-08-11 07:00:27) ======

I don't see anything I don't like, as far as I'm concerned this can be applied.
====== tlh2000 (2010-08-11 13:17:43) ======

applied to trunk https://sourceforge.net/apps/trac/ufoai/changeset/31375
Todos (0 / 0)
Issue created
footer_logo.png The Bug Genie 4.3.1 | Support | Feedback spinning_16.gif