|
|
|
|
Reply From: |
Michael Paul |
When deciding on whether or not a concept is a new scene or not, decide if it NEEDS to be by asking yourself the following questions…
Will there be multiple occurrences of this entity?
Will the item vary in fundamental ways?
Will it exist on its own, or is it depend on a specific support item?
Will/can it operate independently?
For example, if you have a car scene and it has individual components…
Steering wheel: Probably won’t vary from car to car, needs car to exist, and the car only needs one of them. This can and probably should be part of the car scene.
Wheels: Have multiple occurrences, may vary in size and composition, and may exist on their own in a pit to be replaced when worn, or fly off a car in accident. These should be a separate scene(s) and instantiated as needed.
The analogy may not be the best, but answering those questions and similar ones will help you determine a logical structure to your game (or any program), and you will thank yourself later because it has structure with purpose.
Great feedback. Very much appreciated. From that I would summise that my power ups, as they will be unique to the Player and static once ‘discovered’ would be best contained as a child of the Player node.
Maybe as a separate script and extending from the Player.gd for readability?
Icarus | 2017-12-06 14:49
Ultimately up to you to decide. The example questions that I posed above aren’t perfect guidelines. There will always be grey areas and overlap. If your power-ups are an entity that have specific characteristics and might be acquired by multiple players in an MMO for example, definitely use a separate instance. If it is simply a state change to an individual player scene that may change his stats temporarily and have maybe a little animation glow, you don’t really need a separate scene. Another thing to think about that I inadvertently omitted is overhead. If something will require a lot of memory just to sit in a scene hidden most of the time, and only be needed occasionally, your performance might benefit from a loadable/releasable scene.
BTW, readability looks like it’s getting some love in the beta of 3.0 with collapsible function blocks
Edit: I misread your last comment slightly and after re-reading, I agree. It sounds more like a state change of the player and would be best suited as a child node of the player scene imo.
Michael Paul | 2017-12-06 15:06