jarkonik / jarkonik/bevy_scriptum

Test, stabilize and document scheduling behavior

Open
#34 1 comment 0 reactions 0 assignees View on GitHub
documentation
Dominant language
Rust
Stars
171
Forks
19
PR merge metrics
No merged PRs in 30d

Description

Asked on Bevy Discord by user mgi388

```
In bevy_scriptum, is there a good way to know when your Rust functions have all finished being executed? The Rust functions are just systems, so can I assume they all ran by the time the R::Schedule schedule (bevy_scriptum's schedule which runs after Update) finishes? For example, I could look at PostUpdate and in that same frame, could I assume the systems have all run? If yes, then I think I can insert a marker component on my script entity once I run it (e.g. MyScriptWasRun), then, in PostUpdate, I can look for my script entity with that marker component, and then insert yet another marker component to say that it should be finished (e.g. MyScriptRanToCompletion). Then, I can use the existence of MyScriptRanToCompletion to actual progress the state of my thing which relies on the script having run to completion.

This came up because I am running a script in OnEnter(SomeSetupLevelState) and all of my level setup is currently happening based on state transitions, and it surprised me that the script ran, but I had to wait for all of the systems the script calls to finish / they run out of order compared to all of my setup level state transitions.
```

It would be beneficial to have script execution scheduling be stable across library versions and documented. Could be facilitated by writing some execution scheduling tests and documenting the existing behavior in the documentation book.

Contributor guide

Open the contributing guide

Research direction

Start with the existing script execution scheduling implementation and the documentation book; the issue names no specific files or tests. Trace how the script schedule runs relative to Bevy's Update, state transitions, and PostUpdate, then add scheduling tests and document the behavior. Done means execution order is tested for stability and the supported completion behavior is explained in the book.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation, game-dev, testing
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.