Option to clean blue stages of red units #14

Open
opened 2026-08-11 16:20:21 +00:00 by Luke · 4 comments
Member

Currently when a stage is completed and turned blue, any remaining redfor units are left behind. As a mission progresses, this can lead to more and more units being active at one time, degrading performance. Functionality to clear any red units in the stage trigger would be a nice addition, especially if it could be filtered to clear all, or to leave Anti-Air, remaining mission units, etc.

Currently when a stage is completed and turned blue, any remaining redfor units are left behind. As a mission progresses, this can lead to more and more units being active at one time, degrading performance. Functionality to clear any red units in the stage trigger would be a nice addition, especially if it could be filtered to clear all, or to leave Anti-Air, remaining mission units, etc.
dutchie031 added the Kind/Feature
Priority
High
2
Reviewed
Confirmed
1
labels 2026-08-12 19:50:38 +00:00
dutchie031 changed title from [Request] Option to clean blue stages of red units to Option to clean blue stages of red units 2026-08-12 19:50:54 +00:00
Member

From my perspective I would like to have the following three options:

  • Clear all REDFOR units inside BLUFOR stage upon stage completion.
  • Clear all REDFOR mission units inside BLUFOR stage upon stage completion.
  • Clear no REDFOR units inside BLUFOR stage upon stage completion.

The first option - clearing ALL units - could be argued to be outside the scope of Spearhead as these units are not associated with any Spearhead missions. However, I think it would be a QoL feature to not need to have to create a separate trigger and tie it to the stage completion event.

@Luke What type of filters do you want to apply beyond the three I listed above? I think it also depends on how a mission is designed. In Resilient Eagle '91 the completion of a stage implies a new frontline in the next stage, hence leaving anti-air units inside BLUFOR stages would not make much sense for me (unless these were MANPADS).

From my perspective I would like to have the following three options: - Clear all REDFOR units inside BLUFOR stage upon stage completion. - Clear all REDFOR mission units inside BLUFOR stage upon stage completion. - Clear no REDFOR units inside BLUFOR stage upon stage completion. The first option - clearing ALL units - could be argued to be outside the scope of Spearhead as these units are not associated with any Spearhead missions. However, I think it would be a QoL feature to not need to have to create a separate trigger and tie it to the stage completion event. @Luke What type of filters do you want to apply beyond the three I listed above? I think it also depends on how a mission is designed. In Resilient Eagle '91 the completion of a stage implies a new frontline in the next stage, hence leaving anti-air units inside BLUFOR stages would not make much sense for me (unless these were MANPADS).
Author
Member

From my perspective I would like to have the following three options:

  • Clear all REDFOR units inside BLUFOR stage upon stage completion.
  • Clear all REDFOR mission units inside BLUFOR stage upon stage completion.
  • Clear no REDFOR units inside BLUFOR stage upon stage completion.

The first option - clearing ALL units - could be argued to be outside the scope of Spearhead as these units are not associated with any Spearhead missions. However, I think it would be a QoL feature to not need to have to create a separate trigger and tie it to the stage completion event.

@Luke What type of filters do you want to apply beyond the three I listed above? I think it also depends on how a mission is designed. In Resilient Eagle '91 the completion of a stage implies a new frontline in the next stage, hence leaving anti-air units inside BLUFOR stages would not make much sense for me (unless these were MANPADS).

Those options cover it, I think.

I would argue cleaning all units in a zone would be possibly within scope for Spearhead, given that its despawning of units allows for much more to be in the mission overall, with less active at any one time. Cleaning finished zones I think would be the other end of that chain, allowing pretty big missions without nearly the performance impact of having everything active at once.

Options to leave come red units (Anti-air groups, etc), and specifying which missionstage to leave (Clear MISSIONSTAGE_1_a but not MISSIONSTAGE_1_b, etc) would also be nice

Being able to filter which units are left would be great for less traditional conflict such as COIN, etc. Especially if unit groups could also be left uncleaned, such as with a group name prefix. Enough to leave the area still feel occupied, but allowing most to be removed for performance.

> From my perspective I would like to have the following three options: > > - Clear all REDFOR units inside BLUFOR stage upon stage completion. > - Clear all REDFOR mission units inside BLUFOR stage upon stage completion. > - Clear no REDFOR units inside BLUFOR stage upon stage completion. > > The first option - clearing ALL units - could be argued to be outside the scope of Spearhead as these units are not associated with any Spearhead missions. However, I think it would be a QoL feature to not need to have to create a separate trigger and tie it to the stage completion event. > > @Luke What type of filters do you want to apply beyond the three I listed above? I think it also depends on how a mission is designed. In Resilient Eagle '91 the completion of a stage implies a new frontline in the next stage, hence leaving anti-air units inside BLUFOR stages would not make much sense for me (unless these were MANPADS). Those options cover it, I think. I would argue cleaning all units in a zone would be possibly within scope for Spearhead, given that its despawning of units allows for much more to be in the mission overall, with less active at any one time. Cleaning finished zones I think would be the other end of that chain, allowing pretty big missions without nearly the performance impact of having everything active at once. Options to leave come red units (Anti-air groups, etc), and specifying which missionstage to leave (Clear MISSIONSTAGE_1_a but not MISSIONSTAGE_1_b, etc) would also be nice Being able to filter which units are left would be great for less traditional conflict such as COIN, etc. Especially if unit groups could also be left uncleaned, such as with a group name prefix. Enough to leave the area still feel occupied, but allowing most to be removed for performance.
Author
Member

