Dialogues not working after scene switch (with new database)
Posted: Fri Nov 26, 2021 6:23 pm
Hi,
We have an issue with our game that we can't figure out. Our game is divided into several scenes which are run through sequentially, and there is (currently) no information that needs to be passed between scenes. For now we are using a separate database for each scene, the idea being that we would never have to load more than one in memory. I know that this may not be the best approach, and we may end up changing it in the future, but at least in the short term it will have to stay like this.
Now, in the editor everything works like a charm. We have a prototype that runs through all our different scenes sequentially, and everything behaves as intended. However, when we run a build for our game, only the first loaded scene has functional dialogues, in all subsequent scenes usables that are supposed to start a conversation just do nothing when clicked. We know this doesn't have anything to do with the individual scenes, regardless of which one we set as the first scene in the build, it works as intended. It's after a scene switch that the problem occurs.
So clearly we are doing something wrong on scene switch, I just don't know what. I assume the DB from the previous scene is not unloaded when loading the next scene, which then leads to id conflicts or something similar, causing the dialogues not to fire. Either that, or the DB for the new scene is just not loaded at all. We're not actually doing anything to load or unload database at least (no code or config setting which we've changed).
Any indications what we might be forgetting? At present I'm just looking for a quick fix, since we have to submit a build in a few days, after that we can do more thorough restructuring if that turns out to be advisable.
We have an issue with our game that we can't figure out. Our game is divided into several scenes which are run through sequentially, and there is (currently) no information that needs to be passed between scenes. For now we are using a separate database for each scene, the idea being that we would never have to load more than one in memory. I know that this may not be the best approach, and we may end up changing it in the future, but at least in the short term it will have to stay like this.
Now, in the editor everything works like a charm. We have a prototype that runs through all our different scenes sequentially, and everything behaves as intended. However, when we run a build for our game, only the first loaded scene has functional dialogues, in all subsequent scenes usables that are supposed to start a conversation just do nothing when clicked. We know this doesn't have anything to do with the individual scenes, regardless of which one we set as the first scene in the build, it works as intended. It's after a scene switch that the problem occurs.
So clearly we are doing something wrong on scene switch, I just don't know what. I assume the DB from the previous scene is not unloaded when loading the next scene, which then leads to id conflicts or something similar, causing the dialogues not to fire. Either that, or the DB for the new scene is just not loaded at all. We're not actually doing anything to load or unload database at least (no code or config setting which we've changed).
Any indications what we might be forgetting? At present I'm just looking for a quick fix, since we have to submit a build in a few days, after that we can do more thorough restructuring if that turns out to be advisable.