-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsA-TasksTools for parallel and async workTools for parallel and async workC-FeatureA new feature, making something new possibleA new feature, making something new possible
Description
What problem does this solve or what need does it fill?
Sometimes I don't really need the ECS framework but only need the schedule, for example:
- Plan all the tasks in a heavy-computation framework such as voxel generation for one generation requirement and run it, the framework generation process should be seen as a whole single system.
- Push tasks and generate the tasks dependency graph dynamically in one planning system and run the graph, once per frame. It's for situations like complex damage and effect dealing between characters.
What solution would you like?
Let the user have the ability to fully determine the behavior of the scheduling tool.
Example:
fn task1()...
fn plan1_system(mut commands: Commands){
commands.spawn(MyTask::new(task1));
...
}
fn schedule_system(tasks: Query<&MyTask>,mut scheduler: Scheduler) {
for task in tasks{scheduler(task,task.dependency); }
scheduler.complete();//The system completes when the graph completes.
}
fn main(){
App::new().add_system(...)
...
.add_system(
schedule_system
.after(Label::BeforeExecution))
.before(Label::AfterExecution)
)
.add_system(...)
...
}What alternative(s) have you considered?
#4090 I find the method run_schedule in this issue useful but the current World struct doesn't have it in bevy 0.9.1.
#7707 use commands to add one-shot systems but it seems only to support sequential execution.
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsA-TasksTools for parallel and async workTools for parallel and async workC-FeatureA new feature, making something new possibleA new feature, making something new possible