2

I am learning Amethyst framework for Rust. And now I follow pong tutorial here. On step 3 (Moving paddles) tutorial teaches how to set up System for moving paddles. I followed all the steps, however when I cargo run my application i get an error:

thread 'main' panicked at 'Cannot insert multiple systems with the same name ("parent_hierarchy_system")', /home/path_to_cargo/shred-0.9.4/src/dispatch/builder.rs:172:17

I tried just to copy from GitHub repository of tutorial but get the same result.

My Cargo.toml looks:

[package]
name = "pong"
version = "0.1.0"
authors = []
edition = "2018"

[dependencies.amethyst]
version = "0.13"
features = ["vulkan"]

I run the project on Ubuntu 19.10. Rust version 1.37.

My guess is that input_system is somehow added twice when running. I have searched both tutorial repository for the same issue and the web. But it seems I am the only one who faced it. Perhaps solution is very easy but I have spent my Saturday trying to fix it.

let game_data = GameDataBuilder::default()
    .with_bundle(TransformBundle::new())?
    .with_bundle(input_bundle)?
    .with(systems::PaddleSystem, "paddle_system", &["input_system"]) // Add this line
    .with_bundle(
        RenderingBundle::<DefaultBackend>::new()
            .with_plugin(
                RenderToWindow::from_config_path(display_config_path)
                    .with_clear([0.0, 0.0, 0.0, 1.0]),
            )
            // RenderFlat2D plugin is used to render entities with a `SpriteRender` component.
            .with_plugin(RenderFlat2D::default()),
        )?
    .with_bundle(TransformBundle::new())?;

The code of my GameDataBuilder initialization.

FirePapaya
  • 509
  • 5
  • 21
  • Can you try `RUST_BACKTRACE=1 cargo run`? It will show you where the panic originates, which may also be the offending line. – edwardw Nov 23 '19 at 14:51
  • 1
    @edwardw the error occurs after I have initialized `game_data` and then initialize application itself `let mut game = Application::new(assets_dir, Pong, game_data)?;` – FirePapaya Nov 25 '19 at 13:56

1 Answers1

2

You have added the TransformBundle twice.

Removing one will remove this error.

Zach Dahl
  • 609
  • 5
  • 12