bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.74k stars 3.61k forks source link

scene example only shows a gray window. #169

Closed BafDyce closed 4 years ago

BafDyce commented 4 years ago

The scene example shows only an empty, completely gray, window for me. I dont see any objects, not even if I modify the scene and the app reloads it.. Happens with and without --release.

$ cargo run --example scene --release
    Finished release [optimized] target(s) in 0.24s
     Running `target/release/examples/scene`
[
  (
    entity: 965537340,
    components: [
      {
        "type": "ComponentB",
        "map": {
          "value": "hello",
        },
      },
      {
        "type": "ComponentA",
        "map": {
          "x": 1.0,
          "y": 2.0,
        },
      },
    ],
  ),
  (
    entity: 814248834,
    components: [
      {
        "type": "ComponentA",
        "map": {
          "x": 3.0,
          "y": 4.0,
        },
      },
    ],
  ),
]
  Entity(328997855)
    ComponentA: { x: 3 y: 4 }

  Entity(1154439664)
    ComponentA: { x: 3 y: 4 }

  Entity(404566393)
    ComponentA: { x: 1 y: 2 }

  Entity(837292325)
    ComponentA: { x: 1 y: 2 }

Current version of the repo (latest one right now): a7f1889a35f93b13edc2b1233189656289b0448e

$ rustc --version
rustc 1.45.2 (d3fb005a3 2020-07-31)
$ cargo --version
cargo 1.33.0

Do you also need other software versions / system specs? Other examples seem to work fine, even the breakout game works.

karroffel commented 4 years ago

For that example that is the expected behaviour. None of the entities have components that have a visual representation and no camera is present in the scene either.

I believe the purpose of the scene example is to show how to load a scn file with custom components and that hot-reloading works with scene files too (try changing the values in the file and watch the output in the console).

This is not an issue in itself, but it hints that the purpose of this example could be made clearer!

alanjfs commented 4 years ago

I actually launched it hoping to see a scene too. :) So +1. Maybe a name e.g. serialisation is more apt?

BafDyce commented 4 years ago

I see. Maybe it would be a great idea to include a Camera then so that the user also "sees" that it is really working and changing the world?

karroffel commented 4 years ago

Maybe there can be some Texts on the screen that display the values of the components loaded from the scene file with a hint "Try changing assets/scene/load_scene_example.scn" or something along the line of that?

BafDyce commented 4 years ago

I have created a PR which adds a simple message telling the user to look at the console output. This should at least show the user that there should be no content in the UI window.

Abendstolz commented 4 years ago

Hehe, I too was expecting the video from https://bevyengine.org/news/introducing-bevy/ before I read the source code of that example :D

BafDyce commented 4 years ago

Hehe, I too was expecting the video from https://bevyengine.org/news/introducing-bevy/ before I read the source code of that example :D

Exactly!

cart commented 4 years ago

Resolved by #181. Thanks!