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

Plugin System Replacement: Fine grained schedule modding #10713

Open
ItsDoot opened this issue Nov 23, 2023 · 1 comment
Open

Plugin System Replacement: Fine grained schedule modding #10713

ItsDoot opened this issue Nov 23, 2023 · 1 comment
Labels
A-App Bevy apps and plugins A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible

Comments

@ItsDoot
Copy link
Contributor

ItsDoot commented Nov 23, 2023

What problem does this solve or what need does it fill?

I want to give Plugin consumers an extra level of fine tuning by allowing them to replace preexisting systems in a schedule with their own system.

What solution would you like?

When system foo is replaced with system bar:

  • foo is removed from the schedule, and bar is added.
  • All SystemSets that foo was in, bar should be added to.
  • Preexisting schedule constraints for foo should be copied over to bar.
  • Any schedule constraint added later to foo should be instead rerouted to bar.

Suggested API:

impl App {
    // Note that its some new singular `IntoSystemConfig` type rather than the plural `IntoSystemConfigs`.
    // Allowing multiple systems on either side would make this too complex.
    pub fn replace_system<A, B>(&mut self, schedule: impl ScheduleLabel, from: impl IntoSystemConfig<A>, to: impl IntoSystemConfig<B>);
}

This also means the system to be replaced must be nameable/visible (non-private) to consumers.

What alternative(s) have you considered?

Require consumers to replace whole Plugins.

@ItsDoot ItsDoot added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled A-ECS Entities, components, systems, and events and removed S-Needs-Triage This issue needs to be labelled labels Nov 23, 2023
@alice-i-cecile alice-i-cecile added the A-App Bevy apps and plugins label Nov 24, 2023
@alice-i-cecile
Copy link
Member

alice-i-cecile commented Nov 24, 2023

Related to #2160, and depending on the implementation details, #279.

@alice-i-cecile alice-i-cecile changed the title System Replacement: Fine grained schedule modding Plugin System Replacement: Fine grained schedule modding Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-App Bevy apps and plugins A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible
Projects
None yet
Development

No branches or pull requests

2 participants