Week 9: Parsing Dialogue
April 28, 2024
Hello and welcome back to another week of Designing Themedior: Game Mechanics and Puzzles! This week, I made some progress with the dialogue system as well as some mechanics and graphics within the side-scroller. I will be discussing that along with how I will be moving forward next week with this operation.
Dialogue Parser and How It Works
As I mentioned in the previous post, I have been working on a dialogue parser to separate the speaker, dialogue, and commands in the text files.
The format I have the lines written in is shown below.
Speaker “quote here” commands(argument)
How it works is that it first takes a line and finds the start and end of the dialogue based on where the quotation marks are located. Then using Regex, I specify a command pattern and find matches in the line. Lastly, I find the speaker based on the dialogue start/end and command start. In order that it doesn’t flag quotations in the dialogue as the start/end, I check for whether or not the quotation is escaped.
An issue that may come up is if the dialogue has quotes in it.
To check if a quotation is located within the dialogue, I check if it is escaped. When writing strings in C#, in order to use special characters such as “, you need to put two backslashes in front of it to signify that it is part of the string. Using this, I can make sure that it is actually the end of the quote or if it’s just a quotation within the dialogue.
Here’s how it looks:
Mechanics and Graphics
For both the main scene and the tunnel scene in the side-scroller, I added some extra graphics and animations for some detail. Additionally, in the tunnel scene I set up some obstacles that our main character will need to jump over in order to get through.
Into the Future
For the following week, I plan to finish the dialogue system, as well as getting the enemy placement done. I’m also gonna try to finish up the functionality on the buttons in the dialogue scene and begin working on separating the dialogue into different scenes. I’ll see you next week for more updates on this operation!
References
“Make a Visual Novel in Unity 2023.” Youtube, uploaded by Stellar Studio, 27 Jan. 2023, youtube.com/playlist?list=PLGSox0FgA5B58Ki4t4VqAPDycEpmkBd0i&si=eN64qJUApQ61-4rc.
Leave a Reply
You must be logged in to post a comment.