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

Example of parallel processing of a SystemSet #1989

Open
CGMossa opened this issue Apr 23, 2021 · 6 comments
Open

Example of parallel processing of a SystemSet #1989

CGMossa opened this issue Apr 23, 2021 · 6 comments
Labels
A-Core Common functionality for all bevy apps C-Examples An addition or correction to our examples

Comments

@CGMossa
Copy link
Contributor

CGMossa commented Apr 23, 2021

I'm working on using Bevy to facilitate an ecological (scientific) simulation model. To that end, I need to repeat/replicate the positted scenario a number of times, while using already available resources, and also having some things that pertain to the
particular iteration. Also, I need to reset some resources/etc. after each run.

There is a discussion on this here #1678, where @alice-i-cecile called this

easy parallel process replication

and also there is this RFC for SubWorlds bevyengine/rfcs#16 that could help with this.

If someone could pinpoint some way to accomplish today, that would be great so as to be able to get going for now.

@ghost
Copy link

ghost commented Apr 23, 2021

I have a PR up for an example of system sets.
If I understood your requirements correctly perhaps this part is of interest to you:

https://github.com/bevyengine/bevy/pull/1909/files#diff-608eb7fd189284d2c34d7192c97d3400c16781e1d031437da19b0714a790486eR77-R93

I haven't gotten a lot feedback on the PR yet though so I'm not sure if it's idiomatic/correct/clear at this point, but it might at least point you in the right direction.

@CGMossa
Copy link
Contributor Author

CGMossa commented Apr 23, 2021

Thanks for the reply. I like reading this example. I am not sure it is doing what I wish for it todo. But it is such a nicely written example. My problem is that the repetition has to run "separately". Imagine like if I basically was simulating an NPC separately, or separate games.

@alice-i-cecile alice-i-cecile added A-Core Common functionality for all bevy apps C-Examples An addition or correction to our examples labels Apr 23, 2021
@CGMossa
Copy link
Contributor Author

CGMossa commented Jun 22, 2021

I'm still unable to do this, and it is beginning to become important for my project.
Currently, there is no way for me to even Clone the World and then use that as a way to parallel run
the App.

I'd appreciate it if anyone had some ideas on how to do it.

@Ixentus
Copy link
Contributor

Ixentus commented Jun 22, 2021

Have you seen the new Render Rework? It includes a SubApps experiment.
The second iteration (first link) also has SubGraphs.
Not sure if either solves your problem right now, but they are worth checking out.

@mockersf
Copy link
Member

Would it work in your case to tag entities specific to a scenario with a unit struct Scenario1, and have everything in one app, with your systems only making interactions between entities with the same tag?

@CGMossa
Copy link
Contributor Author

CGMossa commented Jun 24, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Core Common functionality for all bevy apps C-Examples An addition or correction to our examples
Projects
None yet
Development

No branches or pull requests

4 participants