Dialogue

The conversations are always triggered by the player engaging conversation with a NPC, or the player stepping on certain tiles. As you noticed in the monster/NPC editor above, all NPCs will have a phrase ID that points to the start of the conversation of that particular monster type.

A conversation can be seen as a large state-chart of phrases that the player visits by selecting different replies. An example of a conversation tree could be like this:

Notice how the conversation flow can return to places where it has already been, and how some conversation choices can lead to more interesting stories. This is all done in Andor’s Trail by what is aptly named phrases and replies.

To create a conversation in Andor’s Trail, you don’t have to draw a flowchart like the one above - this one is only for illustrative purposes in this tutorial.

Phrases and Replies

Looking at the flowchart above, let’s call each blue box that the NPC speaks a Phrase, and let’s call the text on each arrow a Reply. The basic structure for conversations in Andor’s Trail is that a conversation is made up of a list of these phrases, where each phrase has a list of possible replies. Each reply defines what the next phrase will be, and each phrase defines what available replies there are.

First, we assign an internal id to each phrase. It can be just about anything, as long as the id is unique over the whole game. Prefer to use the NPC’s name to make it unique, and prefer short ids in lowercase.

Let’s take one phrase from the above flowchart as an example of how just one phrase is represented:

This phrase defines three possible replies, and can be represented in the following format:

Another phrase might look like this:

Which, in turn will be represented as the following information:

By separating the phrases from the replies, the whole conversation can then be defined like this - as just the list of phrases and what replies they have. In fact, all conversations in Andor’s Trail is stored as a huge list of phrases, with info on their corresponding replies, that in turn lead to other phrases.

Special Phrases and Replies

As explained in the previous chapter, replies will lead to new phrases. In some cases, we want the something else to happen when selecting a reply, such as ending the conversation or initiating combat. For these special actions, there are some predefined phrase id:s that the replies can point to:

These special phrase ids are not actually visible in the content editor. Instead, they are added if you select anything other than “NPC phrase in the drop-down list labelled “phrase leads to”.

Also, sometimes we just want to do a chain of phrases, where an NPC can speak several phrases while the player just clicks the “Next”-button to advance conversation. This is done by creating just one reply for a phrase, and using only an upper-case N as reply text (visible in the editor by the checkbox “Phrase leads directly to another phrase without replies”).

Phrase Rewards

To create an actual quest using these conversations, we would need more things to happen other than just having the NPCs speak. For this, we introduce the concept of phrases being able to give rewards when reached. Rewards do not necessarily have to be positive of course :)

Each phrase has a list of rewards that will all be awarded as soon as the player reaches the phrase.

The possible types of rewards that a phrase can give are currently:

The most common type is of course to advance some quest for the player. Each reward will define an id and a value of the reward. The values in id and value mean different things, depending on the type of reward:

Reply Conditions

To create a complete quest, we also need some way of restricting the choices that the player can make, until some conditions have been reached. For example, the player should of course not be able to select the reply “Here is your map” while talking to Cileth until the player actually has the map itself.

For this, we use a concept of conditions that each reply might have. In order for a reply to be visible to the player, all of the conditions must be satisfied. For example, the reply “Here is your map” while talking to Cileth, might have a condition saying that the player both has to have the map in inventory, and also must have reached stage 30 of the quest (to ensure that the quest has been started).

Replies can require these types of conditions:

It is important to note that a reply will be completely hidden for the player if at least one of the conditions are not satisfied.

Advanced Special-Cases

The concept of phrases & replies is also used in Andor’s Trail to build complex conditional branching logic. Let’s look at the goblin boss monster Olgnuur’s dialogue as an example:

This is the basic conversation flow for Olgnuur. To make him use this conversation, we would put “olgnuur_1” as starting phrase in the definition of him as a monster, in the monster editor. However, consider these special cases that may occur:

  • The player might press “Leave” at any time during the conversation.

  • The player might return to speak with Olgnuur again after receiving the map.

  • The player might not have started the quest at all.

In all of these cases, if we were to start conversation at “olgnuur_1” every time, the conversation would feel really odd - Olgnuur would seem to have a really bad memory. To fix this, we need to have some way of making the conversation start at different phrases depending on what the player has done earlier.

This is done in Andor’s Trail by using a phrase that does not have any display text. For phrases that do not have display text, the game will automatically advance conversation to the first reply that has all of its reply conditions satisfied. This way, we can re-use the concept of reply conditions discussed in the previous chapters, into creating a complex quest.

We introduce one of these phrases that does not have any display text at the start of Olgnuur’s dialogue:

Notice how reply 1 goes to phrase “olgnuur_2”, which in turn will engage combat. Reply 1 will be selected if the player previously has reached quest stage 70. Reply 2 will be selected if the player has reached stage 65, by previously receiving the map from Olgnuur, and will cause Olgnuur to just say that he wants to be left alone again. Reply 3 will be selected if the player has started the quest, but has not talked to Olgnuur before, and will trigger the conversation tree started by the phrase “olgnuur_1”. The fourth reply does not have any conditions, and will be selected if neither of the other replies were selected - for example, if the player has not started the quest at all.

Note that the game selects the replies in order, and proceeds with the first one where all conditions are satisfied.

This way, by placing phrase “olgnuur” as starting phrase, we can handle all the special cases described above. The game will evaluate the phrase “olgnuur” and pick one of its replies automatically, which will make Olgnuur say different things when starting his conversation. It will seem like he has remembered previous conversations.

Cileth's Dialogue

Cileth’s conversation is left as an exercise for the reader. Consider what should happen when engaging conversation with her during the different stages of the quest. How could you make sure that Cileth only gives her reward once?

Publish

Once you have the quest ready, including the conversations, monsters and items required for it, you should be ready to publish it so that it can be included in the game. What should be posted is the exports from the content editor of the things that make up your quest; conversations, quest log, items, droplists and monsters.

The most common way of getting input is posting it on the game forums, and encouraging people to give feedback on it. You are also welcome to email it to the development team, or post your quest on Github.

We are really looking forward to reading your content! Good luck with your quest!

Last updated