From my perspective I would like to have the following three options:

  • Clear all REDFOR units inside BLUFOR stage upon stage completion.
  • Clear all REDFOR mission units inside BLUFOR stage upon stage completion.
  • Clear no REDFOR units inside BLUFOR stage upon stage completion.

The first option - clearing ALL units - could be argued to be outside the scope of Spearhead as these units are not associated with any Spearhead missions. However, I think it would be a QoL feature to not need to have to create a separate trigger and tie it to the stage completion event.

@Luke What type of filters do you want to apply beyond the three I listed above? I think it also depends on how a mission is designed. In Resilient Eagle '91 the completion of a stage implies a new frontline in the next stage, hence leaving anti-air units inside BLUFOR stages would not make much sense for me (unless these were MANPADS).

Those options cover it, I think.

Options to leave come red units (Anti-air groups, etc), and specifying which missionstage to leave (Clear MISSIONSTAGE_1_a but not MISSIONSTAGE_1_b, etc) would also be nice

> From my perspective I would like to have the following three options: > > - Clear all REDFOR units inside BLUFOR stage upon stage completion. > - Clear all REDFOR mission units inside BLUFOR stage upon stage completion. > - Clear no REDFOR units inside BLUFOR stage upon stage completion. > > The first option - clearing ALL units - could be argued to be outside the scope of Spearhead as these units are not associated with any Spearhead missions. However, I think it would be a QoL feature to not need to have to create a separate trigger and tie it to the stage completion event. > > @Luke What type of filters do you want to apply beyond the three I listed above? I think it also depends on how a mission is designed. In Resilient Eagle '91 the completion of a stage implies a new frontline in the next stage, hence leaving anti-air units inside BLUFOR stages would not make much sense for me (unless these were MANPADS). Those options cover it, I think. Options to leave come red units (Anti-air groups, etc), and specifying which missionstage to leave (Clear MISSIONSTAGE_1_a but not MISSIONSTAGE_1_b, etc) would also be nice
dutchie031 added the
Status
ToBeRefined
5
label 2026-08-19 07:55:20 +00:00
dutchie031 self-assigned this 2026-08-19 08:04:14 +00:00
Owner

Initial thoughts.

Scope

All units that are spawned by Spearhead are in scope of cleanup.
In coding, spawning/creating/instanciating generally means owning.
When you own it, you should also clean up.

This also makes it a lot easier for me personally as in code I don't have to "search" the area, I can simply just despawn all groups that were spawned by Spearhead (those are kept in the db anyway)

In general, missions created with Spearhead would have almost all units managed by spearhead.
If someone wants to then customize it in a way with spawning custom things, it should then also be their logic that despawns those units.

Options

In the config I'm planning on having a default stage cleanup value: defaultStageCleanup
With options:

  • all => cleans all RED units and statics in the stage
  • units => cleans all RED units, but leaves corpses and statics around. Can be nice and doesn't cost any performance as far as I can tell.
  • missions-all => clears all missions only
  • missions-units => clears only units in said missions, leaving corpses.
  • none => does not perform any cleanup on the stage

I'm thinking the "static" only options might make a nice additional option to the ones that were mentioned before so that mission makers can keep the idea of a non-sterile environment, without having threads.

Other flags can be added with other logic.

Then each stage triggerzone will also get the option to have custom configuration
stageCleanup in the properties that can have the same settings.
That way you can have a default so you don't have to constantly edit it.
But you'll have the options to treat certain stages differently.

Initial thoughts. ## Scope All units that are spawned by Spearhead are in scope of cleanup. In coding, spawning/creating/instanciating generally means owning. When you own it, you should also clean up. This also makes it a lot easier for me personally as in code I don't have to "search" the area, I can simply just despawn all groups that were spawned by Spearhead (those are kept in the db anyway) In general, missions created with Spearhead would have almost all units managed by spearhead. If someone wants to then customize it in a way with spawning custom things, it should then also be their logic that despawns those units. ## Options In the config I'm planning on having a default stage cleanup value: `defaultStageCleanup` With options: - `all` => cleans all RED units and statics in the stage - `units` => cleans all RED units, but leaves corpses and statics around. Can be nice and doesn't cost any performance as far as I can tell. - `missions-all` => clears all missions only - `missions-units` => clears only units in said missions, leaving corpses. - `none` => does not perform any cleanup on the stage I'm thinking the "static" only options might make a nice additional option to the ones that were mentioned before so that mission makers can keep the idea of a non-sterile environment, without having threads. Other flags can be added with other logic. Then each stage triggerzone will also get the option to have custom configuration `stageCleanup` in the properties that can have the same settings. That way you can have a default so you don't have to constantly edit it. But you'll have the options to treat certain stages differently.
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Spearhead/spearhead#14