DecisionManager System - Tunel


During this stage of the project, I worked on making a decision system for the player within the game. Until now, the narrative system inside the tunnel was very linear: The player walked through the tunnel and when crossing a collider an interface with a single button was activated, which if pressed closed this interface and the player could continue advancing to the next point (next collider where the next dialog interface would appear) and this point repeated the same process until reaching the end of the tunnel, where the character's identity selection interface would appear and then switch to the main scene of the game.

My partner who worked on the narrative for the game, gave me the dialogs that had to be implemented in this tunnel, and I realized that now the player had response options in the dialogs. Depending on the response option he chose at the moment, I had to show a different dialogue depending on the past response, so we were no longer served by the linear system and I had to change it completely.


For this, I developed a completely modular branching decision system. The idea is that the player can choose different options in the tunnel path, and depending on his previous choice a different path is activated.

The system is composed of a new script that I called DecisionManager, which manages a (Serializable) list of decision paths. Within this list the colliders were associated with the interface that corresponded to it and a list of options in which you assign the buttons, there you assign the button of the interface that you are associating and at the same time it is assigned below the button that this option leads to (assigning the collider that corresponds to this answer). So, how does the new system work? The player appears at the starting point of the tunnel, as usual, but now all colliders are disabled, except the first one (but its corresponding interface). Depending on the option that the player chooses with his answer in the first dialog, the collider that corresponds to that answer (already with its assigned interface) will be activated, then, when the player passes through the next collider, the dialog interface that corresponded to the previous answer will be activated. The paths that are not chosen remain inactive, allowing each player to trace their own route throughout the game and to have a more flexible narrative system with the story we want to convey.

All of this was mapped directly into the decision list from the inspector into an empty object where I assigned the DecisionManager script to it. I only had to drag each object to its corresponding field and each button is already linked from the inspector list, therefore from the code, so I didn't have to manually add its function with OnClick.


Leave a comment

Log in with itch.io to leave a comment.