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

[Bevy 0.8] A potential bug in bevy_ecs_tilemap or bevy_ecs_ldtk #107

Closed
chungwong opened this issue Aug 10, 2022 · 1 comment · Fixed by #106
Closed

[Bevy 0.8] A potential bug in bevy_ecs_tilemap or bevy_ecs_ldtk #107

chungwong opened this issue Aug 10, 2022 · 1 comment · Fixed by #106
Labels
bug Something isn't working
Milestone

Comments

@chungwong
Copy link

I am trying the rewrite branch and found a strange bug which is related to iyes_loopless

Here is the reproducible repo

The problem:

  1. With iyes_loopless in use for a GameState::LoadingLevel https://github.com/chungwong/tilemap_bug/blob/bug/src/state.rs#L13
  2. Ldtk map is loaded during entering of the state LoadingLevel, https://github.com/chungwong/tilemap_bug/blob/bug/src/tilemap.rs#L23
  3. cargo run will either result in
    a. game runs normally
    b. game runs normally with errors printed out
ERROR bevy_ecs::system::commands: Failed to 'insert or spawn' bundle of type bevy_ecs_tilemap::render::extract::ExtractedRemovedTileBundle into the following invalid entities: [4v0, 6v0]
ERROR bevy_ecs::system::commands: Failed to 'insert or spawn' bundle of type bevy_ecs_tilemap::render::extract::ExtractedRemovedMapBundle into the following invalid entities: [3v0]

c. panic

ERROR bevy_ecs::system::commands: Failed to 'insert or spawn' bundle of type bevy_ecs_tilemap::render::extract::ExtractedTileBundle into the following invalid entities: [3v1]
ERROR bevy_ecs::system::commands: Failed to 'insert or spawn' bundle of type bevy_ecs_tilemap::render::extract::ExtractedTilemapBundle into the following invalid entities: [4v1, 6v1]
ERROR bevy_ecs::system::commands: Failed to 'insert or spawn' bundle of type bevy_ecs_tilemap::render::extract::ExtractedTilemapTextureBundle into the following invalid entities: [6v1, 4v1]
thread 'Compute Task Pool (5)' panicked at 'called `Result::unwrap()` on an `Err` value: NoSuchEntity(4v1)', /home/chung/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs_tilemap-0.7.0/src/render/prepare.rs:82:55
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'task has failed', /home/chung/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.2.0/src/task.rs:425:45

I know the rewrite is still a work in progress and pontentially it is caused by bevy_ecs_tilemap but I am not quite sure about the cause of the problem.

@Trouv Trouv added the bug Something isn't working label Aug 12, 2022
@Trouv Trouv added this to the 0.4.0 milestone Aug 12, 2022
@Trouv
Copy link
Owner

Trouv commented Aug 12, 2022

Seems to be the same bug as #91. The same fix described by @beardedmullett seems to address this. Though I'm still not 100% sure that that fix is ideal. I'll work on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants