Week 8: New Abilities Unlocked: FileReader and Scene Manager
April 21, 2024
Hello and welcome to week 8 of my senior project! In this post, I will continue talking about my progress with the dialogue system as well as the side-scrolling mechanism. Additionally, I will discuss the different scenes that I have implemented and plan to implement.
Instant, Typewriter, and Fade
As I discussed in the previous post, my dialogue system has three text display/build methods: instant, typewriter, and fade. I have finally finished implementing all of them and this is what they currently look like.
Instant | typewriter |
fade |
For the typewriter and fade display methods, they also have a 3-click system; essentially, on the first click the next line of text displays, on the second click the speed that the text displays increases, and on the third click, the rest of text instant displays on the screen.
Beyond just displaying the next line of text, the dialogue system also has the ability to append text to an existing line. This allows me to display the next line on the screen while the previous line is still displayed. Again, I referenced Stellar Studio’s “Make a Visual Novel in Unity 2023” videos to understand how to do this.
Reading Files and Parsing Dialogue
One of the most crucial abilities that our dialogue system needs is reading and parsing text files. For the dialogue system that I am implementing, I currently have two ways for the system to read and access files: either as a text file or as a text asset. The text file reader uses the file location and a stream reader to read lines, while the text asset loads the text file and uses a string reader to read lines.
Another thing I implemented in the dialogue system is a parser. This parser essentially separates the speaker, dialogue, and commands in each line of the text file. By doing so, it allows me to change the visuals on screen and display certain things based on the commands.
Scroller
This week, I also managed to finish the camera scrolling aspect of the side-scroller. It essentially just takes the position of the player and changes the value according to that. To prevent the camera from moving off screen when the player moves to the edges of the scene, I used a clamp which essentially limits the value that can be given for the camera’s x value.
Beyond getting the camera to follow the player, I also finished setting up most of the visual components of the scene. I also added a secondary scene for the side-scroller as the character enters the tunnel. I will talk more about the different scenes in the next section but here’s how it looks currently.
Scene Manager
As you may recall from the week 5 senior project post, I briefly mentioned the scene manager. To recap, the scene manager contains all of the functions for changing to certain scenes and this class can be referenced through the scene change prefab. As of right now, the game has 5 scenes in total:
An opening scene | A dialogue scene |
Two scenes for the side scroller | |
And a defeat scene |
Most of the scenes have triggers or buttons to move from one another, but i am still working on incorporating the dialogue scene and adjusting some of the button functions.
Leveling Up and Moving On
That’s pretty much all I completed this week! I hope you enjoyed seeing the dialogue system in action as well as the various scenes I have in the game currently. Moving on to next week, I plan to finish up the parser and display systems for the dialogue system, as well as, setting up and configuring the different obstacles that our main character will have to face in combat. See you next week!
References
“Make a Visual Novel in Unity 2023.” Youtube, uploaded by Stellar Studio, 27 Jan. 2023, youtube.com/playlist?list=PLGSox0FgA5B58Ki4t4VqAPDycEpmkBd0i&si=eN64qJUApQ61-4rc.
Reader Interactions
Comments
Leave a Reply
You must be logged in to post a comment.
Cindy L. says
Haha, the Bee Movie script in the dialogue test…. But besides that, I love how your game looks so far! All the different scenes look really nice. Good luck with continuing your dialogue system and working on obstacles!