When you’re building a game solo, it’s easy to get pulled in every direction: art, story, gameplay systems. But eventually, something has to come first. Since Evenrift is a narrative-driven RPG, I decided to start with one of the core features: dialogue.
I already had the basics set up in Godot. My character could run around, NPCs were placed in the scene, and I had basic collisions working. The next logical step? Giving those NPCs something to say. If players are meant to explore the world through conversation, I needed to bring those interactions to life.
So I started building a custom dialogue system. It’s simple, modular, and lightweight enough for any beginner using Godot. Now that it’s working, I’m making it available for download for free (a small donation to support the development of Evenrift would be appreciated though!), including the .tscn
scene, textbox.gd
script, Dialogue_Manager.gd
, and a sample JSON structure and a working NPC script with an example NPC scene (npc.tscn) – to help speed up your own game dev journey. It’s available at the bottom of this article for a small donation if you’d like to use it in your own project. Whether you’re just starting out or looking for a jumpstart on your own dialogue system, I hope this devlog helps.
Starting with the Dialogue Box Scene
To kick things off, I followed this great tutorial by Jon Topielski. There are a bunch of different ways people implement dialogue boxes in Godot, but I liked this approach because:
I didn’t need to create or find a premade asset (except for a font file, which I found on this great site called pentacom.jp).
It was quick to get started, I could build everything directly in the editor.
It gave me full control over design elements like font, color, and borders.
I found it easier to scale visually across different screen sizes.
The tutorial is a little out of date now (I’m using the latest Godot version), so a few settings like text wrapping and font size are in slightly different places. But overall, the approach still works great.
The textbox.gd
Script
Once I had the visual part done, I wrote a script to handle showing and hiding the textbox, writing out the text, and managing player input.
Here’s a breakdown of how it works (without dumping full code in here):
show_text(text: String)
– Activates the dialogue box and begins displaying the text.hide_text()
– Hides the box when there’s nothing left to say.process_text()
– Manages the typing effect or instantly displays the full line on key press._input()
– Listens for player input to move to the next line.
This script is designed to be reused. I can plug it into any scene where dialogue is needed and control it externally using my Dialogue Manager (more on that below).
The Dialogue Manager (Global Singleton)
Next, I needed a way to load and manage actual dialogue. I didn’t want to hardcode text into every NPC scene, especially since Evenrift will have branching storylines and changing dialogue based on where you are in the game.
So I created a Dialogue Manager - a simple script that loads dialogue from external JSON files and tracks what’s being said.
Loads dialogue from a JSON file
Dialogue is structured by NPC name and story stage (e.g.blacksmith + chapter_1
), which keeps it modular.Tracks conversation progress
It remembers how many lines each conversation has and which one the player is on.Interfaces with the textbox
It passes the correct line of dialogue to thetextbox.gd
script when triggered.Set as Autoload
This makes the Dialogue Manager globally accessible, so it works across scenes - handy for cutscenes, NPCs, or environmental triggers.
The NPC System
To tie everything together, I built an npc.gd
script that detects when the player is in range, flips the NPC to face them, and triggers dialogue. It pulls the appropriate lines from the Dialogue Manager and feeds them to the textbox.
I also created npc.tscn
, a ready-made NPC scene with everything pre-wired, a sprite, chat detection Area2D
, and the npc.gd
script attached. This way, you can just drop the NPC into your world and test it right away.
Where This Is Going
Right now, the system is basic but works. It’s enough to:
Trigger conversations with NPCs
Display a sequence of lines
Set up dialogue that changes depending on the story chapter
Eventually, I want to add things like:
Portraits and name boxes
Branching dialogue paths
Player dialogue choices
Dialogue that influences the story
Download My Dialogue System
If you’re just starting out in Godot and want a simple dialogue system to learn from or build on, I’m making mine available for free, but I’d massively appreciate a small donation to support the development of Evenrift. Anything helps!
Included files:
textbox.tscn
textbox.gd
Dialogue_Manager.gd
Sample dialogue JSON structure
npc_example.tscn
npc_example.gd
Readme.txt
Important note: This system is meant to be a starting point. I recommend having a basic understanding of Godot and GDScript before using it, as you’ll likely need to make small changes to fit your own game’s structure and logic.