Dialogue and Sound System Rework


For this post, I wanted to talk about some of the differences between the old dialogue and sound systems and why we decided to rework them.

Dialogue System:

Originally,   the dialogue system operated by reading through a text document that contained all of the dialogue for the floor. In addition, we used regex to parse the document when we wanted to do something like have the player make a choice. While this did work, there were several issues.

  1. Un-encrypted documents: The dialogue wasn't secure because it was stored in a text file. After building the project, you could easily go into the files and change the text in the document, which would often cause issues with the game when it tried to read the modified file. In addition, we didn't want players to be able to change the in-game dialogue.
  2. No easy way to different quests: Because all of the dialogue for the floor was stored in one file, the only way to differentiate between different sets of dialogue in a floor (For example, the starting dialogue, side quest, and boss dialogue in floor 1) was to hard-code which lines the system would need to look at in the file. While this did work, it could break everything if even a small change was made to the dialogue without updating the code in the dialogue system, and it was almost guaranteed to break if a completely new dialogue was added.
  3. No support for other features: The final issue we had with the system was that there wasn't much we could do with it besides reading lines and dialogue options. So if we wanted to do something such as play sound, or have characters move around on screen, we would have to make a separate system for that.

For these reasons (and a few others), we decided to make a new dialogue system that solves all of these issues. The new system instead uses an enum with various arrays, so that they are compiled into bytecode when building the project. Not only is this more secure, it also makes it easier to have multiple sets of dialogue on a floor without having to update the code each time. In addition, we implemented a new command system that allows the dialogue system to interact with other systems, so that we can do the things mentioned in point 3. For a list of all of the features of the dialogue system, you can check out this post.


Sound System:

The other system that was updated, the sound system, was updated for similar reasons. All of the sounds were hard-coded into the system, which made adding new sounds a pain. In addition, because parts of the system were static, it often caused issues when trying to integrate it with other systems, such as the dialogue system. The new system is a lot more dynamic, allowing sounds to be more dynamically added as well as adding features its predecessor lacked, such as allowing other systems to pause and play sounds, as well as the ability to change the sounds generated by the player's movement (ie. different walking sounds depending on the surface you are on, and attack sounds changing depending on your weapon/ability).


I plan on doing a few more updates to finalize both systems and then the quest system will be next!

Get The Eternal Guest

Leave a comment

Log in with itch.io to leave a comment.