
An important gameplay mechanic is the dialogue system, which I want to make feel dynamic and natural. This means that when you talk to a character for the first time, you really have to pay attention, because you can't repeat the dialogue right after you finish it, and the character might get annoyed with you the more you try to talk to them.


No worries, the timeloop will save your socialising skills! You can repeat the dialogue every day, as the NPCs will forget what happened before and unlock more answer options to steer conversations in certain directions. There will also be a log in your device, also known as the player menu, where you can re-read the conversation and remember any forgotten information.

As you talk to different characters or find out information about them through the ongoing story, more options will be unlocked.


Don't worry about seeming like a weirdo who knows everything about a person and shocks them with all their information. I came up with the idea of memory fragments that can be unlocked at certain key events with the characters. So if you trigger a memory or a feeling in them by asking them certain questions, or telling them something profound, or even giving them a gift, they will remember you and that conversation throughout the time loop. This way, you as the player don't feel like an outsider because you're always the new face, and everyone else isn't seeing you for the first time. This could lead to some déja-vus, controversy and confusion.

As you build deeper relationships with characters by collecting memory fragments and increasing the level of friendship or even romance options, you'll be able to visit them in their rooms (which you can also hack into as a hotelier, but that's another story) and unlock more tasks, information and items that you'll need to continue the story. I also want to make some things optional so that you don't feel the pressure to date every single character and just play as you like.
So that was the premise for the dialogue system. Let's take a look at the technical implementation of this logic!

First, I started writing the dialogues in a spreadsheet before even thinking about the final structure. For some of the dialogues, which are shorter and easier to keep track of, a graphical solution would have been best. For more complicated conversations and different entry points, the graphs would have exploded and made it difficult to follow all the arrows.

There are ways of structuring data in software and one of them is JSON. In GDScript I can read a JSON file and translate it into a dialogue dictionary that makes the dialogues in the game accessible.
A dialogue always consists of one or more dialogue nodes containing the dialogue text. These nodes follow each other to create an RPG-like dialogue that you can continue by pressing a button. To know which node follows another, each node needs an individual key and a next key to know which one comes next. Here is a quick example of the spreadsheet snippet above:

Then I added the dialogue options. Each option also has a next key to define which node comes after the player chooses a particular option, of course it also has a text and a flag to define if the option is unlockable.

To make the whole conversation more immersive, I added emotions to the nodes to change the portrait image of the character we are talking to.

In addition, the nodes have some things they unlock when a certain dialogue node is reached. For example, one dialogue unlocks an item that the player collects right after the text is displayed. Another dialogue option increases the level of friendship with the character.
This node unlocks a memory fragment:


With the memory fragment, the player can trigger a completely new dialogue with new nodes and options the next day when the time loop is reset.

EDIT: I almost forgot to mention it. At the moment we (my partner and I) are trying to visualise the dialogues with a graph generator to make it easier to spot mistakes and track the dialogues in a similar way to Detroit: Become Human.
At the moment, the generated graph looks like this (it's a snippet and intentional that you can't read the text):

That's it for today :D
Best regards,
pixlerin
