Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix and upgrade ai-fly-to-ship #5670

Merged
merged 2 commits into from
Oct 16, 2023

Conversation

Goober5000
Copy link
Contributor

The ai-fly-to-ship goal was added early in FSO's development but never worked right. Until recently it could crash; and even aside from the crash the AI would try to reach the target's exact position, causing repeated collisions. This folds ai-fly-to-ship into ai-stay-near-ship, since the behaviors are conceptually the same except for fly-to being satisfied as soon as the target is in range.

This also adds a new "escort" mode usable by both behaviors. The default Volition behavior is to swoop toward the target in a long, graceful arc; the new mode generates a goal point and flies directly to that point. These can be toggled via an optional sexp parameter.

There is also some minor cleanup and a new vec3d operator for convenience.

Needed for Scroll. Depends on #5667; in draft until that is merged.

@Goober5000 Goober5000 added enhancement A new feature or upgrade of an existing feature to add additional functionality. ai A feature or issue related to the AI algorithms Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle Requested by Active Mod A feature request that has been requested by a mod that is actively in development. labels Oct 6, 2023
Copy link
Member

@Baezon Baezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some original code which was dealing with Use_ap_cinematics and AutoPilotEngaged, I'll admit to not understanding it well myself but does it still work as intended wrt this goal?

code/ai/aigoals.cpp Outdated Show resolved Hide resolved
@Goober5000
Copy link
Contributor Author

There's some original code which was dealing with Use_ap_cinematics and AutoPilotEngaged, I'll admit to not understanding it well myself but does it still work as intended wrt this goal?

Well, it never worked in the first place -- the fly-to-ship behavior was never used by the autopilot code. So, the answer is no? 😀

@Goober5000 Goober5000 requested a review from Baezon October 15, 2023 19:05
@JohnAFernandez JohnAFernandez removed the Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle label Oct 16, 2023
The ai-fly-to-ship goal was added early in FSO's development but never worked right.  Until recently it could crash; and even aside from the crash the AI would try to reach the target's exact position, causing repeated collisions.  This folds ai-fly-to-ship into ai-stay-near-ship, since the behaviors are conceptually the same except for fly-to being satisfied as soon as the target is in range.

This also adds a new "escort" mode usable by both behaviors.  The default Volition behavior is to swoop toward the target in a long, graceful arc; the new mode generates a goal point and flies directly to that point.  These can be toggled via an optional sexp parameter.

There is also some minor cleanup and a new vec3d operator for convenience.

Needed for Scroll; depends on scp-fs2open#5667.
@Goober5000 Goober5000 marked this pull request as ready for review October 16, 2023 07:25
@Goober5000 Goober5000 merged commit 16892c3 into scp-fs2open:master Oct 16, 2023
@Goober5000 Goober5000 deleted the fly_to_ship_upgrade branch October 16, 2023 08:26
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 enhancement A new feature or upgrade of an existing feature to add additional functionality. 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