Commit d42789d
authored
Add new option for 'better combat collision avoidance' (#7036)
The `$better combat collision avoidance for fightercraft:` flag is incredibly useful in preventing AI from hitting large ships while attacking, and the ability to tune the collision avoidance aggression factor further helps mods tune behavior based on their ship speeds (tuning that value is via `+combat collision avoidance aggression for fightercraft:` ). Nevertheless, the improve collision avoidance still is not performed for that actual fightercraft's actual target, so there can be situations where a fast fighter attacks a large ship with high speed, and then when that fighter break off from the attack they turn directly into the large ship's hull. Allowing the target to be incorporated into the `better_collision_avoidance_triggered` check prevents this from happening. To allow the target to be a part of the checks we just simply need to not pass an 'ignor_ship` argument to `maybe_avoid_big_ship`.
This PR adds that ability via flag. This new flag is tested and works as expected. For example, without the flag a squadron of TIEs in FotG would literally ram themselves to death attacking some of our larger capital ships because they would break off attack too late, but with this flag they no longer accidentally collide at all. In discussion with Asteroth it was decided to make this enhanced behavior behind a flag, too.
This PR also fixes a small oversight from the original #2810 where `next_check_time` was never actually used within the `else` block of `maybe_avoid_big_ship`.1 parent a32c318 commit d42789d
3 files changed
+12
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
| 591 | + | |
| 592 | + | |
591 | 593 | | |
592 | 594 | | |
593 | 595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7711 | 7711 | | |
7712 | 7712 | | |
7713 | 7713 | | |
7714 | | - | |
| 7714 | + | |
7715 | 7715 | | |
7716 | 7716 | | |
7717 | 7717 | | |
| |||
7737 | 7737 | | |
7738 | 7738 | | |
7739 | 7739 | | |
7740 | | - | |
| 7740 | + | |
7741 | 7741 | | |
7742 | 7742 | | |
7743 | 7743 | | |
| |||
7748 | 7748 | | |
7749 | 7749 | | |
7750 | 7750 | | |
7751 | | - | |
| 7751 | + | |
7752 | 7752 | | |
7753 | 7753 | | |
7754 | 7754 | | |
| |||
8978 | 8978 | | |
8979 | 8979 | | |
8980 | 8980 | | |
8981 | | - | |
| 8981 | + | |
| 8982 | + | |
8982 | 8983 | | |
8983 | 8984 | | |
8984 | 8985 | | |
| |||
10896 | 10897 | | |
10897 | 10898 | | |
10898 | 10899 | | |
10899 | | - | |
| 10900 | + | |
| 10901 | + | |
10900 | 10902 | | |
10901 | 10903 | | |
10902 | 10904 | | |
| |||
14190 | 14192 | | |
14191 | 14193 | | |
14192 | 14194 | | |
14193 | | - | |
| 14195 | + | |
| 14196 | + | |
14194 | 14197 | | |
14195 | 14198 | | |
14196 | 14199 | | |
| |||
0 commit comments