Pre announcement - Unity Dialogue Engine

Hi all.

I have been busy creating a Dialogue engine for Unity and it is virtually complete so I figured it is time to make everyone aware of what is coming. So here are the details…

The dialogue engine works with a custom scripted dialogue file. It used to use a very condensed form but it looked rather confusing so I modified the format to include a lot more typing, but making it a hundred times easier to understand and use. So much so that once you get the hang of it, you will pluck out TextEdit to do your dialogue files in no time.

You are not limited to doing only dialogues, b.t.w. You can also use this exact same engine to inspect objects. You are free to create a separate file for each object in your word or you can simply create a single file with descriptions for multiple items as easily as copying and pasting the script code.

What makes this engine really amazing is that you need only drag a single script onto each model you want to inspect or interact with, enter the name of the dialogue file to use and the id of the description to show and you are done. You can literally make any object in your world become interactive in a matter of seconds.

Want to make an object a pickup? Create the dialogue file, drop the script on it and you are done. Use the same script for multiple items and you have made a world of pickups in only 1 script file…

Now, when you want to speak to main characters, this is where the fun begins… The Unity Dialogue Engine remembers interactions with characters!

Imagine this situation:

  1. When you first speak to a character, that character asks you who you are. At some point the character offers you a mission which you have the option of taking or declining.
  2. On subsequent conversations with that same character, it will remember wether you have declined the mission and how many times you have done so and start the conversation differently depending on which.
  3. If you have declined the mission three times, his dialogue changes to never offer you the mission ever again.
  4. In contrast, if you did accept it, the dialogue will change to him welcoming you back and then asks you if you have retrieved the object in question.
  5. If you hand him the item, he takes it out of your inventory and rewards you with gold. From this point on, his dialogue is also different whenever you speak to him.
  6. As an added bonus, if you offered him a false item three times, he revokes your mission, brands you as a liar and has a very aggressive attitude whenever you speak to him in future… he might even attack and send you into battle mode if you have one…

All this is done in the dialogue file so once this is done, you can give this kind of interaction to any character in your game simply by dragging a single script onto the character and specifying the name of the dialogue file…

As an added feature, the dialogue object also makes external calls to your game object so you can key any behavior into your objects simply by saying in your dialogue file when to send what message and then making sure you have setup a script that handles that message.

Do you want to make your characters SPEAK their dialogue? Simply send the message. Do you want to play a SFX at a certain point? No problem…

This means that any object can be interacted with right out of the dialogue. For example, imagine a gate keeper. You can inspect the game keeper and receive some info on what he does or who he is. You also have the ability to speak to him/ her and have him/ her explain to you what you have to do to pass. You then also have the option to interact with the gate keeper. At this point, the gate keeper will see wether you qualify to pass and then either tell you that you have not yet met the requirements to pass or will open the door for you so you can pass…

So this far we have:

  1. A dialogue system that remembers past interactions with objects.
  2. A system for inspecting objects in the game world
  3. A system that allows for pickups or collectables
  4. A dialogue system that allows for interaction with the game world from right out of the dialogue itself…
  5. And I don’t know if you’ve picked up on what I said before, but you also get an inventory system for free. :slight_smile:

I reckon there are 3 questions on your mind at this point:

  1. How hard is it to learn the dialogue scripting language so you can make your own dialogues?
  2. With different requirements of different games, how will this information be displayed on-screen?
  3. How much will this system cost?

Well, to answer the first question, if you are completely daft, the script format will take you about 5 minutes to learn. For the rest of you, you could probably learn it in under a minute. I have make it THAT simple. But, nice guy that I am, I have also created an editor extension for you to use so you can graphically create and test your dialogues right inside Unity. How nice is that? :slight_smile:

As for the second question, that is where I am at now and why the engine has not yet been released. I have put all the logic into a single script file and exposed every possible function you could possibly want in order to create your own display files. As such, you can display your dialogues on screen in absolutely any way you want. To make all of the above happen, you need only ever call 1 function: speak() (with no parameters, even) and that is it. All of the other functions are there merely for display purposes and for selecting options in dialogues. Well, speak() and openFile(filename)…

To use this engine, what you have to do is create a subclass from my script. Your script just has to handle the display of the dialogue onscreen and the Input to make selections during the dialogue. then when it is done, you simply drag YOUR file onto your objects. You never use my file directly. The single file I kept mentioning above is the subclass that handles the display of the dialogue.

Now, this could be as simple or complex as you want it to be. As part of this release, I am creating 3 or 4 vastly different display methods to meet what I believe to be the greatest demand and including that in the pack. These display files will contain everything you need to get your dialogues up and running in seconds so if you like the format I use, just use it as is and you are ready to go. If on the other hand, you want to change it, so be it… you will have enough examples of how to do so to enable you to bring to life any ideas you may have in your mind…

I want to explain to you how different these included displays will be from each other, but that will take forever and in a matter of days from now you will be able to see for yourself exactly how different they are. Who knows, perhaps you can come up with your own unique display mechanic and we can start a free display section on my website where you can upload to and download new ways of displaying your data… Or even a dedicated thread here…

