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

Script Systems & Components #244

Open
4 of 7 tasks
Tracked by #150
makspll opened this issue Feb 1, 2025 · 2 comments
Open
4 of 7 tasks
Tracked by #150

Script Systems & Components #244

makspll opened this issue Feb 1, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@makspll
Copy link
Owner

makspll commented Feb 1, 2025

The idea of using scripts as systems, i.e. having a script declare functions which act like systems, with specific dependencies on the world, and scheduling them in such a way that they can access the world safely

  • Dynamic world access system
  • Handler resources should have interior mutability at bms_core level, so systems can run in parallel if they access different scripts
  • Command - Deferred versions of the WorldGuard bindings (i.e. insert_component_deferred + better warnings if aliasing is broken, geared towards script authors who might not know rust)
  • Reflecting schedules and systems, querying the ordering
  • Multi threading scripts
  • Dynamically injecting systems into bevy schedule safely
  • Injected systems to specify access ahead of time, and dynamic systems are parallelizable against other systems
@makspll
Copy link
Owner Author

makspll commented Feb 26, 2025

The linked PR, will allow us to create world guards compatibile with the schedule at the point of insertion, while it doesn't get us all the way there, it does solve the first part necessary in achieving script systems, I.e.:

  • syncing the accesses map with the bevy schedule

In theory, now even without a dynamic script insertion mechanism, you could have a number or "sync" points predefined by the author which could bootstrap script systems into specific parts of bevy.

The big limitation though is that if you insert a script at any point of the bevy schedule which accesses ANYTHING in the world, your script won't be able to get global access, I.e. it will have to schedule component insertions like a normal system

@makspll
Copy link
Owner Author

makspll commented Feb 28, 2025

Dynamically adding event handlers is now possible through: #335, including ordering constraints against rust systems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Planned
Development

No branches or pull requests

1 participant