Week 5 (13/10/2025 - 19/10/2025)
This week was spent completing all of the Scriptable Objects I had planned for the Dialogue System, as well as the Dialogue Manager itself and finishing up inventory handling, along with a few miscellaneous tasks. This meant that I could finally retire the placeholder scripts that I had used in project for the Proof of Concept milestone.
For the dialogue system, I created the Speaker, the Dialogue Line, the Dialogue Block and the Dialogue Branch.
This is the speaker object, useful for changing out who's saying what lines at any given time.
This is the Dialogue Line object, which contains a reference for the speaker of the dialogue and the content of the dialogue itself.
This is a Dialogue Block, which is composed of a customizable list of Dialogue Lines and has values depending on whether or not the dialogue is repeatable, whether it branches and whether or not it has been completed.
This is a Dialogue Branch, which contains references to two dialogue blocks based on whether or not the condition of the Branch has been achieved. The Dialogue Branch can evaluate for two different types of conditions: if Reggie has a specific Item in the inventory and if an important NPC has been spoken to.
This is an example of a Dialogue block that will trigger again once the player finishes the conversation and comes back. It also contains a Dialogue Branch reference. When this gets read into the Dialogue Manager, once the dialogue content of the block is concluded, it will execute the Condition checking method in the Manager until the condition has been fulfilled.
Lastly, I completed the manager, which was by far the most difficult part of this undertaking. It holds references to the Dialogue Canvas, and the currently loaded Dialogue Block, as well as containing it's own index to parse through dialogue lines with. When making the methods to load and play through Dialogue, I thought it would be a simple endeavor if I kept everything I wanted it to do abstracted, so that they could be called in a linear fashion. Sadly, the existence of the branching dialogue threw this dream of simplicity and straightforwardness into the gutter for the entirety of the project. So much time was spent having to troubleshoot the order that the logic executed in, particularly in getting the correct dialogue to play without delay when the player returned to the NPC after having completing the quest that the branch required to switch to the Success branch of dialogue.
The final piece to seeing dialogue implemented in a meaningful way was to create the script attached to NPCs that would allow them to have conversations with the player when interacted with. A quick invocation of the Interactable interface and a reference to the single Dialogue Manager in the scene allows interaction with the NPC to trigger the LoadBlock and ShowDialogue methods to allow the dialogue manager to handle the Dialogue Block passed on from rootDialogue as needed. This was obviously much easier to implement after all of the hard work was accomplished in the manager's script, but frustratingly I still had to return this script to rewrite it to fix bugs with how information was being passed to the manager and what methods were called in which orders.
Aside from coding things relating to Dialogue, I also finalized the Item SOs and the code required to pickup Items and sent them to the needed inventory bases in the scene.
Besides coding, I also added some explicit navigation between the item holders in my Inventory UI Page to prototype being able to move through inventory items using the arrow keys. This is definitely something to explore in more detail for next semester, but getting a feel for how it would work is still beneficial while I have the time now. Because of Charlie's work in making a method in the character controller that freezes movement that is also accessible across scripts, I can rely on that work and call that script to disable movement whenever the inventory UI is active, and re-enable it when it's deactivated.
All in all the efforts from this week will be useful to me to set up the plots created by Lilli and the rest of the team and the overall progression of each case, since Dialogue and picking up clues are such an integral part of the game's core gameplay loop and design as a detective game.
The more modular and self-responsible I can make the aspects of the Dialogue System, the less I'll need to overhaul or engineer it in the future, letting me focus specifically on level design. It is an exhaustive process to make it from scratch though, especially since it's already so discouraged when there exists systems that can manage dialogue for you in Unity's asset stores.
Although, there is a greater level of satisfaction figuring out some aspects of this dialogue system from scratch instead of relying on the work and research of others so heavily.