Building a versatile dialogue and interaction system
The most important thing in a good graphic adventure is, of course, the dialogues and story. When designing Duck in Town interaction system, we had clear what features were absolutely needed:
- Conversation between 2 or more characters, names included
- Ability to give objects to NPC or use objects on top of another
- Branching dialogues that affect the progress of the story
- Different dialogues depending on the status of the story
The first thing we decided was which software we should use to write the actual dialogues. We needed a visual representation of the branching, as well as easy editing and organizing. Of course, it should also be open source. The first option was, of course, Twine. However, we also knew Yarn, which adds some nice features to Twine, such as dialogue testing and BBCode buttons. So we decided to use it.
Since this software just outputs a text file, we needed to implement a parser. We only use basic features of it (we don't use it's integrated scripting, nor inline options or tags). Also, we added a first line on top of every node that shows the name of the character talking. You can check (and use, under GPL3) the parser's code in the repo.
After this, we needed to integrate it in Godot. We created a class (using the new class_name feature in Godot 3.1) called "InteractiveObject". This script is assigned to every interactive object in the game world (NPCs and items). It has inside callbacks for every action that they might perform. This allows to trigger virtually any effect that might be needed (starting a dialogue, giving the player an object, playing a sound, etc). To do this, we only need to override the callbacks with the desired behaviour.
This script is assigned and overriden by every interactive object in the world. After this, the last thing we need is a way to actually find InteractiveObjects around the player. For this, we assign an area of interaction to each object, which is found when the player enters it. With all this information, we can fill the action list.
This allows us to have a versatile dialogue and interaction systems, that covers all the needs we listed before and also is easily expandable. Remember that you can check the complete implementation in the source code repository.
Until now we've only shown the zone outside Town's wall, but Town scene is almost finished and we will show it soon!
Get Duck in Town - A Rising Knight
Duck in Town - A Rising Knight
Discover the mysteries of Town and help Duckson in his quest to become a real Duck Knight!
Status | In development |
Author | Papaya Games |
Genre | Adventure, Puzzle |
Tags | 3D, Comedy, Cute, Episodic, Funny, Medieval, Narrative, Point & Click, Story Rich |
Languages | English, Spanish; Castilian |
Accessibility | Color-blind friendly, Subtitles |
More posts
- Duck in Town - A Rising Knight is OUT NOW!!Sep 30, 2019
- Press kit for Duck in Town - A Rising KnightSep 30, 2019
- We finally have a launch date: September 30th!Aug 30, 2019
- How to make an stylized fire shaderAug 15, 2019
- Trailer + Main artwork!!Aug 09, 2019
- Explaining the game's licenseApr 01, 2019
- Screenshot saturday: discover Town!Mar 30, 2019
- Blazing-fast rendering with a single material per sceneMar 27, 2019
- Writing a one-line cel shaderMar 25, 2019
Leave a comment
Log in with itch.io to leave a comment.