Stucked on Pong Tutorial

(Andra Antariksa) #1

Problems

I have followed the Pong tutorial on Amethyst Book, but I got stucked on Initialise some entities parts

This is the runtime error that I get

thread 'main' panicked at 'Tried to fetch a resource, but the resource does not exist.
Try adding the resource by inserting it manually or using the `setup` method.
You can get the type name of the missing resource by enabling `shred`'s `nightly` feature', /home/andraantariksa/.cargo/registry/src/github.com-1ecc6299db9ec823/shred-0.7.2/src/res/mod.rs:215:48

Attempt

I have tried to add the .with_bundle(TransformBundle::new()) on GameDataBuilder but I still facing the same issue.

Expectation

I expect the application would run without any problems, without registering the component to the world one by one as the books said

This is rather inconvenient — to need to manually register each component before it can be used. There must be a better way. Hint: there is.

and without using nightly compiler.

The code

(Théo Degioanni) #2

Have you tried enabling Amethyst’s nightly feature to obtain the name of the missing resource?

(Azriel Hoh) #3

Hm, there are two parts I’ll try to answer:

  • The code doesn’t “just work” without registering the components.
  • The tutorial brings you through the problem scenario.

For the first one, automatic registration of component storages does exist, but at that particular point in the tutorial, automatic registration isn’t yet present (but it is there in the next chapter). So to get the application running, the non-automatic way is requested.

The second point, the tutorial intentionally brings you through the problem scenario, so that when you run into that kind of error while developing a game, you know what to do to get more information on what is missing.

Hope that helps

1 Like
(Andra Antariksa) #4

Okay, I’m trying to continue reading the book and try the Pong example to run. But the SystemDesc macro is missing and I can’t find any reference for it.
I think it was caused by Amethyst v0.13.0 breaking changes (I’m using v0.13.1). Do you have any idea to solve it?

(Azriel Hoh) #5

It should exist if you go:

use amethyst::derive::SystemDesc;