bevyengine / bevyengine/bevy

Make subapps run in parallel with main app

Open
#9,045 1 comment 11 reactions 0 assignees View on GitHub
A-App C-Usability
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

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

I was making a video about sub-apps as I thought they would be useful if someone wanted to brake a game up into differently controlled worlds (eg no hostile pathfinding systems in the sub-app and just swap the app and sub-app worlds when the player "moves" between them), but while I was doing some testing and reading the code I found that the sub-apps are run consecutively rather than in parallel, this undermines what I thought would be the biggest selling point of sub-app, they all have independent worlds and schedules so don't have to worry about conflicting systems with mutable access allowing for maximum concurrency. I know the render sub-app runs in parallel to the main app but I don't know enough about how it does this to make suggestions on how this could be replicated in other sub-apps. this would also pair well with #6700 allowing you to basically create a sup-app say a self-contained mini-dungeon like a scene, but unlike a scene, these two worlds don't have to worry about conflicting with each other since they don't share the same world and can therefore have there own self contained resources and states.

## What solution would you like?

I would like to see sub-apps run their extract function consecutively and then all run updates in parallel rather than currently running one at a time (extract, extract, ext... parallel update) vs (extract, update, extract, update, ext, ext...)

## What alternative(s) have you considered?

move sub-apps out of the App struct and into a resource inside the world, this also fixes #6700 since you could access the resource inside systems and change it. this may not be possible as I don't know why the sub-apps have a dedicated place in the main app, would make some sense if they run in parallel since then the app doesn't need world access to run them but schedulers found a way around this by removing them self from the world then running

Leaving it up to the community to make third-party plugins to achieve the same result, probably thou a resource containing worlds and schedulers and an exclusive system.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.