I am attempting to develop a game similar to a Visual Novel where the player has choices that lead them down different paths, and the player’s only way of interaction is through these decision trees. I would like to be able to play different timelines depending on the preceding choice and the ‘states’ of certain variables.
An example:
If a character’s strength is at 10, and they choose to fight the monster, the timeline for the character acting out killing the monster plays. If the Character’s strength is at 0, and they choose to fight the monster, the timeline for the tragic death of the character plays.
Is there a way to do this and keep it organized within unity? Ideally, I’d like to be able to create some kind of visual tree that follows each of the potential choices and plays the respective timelines at each choice. At worst, I’d hope it’d be as complex as creating a series of conditional statements that play the timeline(s) with their respective background and scene shifts when needed.
Note: This is all 2D, everything is done with 2D sprite animations, if relevant.
In the editor go to Window/Package Manager. In Package Manager go to Unity Registry and install Cinemachine. After that you’ll have to read the Cinemachine manual or follow some tutorials but with Cinemachine you can do everything your describing and then some. I’m using it for a rail shooter and using the state driven camera to seamlessly switch cameras.
Actually I’m not really sure sir, maybe my idea of what a visual novel is is wrong, I’ve never played one or developed one. I’m assuming your going to make all the visual pieces then use conditional statements to display them at the appropriate time.
Strongly recommend Fungus for something like this. You can do conditional branches based on different criteria or even open it up to scripted scenarios.
Take a gander
This isn’t really an elegant solution because complexity grows so much and you need to handle all of them well. Is there any alternative tool, timeline isn’t really a tool for this. One solution is you can create different timelines for different scenarios but creating different timeline process itself is not very easy. Especially if you try to make it look natural by starting the next timeline with the last frame of the previous timeline.