Well, this is my announcement…!

The system is almost complete and will be ready as soon as I have created enough display modes to satisfy the largest number of people.

So now comes the question of how much it will cost… and that is the question I am asking you. How much do you reckon is a fair price to ask for this dialogue system? I am very eager to hear how much you would be willing to pay for this so I don’t go shooting myself in the foot asking for $10 or making you hate me for charging you $10,000 :slight_smile:

I hope this announcement has made someone very happy, today and eagerly await your feedback.


More screens to come when I get home…

P.s. As this system allows for infinite possibilities for the display, if you would like to contribute your ideas, please PM me.

I will then give you the exact list of planned interfaces that will be made available with the engine and if we don’t already have your idea in production and decide to use it then we would be willing to give you a free copy of the engine in exchange for the artwork required to visualize your idea…

Hmmm…
I create the dialogue interface according to your specs…
Consider it a bonus :slight_smile:

As it is, the interfaces are quite varied, but limited to MY imagination. I am sure someone out there must have ideas that would make mine pale in comparison…

The idea is to give users as wide a variety of interface choices as possible, which is why I am going to create the downloads section, even if only to provide updates from my own mind… :slight_smile:

So yeah, if you want to contribute, let me know :slight_smile:
Even if it doesn’t make it into the release bundle, it could still find it’s way onto the downloads section…

A really interesting product, congratulations. Keep us updated, I think it will be a great value for a lot of people (like myself).

You can check out what we did with Lies and Seductions to get some ideas. Source code is available at: http://mlab.taik.fi/~plankosk/blog/?p=308

Dialogue editor (java program) is also available at: http://mlab.taik.fi/~plankosk/blog/?p=314

Code is licensed with Apache 2.0 license, so you can use it if you find something useful (as long as original authors are credited).

Ohhh… Now this sounds interesting :slight_smile:

Will definitely have a look see :slight_smile:

Thx

p.s. I think I should also mention that when I say “virtually complete” what I mean to say is when you load a saved project, I have to extract the filename from the filepath… Then I’m done. So virtually really does mean virtually :stuck_out_tongue: Then I just have to start working on those displays… I would expect a release by around Friday or so…

Hi MrDude!

I can’t wait to try this. It seems awesome. What is it written in? I hope C# 1.1 so it’s iphone compatible.

I’d pay $100 or so.

Sounds like the bulk of the coding in my space game is handled by this - sounds amazing!

I’d certainly like to take a gander at this!

-Will

Ahhhh… positive reinforcement… Nice to know there are more people than just me out there who is interested in this :slight_smile:

To answer your question, it is written in JavaScript but it is not currently iPhone compatible. This is purely due to 2 Arrays that I still have to swop over to crDialogueKeys[ ] and crDialogueReqs[ ]. Due to the fact that I don’t put limitations on the number of keys you can modify or the number of requirements each line can have, the creation of the [ ] arrays are a bit sloppy at the moment so I stuck with Array() instead. I have, however come up with a very simple solution to this little problem so I could have this issue solved before I release it. I too am a big iPhone supporter, myself so this is a major concern for me also :slight_smile:

I will make sure to keep you up to date with the progress, yeah? :slight_smile:

I would also pay $100 for this. I am in need of one now, so as soon as it is released will make a purchase.

Video tutorial showing how to use it OR pdf manual with plenty of diagrams and steps on how to use it will also be good.

Small webdemo will be a good selling point for you.

this looks very useful; looking forward to seeing a demo!

I am soo looking forward to a Friday release, but I am thinking of delaying it just a tad so I can include enough documentation to cover any possible question.

Learning the scripting that is required is so incredibly easy that it will take you minutes to learn. Literally. In fact, I will give you a short example just now and you will agree with me that using the GUI Editor is actually more time consuming than doing it in TextEdit and i am sure that most if not all of you are going to convert to TextEdit very shortly after seeing the source…

What I want to do, though, is create a few sample scenes that demonstrate how to use the engine in different scenarios. When you see it, you will see it is incredibly simple… but oh so powerful…

As this is my first content pack that I will be releasing into a community that has treated me very well in past, I want to make sure I deliver the best I can, not just adequate…

It is for that reason that I am giving free lifetime updates as part of the unlimited use license…

Rock on everybody :slight_smile:

Here is a quick sample… I’m not even going to explain it to you because I don’t think you will need me to…

(ACTORS)
Hinata   hinata02
Naruto   Naruto06

[line] 1
[who] 0
[next]2
Hi there. Welcome to the dialogue engine

[choice] 2
[who] 1
3  Option 1
4  Option 2
-1  Quit the conversation

[line]  3
[who] 0
[next] 2
[require]  + key1 1 5  - key1 2 6
[keys]  + key1 1
See you got in this time...

[line] 4
[next] 7
[keys] + ramen 1 sound play receive
I have some Ramen for you.
I hope you enjoy it...

[line] 5
[next] 2
[keys] + key1 1
Sorry, Naruto, you can't select this option the first time around. Try again.

[line]  6
[next]  -1
Sorry Naruto, I can't speak now.
I am late for a mission...

