Skip to content

Fix AI Bug with Strafing#7619

Open
wookieejedi wants to merge 1 commit into
scp-fs2open:masterfrom
wookieejedi:fix-attackany-strafing
Open

Fix AI Bug with Strafing#7619
wookieejedi wants to merge 1 commit into
scp-fs2open:masterfrom
wookieejedi:fix-attackany-strafing

Conversation

@wookieejedi

Copy link
Copy Markdown
Member

Bug:
When a fighter or bomber enters strafe mode attacking a large ship, that large ship may die or depart, which results in the fighter/bomber AI slowing down to 0 and then not moving until another order is issued. This is most apparent in mods that force strafe to be used more via the ai profile flags (such as FotG).

Cause:
This bug is caused by the following. A fighter/bomber whose strafe target is destroyed drops to AIM_NONE (see ai_execute_behavior) with its active_goal still set, so a standing order like attack-any is never re-processed and the ship slows to zero and remains still until another order is issued.

Fix:
If we're chasing or strafing against large ship but have lost our target, we need to clear the active goal to ensure ai_process_mission_orders() re-evaluates our orders next frame. Of course gate this behind a flag.

Tested and update fixes the issue. We are very much hoping this can be a part of a point-release since it is substantially needed for FotG missions and we want to release in the next month or so. Happy to answer any questions or discuss, too!

Bug:
When a fighter or bomber enters strafe mode attacking a large ship, that large ship may die or depart, which results in the fighter/bomber AI slowing down to 0 and then not moving until another order is issued. This is most apparent in mods that force strafe to be used more via the ai profile flags (such as FotG).

Cause:
This bug is caused by the following. A fighter/bomber whose strafe target is destroyed drops to AIM_NONE (see ai_execute_behavior) with its active_goal still set, so a standing order like attack-any is never re-processed and the ship slows to zero and remains still until another order is issued.

Fix:
If we're chasing or strafing against large ship but have lost our target, we need to clear the active goal to ensure ai_process_mission_orders() re-evaluates our orders next frame. Of course gate this behind a flag.

Tested and update fixes the issue. We are very much hoping this can be a part of a point-release since it is substantially needed for FotG missions and we want to release in the next month or so. Happy to answer any questions or discuss, too!
@wookieejedi wookieejedi added this to the 26.0.1 milestone Jul 18, 2026
@wookieejedi wookieejedi added fix A fix for bugs, not-a-bugs, and/or regressions. ai A feature or issue related to the AI algorithms Point Release Candidate An already merged bugfix that may be merged into a previous stable version Requested by Active Mod A feature request that has been requested by a mod that is actively in development. labels Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai A feature or issue related to the AI algorithms fix A fix for bugs, not-a-bugs, and/or regressions. Point Release Candidate An already merged bugfix that may be merged into a previous stable version Requested by Active Mod A feature request that has been requested by a mod that is actively in development.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants