I’m building a game where I want to scatter some items around the world in various different scenes.
I have some randomization logic that takes a graph of nodes (places where an item could be) and edges (items required to traverse the space between nodes) and then gives me a list of which items should appear where - I can store this globally just fine and my scenes can spawn the appropriate item on load.
I’d like to be able to place and configure the node and edge data while editing my rooms in the Scene editor, but I need to get a graph of all of the nodes when the game first loads in order to pre-determine the item locations. I can plot nodes and edges within a single Scene just fine, but as soon as some of them are in a non-active Scene, I don’t know how to get at them.
- I can’t randomise the items when the player enters the scene, for various reasons - they need to be randomized before play begins, when the player starts a new game.
- I want to avoid having the node/edge data in separate files to the scene (e.g. just load it from JSON) because then it can get out of sync with the game itself and it’ll be a pain to keep up to date during level design.
- The loading zones between scenes are treated as nodes as well - the center of a room has an edge to the loading zone, and the logic class can already stitch the rooms together as needed if I can find a way to make GetNodes(scene) work.