A young man living in a small colony on Mars tries to find his place in a society without a history.

Post news Report RSS Update: Dialogue System

There's now a working dialogue system in the game! You can run up to an NPC and if he has something to say, a circle appears above his head. As you get closer, the circle gets bigger, then shows a button prompt and if you get even closer a description of the action.

Posted by on

UPDATE 04

This week I fixed some bugs with the color shader and now it works much better. A lot of times it would fail completely and just draw the default color, which resulted in many clones. The only problem I still couldn't fix is that there's one head that has 4 different colors (all other heads have less) for the skin, the hair and a baseball cap. Somehow the skin doesn't work properly and flickers randomly. I have no idea what causes this, but I assume it has to do with the shader itself.

Apart from that there's now a working dialogue system in the game! You can run up to an NPC and if he has something to say, a circle appears above his head. As you get closer, the circle gets bigger, then shows a button prompt and if you get even closer a description of the action. I really enjoyed coding this, as I love UI stuff that's responsive to the player. The hardest part was getting the relative coordinates of the NPC position, as the GUI layer in Game Maker has its own coordinates system. This wouldn't be so bad if there wasn't also rotation to take into the equation. Luckily I found a blog post that had a good solution.
Here's the effect I just described:

User Posted Image

Next I implemented a dialogue system. It starts with a little camera rotation to ensure both characters are visible and then it shows the dialog in speech bubbles. At first it was pretty primitive with almost static bubbles. Btw. I bought the text effects on the Game Maker Marketplace.

User Posted Image

The tuning of the speech bubbles took a lot of time. I wanted them to always fit the length of the text, so that it gets bigger for long text or even decrease its width when there's not enough text to fill a line. The code is pretty messy, but now it works and I'll leave it at that for now. I think, next I start putting some ideas for characters and the story on paper. I often think about it, but rarely write it down. I haven't decided yet how much I will be sharing of the story progression, but I'll be working on new scenes and voxel models as well to have some variety.

Here's how dialogues could look like in the final version of the game. I tried to hint to some characters I have in mind, but this is very WIP and everything might change.

User Posted Image


Thanks for reading! :)

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: