META: transition to legion #2278
Comments
So there are some architectural issues that need to be discussed before continuing with the rest of the port. I will try to overview them to get some feedback. System syntaxOne of the main differences with legion is that systems use closures instead of traits with
As you can see the syntax is quite ugly. First function gets called by the user to provide DispatcherSecond major part is dispatcher. Since we no longer have system dependencies as in specs (although it could be implemented, but I don't think it was a good concept), a staged executor concept was introduced in legion rfc. Stages are mostly needed by system bundles to insert multiple systems in the correct order. Although, I have not yet seen any bundle that would have non-sequential dependencies in the engine. The downside of this approach is that it makes really hard to understand system execution order from code as you have to look at each bundle implementation what stage each system is assigned to. I think a much better approach is current legion's scheduler. You basically add all systems in order of execution and they are parallelised based on their data dependencies. This provides a really nice deterministic control over system execution order. However, it puts the burden of correctly ordering core systems (input, transform, rendering) on the user, otherwise delays could be introduced (not a big deal?). There were also ideas for dynamic dispatcher, so that you could add and remove systems on the fly. This would technically only be possible with the staged dispatcher, as it would allow inserting systems at a specific order. But for legion's scheduler, I think this could be implemented as dynamic bundles. You would basically query for bundle in dispatcher (by name?) and add/remove/clear systems in it. This could also be recursively composable. Pausing bundles is also possible (yay!). |
Closing this as we have #2309 |
This is a meta issue for transition from specs to legion. Continuation of amethyst/rfcs#22
Thank you @jaynus for your work on the legion. Since the
legion
branch was more than 150 commits behind master and had different folder structure due to initial specs and legion coexistance it was almost impossible to merge. So I manually ported most of the changes on top of fresh master and work continues here https://github.com/amethyst/amethyst/commits/legion_v2.Progress tracking is done in legion project https://github.com/amethyst/amethyst/projects/21
Current status is similar to the one described in the RFC issue. Core, assets, rendy are ported and can be tested by the two
window
andmaterial
examples.Feel free to pick any issue from the project and contribute 😃
The text was updated successfully, but these errors were encountered: