Skip to content

Add AI goals for destroying turrets of a certain type - #7700

Open
Kestrellius wants to merge 4 commits into
scp-fs2open:masterfrom
Kestrellius:turret-orders
Open

Add AI goals for destroying turrets of a certain type#7700
Kestrellius wants to merge 4 commits into
scp-fs2open:masterfrom
Kestrellius:turret-orders

Conversation

@Kestrellius

Copy link
Copy Markdown
Contributor

Introduces two new AI goals, AI_GOAL_DESTROY_TURRET_TYPE and AI_GOAL_DESTROY_TURRET_TYPE_ON_SHIP, which cause the AI to target turrets carrying a specific class of weapon, either on a targeted ship or on any enemy ship in the mission. From a player-experience perspective, this should help to resolve a certain type of irritating situation that occurs when destroying multiple heavy weapons on an enemy warship is necessary, but wingmen can't effectively help without impractical amounts of micromanagement.

At present, these orders are accessible only through SEXPs and scripting, but future plans involve integrating them into the player commands system.

@wookieejedi wookieejedi 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 labels Aug 12, 2026

@Goober5000 Goober5000 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Partial review for now; still looking through this

Comment thread code/ai/aigoals.cpp Outdated
Comment thread code/ai/aigoals.cpp Outdated
Comment thread code/ai/aigoals.cpp Outdated
Comment thread code/ai/aigoals.cpp Outdated

// Goober5000 - before doing anything else, check if this is a disarm goal for an arrived ship...
if ((status == SHIP_STATUS_ARRIVED) && (aigp->ai_mode == AI_GOAL_DISARM_SHIP || aigp->ai_mode == AI_GOAL_DISARM_SHIP_TACTICAL))
if ((status == SHIP_STATUS_ARRIVED) && (aigp->ai_mode == AI_GOAL_DISARM_SHIP || aigp->ai_mode == AI_GOAL_DISARM_SHIP_TACTICAL || aigp->ai_mode == AI_GOAL_DESTROY_TURRET_TYPE_ON_SHIP))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think AI_GOAL_DESTROY_TURRET_TYPE_ON_SHIP should be lumped in with standard disarm here. I think it needs its own separate handling, just like the other places.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm. What other behavior are you envisioning? I suppose I could check whether any turret aboard the ship has the specified weapon.

Comment thread code/ai/aigoals.cpp Outdated
Comment thread code/parse/sexp.cpp
Comment thread code/ship/ship.h Outdated
Comment thread code/parse/sexp.cpp Outdated
Comment thread code/parse/sexp.cpp Outdated
Comment thread code/parse/sexp.cpp Outdated
@Kestrellius

Copy link
Copy Markdown
Contributor Author

Good catches, thank you!

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants