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

ecs_guide example panics #7565

Closed
cryscan opened this issue Feb 8, 2023 · 0 comments
Closed

ecs_guide example panics #7565

cryscan opened this issue Feb 8, 2023 · 0 comments
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples

Comments

@cryscan
Copy link
Contributor

cryscan commented Feb 8, 2023

Bevy version

main (978f7cd)

What you did

Run the ecs_guide example.

cargo run --example ecs_guide --release

What went wrong

thread 'main' panicked at 'Systems cannot be added to 'base' system sets using 'in_set'. Use 'in_base_set' instead.', examples/ecs/ecs_guide.rs:301:45
@cryscan cryscan added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Feb 8, 2023
@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Examples An addition or correction to our examples and removed S-Needs-Triage This issue needs to be labelled labels Feb 8, 2023
@bors bors bot closed this as completed in 1b44497 Feb 8, 2023
myreprise1 pushed a commit to myreprise1/bevy that referenced this issue Feb 11, 2023
Fixes bevyengine#7565

`ecs_guide` example is currently panicking. This seems to just be a problem with the example only caused by the base sets PR.

First, changed a few `in_set` to `in_base_set` to fix a few of

```
thread 'main' panicked at 'Systems cannot be added to 'base' system sets using 'in_set'. Use 'in_base_set' instead.', examples/ecs/ecs_guide.rs:301:45
```

And then added an `in_base_set` to fix the resulting (confusing) cycle error

```
2023-02-06T13:54:29.213843Z ERROR bevy_ecs::schedule_v3::schedule: schedule contains at least 1 cycle(s) -- cycle(s) found within:
 ---- 0: ["ecs_guide::game_over_system", "ecs_guide::score_check_system"]
```

I also changed this `add_system` call so the comment above and below make sense:
```diff
         // add_system(system) adds systems to the Update system set by default
         // However we can manually specify the set if we want to. The following is equivalent to
         // add_system(score_system)
-        .add_system(score_system)
+        .add_system(score_system.in_base_set(CoreSet::Update))
         // There are other `CoreSets`, such as `Last` which runs at the very end of each run.
```

- Does `MySet` even need to be a base set? Seems like yes.
- Is that cycle error when there is no explicit `in_base_set` actually expected?
myreprise1 pushed a commit to myreprise1/bevy that referenced this issue Feb 11, 2023
Fixes bevyengine#7565

`ecs_guide` example is currently panicking. This seems to just be a problem with the example only caused by the base sets PR.

First, changed a few `in_set` to `in_base_set` to fix a few of

```
thread 'main' panicked at 'Systems cannot be added to 'base' system sets using 'in_set'. Use 'in_base_set' instead.', examples/ecs/ecs_guide.rs:301:45
```

And then added an `in_base_set` to fix the resulting (confusing) cycle error

```
2023-02-06T13:54:29.213843Z ERROR bevy_ecs::schedule_v3::schedule: schedule contains at least 1 cycle(s) -- cycle(s) found within:
 ---- 0: ["ecs_guide::game_over_system", "ecs_guide::score_check_system"]
```

I also changed this `add_system` call so the comment above and below make sense:
```diff
         // add_system(system) adds systems to the Update system set by default
         // However we can manually specify the set if we want to. The following is equivalent to
         // add_system(score_system)
-        .add_system(score_system)
+        .add_system(score_system.in_base_set(CoreSet::Update))
         // There are other `CoreSets`, such as `Last` which runs at the very end of each run.
```

- Does `MySet` even need to be a base set? Seems like yes.
- Is that cycle error when there is no explicit `in_base_set` actually expected?
myreprise1 pushed a commit to myreprise1/bevy that referenced this issue Feb 15, 2023
Fixes bevyengine#7565

`ecs_guide` example is currently panicking. This seems to just be a problem with the example only caused by the base sets PR.

First, changed a few `in_set` to `in_base_set` to fix a few of

```
thread 'main' panicked at 'Systems cannot be added to 'base' system sets using 'in_set'. Use 'in_base_set' instead.', examples/ecs/ecs_guide.rs:301:45
```

And then added an `in_base_set` to fix the resulting (confusing) cycle error

```
2023-02-06T13:54:29.213843Z ERROR bevy_ecs::schedule_v3::schedule: schedule contains at least 1 cycle(s) -- cycle(s) found within:
 ---- 0: ["ecs_guide::game_over_system", "ecs_guide::score_check_system"]
```

I also changed this `add_system` call so the comment above and below make sense:
```diff
         // add_system(system) adds systems to the Update system set by default
         // However we can manually specify the set if we want to. The following is equivalent to
         // add_system(score_system)
-        .add_system(score_system)
+        .add_system(score_system.in_base_set(CoreSet::Update))
         // There are other `CoreSets`, such as `Last` which runs at the very end of each run.
```

- Does `MySet` even need to be a base set? Seems like yes.
- Is that cycle error when there is no explicit `in_base_set` actually expected?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples
Projects
None yet
2 participants