The markdown-based dialogue system


Well, now it's time to do the script for the game. I must admit that I had better do it in the beginning. In my case, the script is a thread on which all the other components of the game are strung. The script allows you to plan new ones and throw out unnecessary mechanics. In my game the game provided a lot of dialogues and needed a system.

I turned for help to my playwright friend. She helped me tidy up the main line and also agreed to write dialogues for the characters. Writing dialogues is her profile, but in the game it is not a flat plot, as it is a theatrical play. The tree of dialogues was new to her and I began to think about how to make her job easier. There are many editors that allow you to create a dialog tree, pass parameters, variables. But I wanted a simple solution.

And then I mentioned the githab and its wiki. What if you write everything right there. Answer options are links to other pages. Markdown allows you to do formatting, insert images. So we wrote a number of dialogues. It turned out to be convenient for the playwright, but not for me.


Here you can see this method in action: https://github.com/Syopic/markdownBasedDialogues/wiki

Before using md files for dialogs, I tested their readability in my project. I found a library to work with the format (https://github.com/HaxeFoundation/haxe-markdown ) and expanded it a bit for my needs. Everything worked fine, but the md files in the wiki are stored under long strange names. Some kind of system was needed. I threw the files into the project, opened in VSCode and was pleasantly surprised - the editor highlights the syntax and, even more pleasant - makes a preview for them. The links work great. Simple HTML tags are also supported here, and this allows you to color the text, for example. Quickly, I figured out how to prescribe links and insert images so that they were easy to parse inside the game.


Link to md file: https://raw.githubusercontent.com/Syopic/markdownBasedDialogues/master/Event_1.m... 

gif: https://twitter.com/i/status/1300448195139571713

Everything works fine, but there is one moment left. How to persuade a playwright to work in VSCode)

This is the basic system. For RPG it will be necessary to refine it, to add an opportunity to change the course of dialogue from certain parameters. I will definitely update the article when I finish this system.

Leave a comment

Log in with itch.io to leave a comment.