Dialog
How we communicate in our games.
Dialog boxes
Aug 1
There is only so much you can plan and think about something before you actually do the thing… and I’ve been thinking about this a lot. Dialog… it’s how us game developers can talk to our players. I dont want voice acting so this is the avenue my characters will be communicating. This will be exposition. This will be connection. One of the ways my players will be immersed in the game.
So I’ve been thinking about it a lot.. but it’s time to start doing the damn thing.
Part 2
A raging headache won’t stop me from staring at a screen all day.
I’ve arrived at a decent point. Spent more time making it look nice than actually adding good functionality. Cart before the horse and all that.
Part 3
Good morning. I spent yesterday adding text and boxes, positioning them, and making them dynamic so no matter how big or small your screen is it will resize accordingly. However, a text box does not a dialog system make.
I was thinking about how I would tackle adding my dialog to the game and the closest thing I could think of to start was add it to the stack… and you know what? Out of all the options I know of, that’s a pretty decent answer.. but I don’t want to just stick with what I know and use the game stack every time a problem comes up. The stack makes sense for parts of the game that aren’t related to each other. The title screen. The Home Screen. The gameplay, the options menu. Those are relatively independent from each other. So when I add the dialog as just another state. Im saying that the dialog is somehow separate from the gameplay… which it isn’t. On top of that. I want to be able to control the camera and characters in the future for better dialog and also cutscenes, and it’s difficult to do that with the state system I have right now.. so…
Create a new type of sub state where it accesses the state before it? Making it inter connected? Add new variables to game objects saying what to not update when the dialog is active? Like I see a lot of games where there idle animations (or any animation) is still active but they dont move around. Almost like the game is paused but there is still life.
So this is my conclusion.
I have some boxes, text, and dialog on the screen. But it feels hollow. And I know I can do better. There is a difference between something looking good and something feeling good under the hood. This is my main priority. Create something that feels good to work with and scale. I know there’s something out there. I just need to find it and figure out the right questions to ask.
How to make a dialog box vs how to make a dialog system/architecture
Good enough until its not good enough. Then make it good enough again. And my threshold for ‘good enough’ has been changing over the years and it’s making my life a lot easier.
Todo: Separate string into an array of strings to flip through like pages Turn array of strings into array of objects {line, name, image? } Animate string Figure out how to inject it appropriately into the game and trigger it while having access to camera etc Gather all the links for references and resources I’ve used (a lot)
Night thoughts.
What sucks is this doesn’t feel like an ‘aha’ moment the way learning about game states was. Learning about game states was such a rush. I could understand it. I saw a new way at looking at things and although it was a little tricky to implement the first time, it was pretty clear cut about what it does, how to add it and the benifits were amazing.
This doesnt feel that way… this feels like a square peg that kind of fits in a round hole. And maybe this solution is getting somewhere good. But im feeling a little weary about it and its scalability and reusability. And basic understanding. Im worried. It just doesnt feel like I’m on the other side of this challenge yet and maybe I never will be.
My fear is adding complexity to my game that makes it more difficult to work with and expand on. Not easier. I just want some conformation about this path :,( and maybe I’ll get that from someone later. And maybe now I just wont get that. Hopefully I write it in a way that is easy to transport in the future to a better home. Thats it. This game is a little crab. Make it in such a way that is relatively easy to upgrade in the future.
I might not know the solution I “want’ now but I can at least make the current solution in a way that is hot swapable in the future.
What do I WANT
- A dialog system that can have a decent camera control of 3d space and the ability to control objects in the background. Like characters
Cut scenes might be a different thing but they feel like relatively similar. So I’ll say what I want with that too.
Ways to pause the game while having the ability to control characters and objects (cutscenes) Pause movement but keep idle animations going???
I think thats what I want out of my dialog…
Should I have a dialog controller that is always existing or should it be a class stack that is popped on and off…
Now for the GUI
Another Part
Ok did more work. This is a beast.
I cobbled up a buggy animated text box, and cleaned up an refactored the previous things I worked on in this post. In art, you need to move things over if they are painted in the wrong spot.. you would like to not put it in the wrong spot in the first place, but you get better at not having to move things, by moving them… that’s what I need to get better at. Feeling ok with moving things.. this is not the end of my dialog box.. this is the beginning. And it will be funky in the beginning. A nice funky smell… then you smooth out some kinks. Then you try out more things and try some things again.. fun things will come out of it but so will some dark and dirty parts. But thats it. Thats creation… keep creating. Keep going down the wrong path… because it’s for you to choose what is right and wrong.. easier to know whats right the more wrong you experience.
So my dialog box
It should be broken down into smaller bits.
Like a dialog class It should hold dialog!!!! Which holds a text box…
Which holds a container with padding And a text class. Basically a list of text
Break these things down so it’s much easier to adjust all the pieces
Once all these pieces are separated, it will be easier to know what functions and variables go where… wow how fun… this is really turning into something fun and beautiful… I should use godot after this. Im just making an engine at this point…
So the bugs.. so many bugs.
Animating has bugs.
Loading the text has bugs
Splitting the buggy loaded text has bugs
Maybe splitting these will help clean up bugs, no?… cool.
I think after I get my dialog box working and add some dialog to the beginning and end of the game scene to communicate with the player, I will put a pin in this project to move over to godot. This has been an amazing experience and I think the next step is to move over to a game engine where I can communicate with other developers to start working on teams.
Another Part
This part of the game has been quite a challenge. I’m noticing myself thinking a lot about the future. And not a lot about where I want the game to go. Because im building my game with classes and components the future should have a decent time updating my game in a way that suites me better. I just dont know what that is yet. I think I’m trying to do to many things at once and its causeing a blockage. So many hypotheticals. So many what ifs? So many worries. Why cant you just make a V1 dialog box.. you can/ and the rest will follow. Youre building a game right now.. the game comes first no?
What does my game need right now and how can it grow in the future? It can grow. Adding and adjusting something later is a lot better than adding nothing now
Hardcoded can turn into stored dynamic data. Using my version one cutscene to say some simple dialog to my player is more than enough to get started adding character and emotion to my game…
What my characters say matter more than how its said. V 1 gives my characters a voice. And we can add onto that and iterate over it.
Final chapter
So i think i did it. Or actually… i did it.
I made a dialog system… it’s clunky. It needs a lot of work… but I did it.
I spent so much time worrying about the best way to build it. One that works seamlessly with the 3d world, controlling the camera… elaborate scenes moving characters around… but at the end of the day…. Thats not what im doing right now. And i trust myself to do more digging to find that better way while i tackle what I actually need to do right now.. which is getting some text on the board. Learning when to move forward with limited information trusting that the rest will fall into place when the time comes. That takes trust and a leap of faith. Sometimes you will have that aha moment and sometimes you just need to trust your self to keep moving forward. Today was a keep moving forward day. This limited version one cut scene dialog is enough to help me add more parts of the game and in the future. I can potentiall hot swap or build off of my V1 dialog. Hooray for V1! Hooray for iteration. My game is finally coming to life. Thanks V1. so what exactly did I do?
I added some rudamentary state to my dialog box
Active/finished
Added reference to my time delay so I can cancel it anytime i want anywhere from the class. (I love classes)
(Im starting to see how a cutscene with animations can interact with dialog boxes in the future!!!)maybe
Cleaned up the animate text function with our new state and our timeout reference.
I check if state. Is active. If it is that means the text animation is still occurring. If its active and the continue button is pressed. We set the state to finished. Cancel the time delay . Then replace the animated text with the finished text.
If the state is finished. We check the button press. This time if the button is pressed we update the dialog to the next text and start the animation all over.
This fixed a number of issues. Overlapping text delay timers combining text when you skip to the next dialog before the other is finished.
There is still a bug where the first letter is missing but we will fix that issue.
The only thing I want to add to v1 is a continue finish text on the bottom right to let the user know they can continue the convo or finish it. Promting the user to press the button again.
What to add in the future? A name and a profile pic.
This is pretty cool. This gives me a direct line to communicate with the user. Now i just need to add a simple game to work out some kinks. And some debug tools to help out with that.
Maybe in the future my gamescene can have its own states. Like playing vs cutscenes. And my cutscenes can use my dialog boxes!!!!!!!!!! Wait this is pretty cool. Then my dialog boxes can finish and my cutscene state can go back to playing the game and controlling the ship/ wow this is all coming together……. Woahh..am i inventing this????
This is my first. Game… and i have learned quite a lot… ugh my brain hurts.