[line] 7
[who] 1
[next] -1
[keys] Animation Naruto Victory
Yeah!

Okay, I can’t resist…

[require] lists what conditions that must be met before this dialogue line is displayed

[keys] are only awarded if requirements are met or none are specified.

Requirements are defined as follows:
[kind][name][value][redirect]
Valid kinds are + and - which translate into “Must have at least” and “must have less than” respectively

Name is the name of the key and can be anything you want.

value is the amount to test against and redirect is the id of the line to skip to if the condition is not met.

Requirements are evaluated left to right and stop as soon as one fails or all are validated.

Keys are specified as:
[kind][name][parameter]
If you specify the [kind] as + or - it updates your inventory with the relevant keys. + gives you that key and - removes it. If you have less than 1 then the key is destroyed.

[name] is the name of the key and can be anything you want.

If you use + or - as the kind of key then [value] indicates how many to give or take

If you use the custom format, then this can be whatever you need it to be. Want to play a sound? Pickup an item? Start battle mode? This is where you specify it…

Let’s say you have a single model (a crate maybe) that contains all your pickups, but each crate has a specific item inside… Let’s say you are playing Lego Starwars and collecting the various parts of a spaceship…

(actors)
Collectable crate     crate001

[line] 1
[who]  0
[next]  -1
[keys]  collect item nul
You have found the left wing...

[line] 2
[next]  -1
[keys]  collect item nul
You have found the right wing...

[line] 3
[next]  -1
[keys]  collect item nul
You have found the front of the spaceship...

[line] 4
[next]  -1
[keys]  collect item nul
You have found the tail...

[line] 5
[next]  -1
[keys]  collect item nul
You have found the seat ...

[line] 6
[next]  -1
[keys]  collect item nul
You have found the engine...

Now simply place 6 crate prefabs in the scene and make sure the prefab has the dialogue display script attached. Assign each prefab a different value under StartAt, and voila, you have 6 collectible items in your scene complete with unique descriptions…

Hiding bags of cash behind trees or barns?

(actors)
small bag  bag000
medium bag  bag001
large bag  bag002

[line] 1
[who]  0
[next]  -1
[keys] + GoldCoins 10 collect item nul
You have found 10 Gold Coins

[line] 2
[who]  1
[next]  -1
[keys] + GoldCoins 200 collect item nul
You have found 200 Gold Coins

[line] 3
[who]  2
[next]  -1
[keys] + GoldCoins 1000 collect item nul
You have found 1000 Gold Coins

Write a function to create 1000 of each prefab and scatter them at random locations and voila, you have 3000 collectible items in your game…

So let’s say you are making an RPG and have 10,000 NPCs in your kingdom, each one with only a line or two to speak.

You can create 100 different things for them to say or 10,000 different things they can say. Simply add 100 or 10,000 entries to this script file, assign each NPC a random StartAt value and voila… Instant interactive world…

Want to make the dog say “woof”?
:slight_smile:

In theory you can have as many lines as you want in a single script file so you COULD create one file for your entire game, but for neatness sake, how about this for inspiration?

NPCDialogue.txt
KingOfGondor.txt
QueenAmidala1.txt
QueenAmidala2.txt
KnightsOfRockTown.txt
NorthCntntInspctbleItms.txt
Pickups.txt

Sounds super! I could certainly pay a hundred for this :slight_smile:

Well it seems the pricing is confirmed then :slight_smile:

I was actually planning on asking $100 since it seems that is a common enough price tag for content, but wanted to get some user input first:
“Who would want to have dialogues in their game? I’d give you a dollar” or
“Wow! This would take my development time down from 1 year to 3 days. I’d pay you 10, 000!!!”

More likely, somewhere in between :stuck_out_tongue:
…but it seems everyone so far has agreed on the $100 so that is one question out of the way…

Now I just have to find a program that will allow me to capture a movie from my screen so I can make you guys that video demonstrating the use of the engine…

CamStudio should do the trick plus its free. A dialog handler is a great universal add-on. So great job with that!

I have idea for an extra add-on for you add-on lol…

How about passing variables of emotion. The emotion would then be used to alter animations of the characters (especially in the face). I guess that could already be put right into what you have now it seems. There would just need to be a side script running that would transfer emotions on to other characters they talk to and display them etc.

A game I have been planning out for a few years now is going to need a dialog engine and instead of making my own and spending time I may just spend some money and grab yours when that time comes.

Thanks for that heads up…

To answer that question, yes, you just need to add this to the dialogue under [keys]

animation play smileAnime

Then create a little script going:

switch (vals[0]):
{
case "animation":
     switch vals[1]:
     {
        case "play":
           animation.play(vals[2],playOptions);
     }
}

…not sure about the animation play syntax, but you get the idea… You can so anything you want simply by adding custom keys to the [keys] tag. I will be providing samples of this in the smaple projects to get people up to speed on this :slight_smile:

Cool, thanks Your dialog stuff will shorten the creation time of most projects I bet.

Just had a look at cam studio and it is for Windows… How sad :frowning: The search continues… :slight_smile:

edit:
Oh, what a useful link… http://www.pure-mac.com/screen.html