Sign in to follow this  
James Watson

How would you implement/model a dialog generator/machine?

Recommended Posts

Suppose player has a party of characters with him and you as game designer and programmer want to make dialog generator that generates nonscripted dialogs among them and among them and the player so that it provides some level of richness of dialog outcomes.

 

Party members have access to game state and are able to express their opinions about it (if that's important) also they have some personal characteristics that determines how and in what fashion they react.

 

How would you approach this problem if you were the one to implement general structure of such interaction (in JS or pseudocode)?

Is there an example of such problem being examined somewhere in the Internet wilds?

 

Thank you for your answers.

Edited by James Watson

Share this post


Link to post
Share on other sites

i assume you're talking about "color" or "filler" dialog, as opposed to gameplay dialog choices. IE comments like "hey look - a cave, wonder whats inside?" or "i've never seen anything like THAT before!"

 

basically, you'll have some number of phrases that can be said, then select which one (if any) is used based on the charter's personality and whats going on in the game.

 

so what you'd end up with was some code that mapped a combo of personality traits and game states to a specific phrase or perhaps a phrase chosen at random from some subset of phrases( so the same character doesn't always say the same thing under the same circumstances every time). this could be as simple as lookup tables.

Edited by Norman Barrows

Share this post


Link to post
Share on other sites
Fundamentally you need three things:

- A gigantic pool of pre-written dialogue to choose from
- A system in the game for asking to play dialogue at appropriate times (i.e. "it's a good time to say something about X!")
- A set of rules for suppressing dialogue when it is inappropriate


There are many options for doing this. One is to organize your dialogue lines into groups and sort them by "most generic" to "most specific." For example:

1. "Wow!"
2. "Look at that!"
3. "Check out that area!"
4. "Let's see what's in that cave!"
5. "Careful, that's the pirate cave!"

Then you add more tags to each line to describe when the line is useful to say:

1. [interesting]
2. [interesting] [visible]
3. [interesting] [visible] [location]
4. [interesting] [visible] [location] [cave]
5. [interesting] [visible] [location] [cave] [pirates]

Now all you have to do is have game rules trigger dialogue. A dead-simple example would be to fire a line when you enter a radius of a tagged area or object.

So if you enter a radius and there's two tagged objects, one that's a pirate cave and one that's just a parrot.

Search the dialogue database for the most specific thing you can comment on, based on how many tags it matches from the objects.

The parrot will be ignored, and the pirate cave (which matches many tags) will be remarked upon.

Last but not least, you need things like cooldowns per line (e.g. don't say this more than once, or more than once every 5 minutes, or whatever).

You also need things like "inappropriate situation" tags so you can set up idle dialogue not to play in the middle of combat, for example.

Share this post


Link to post
Share on other sites

This to me sounds like a loaded question.  In the simplest form, having a character be aware of state or state values helps.  Then again, one could spread that two all sorts of factors and have dialog and events in-game that affect your own factors.  Then calculate the difference between your characters values and another's to determine how liked one is.

 

The option I was toying with at one point was to use a mix of D&D and Sims style systems.  Characters have a few core values (up to designers) and dialog chains (state chains) like in Mass Effect and TellTale's would affect your own values. These can be written with value checks to determine which ones you get. Then during certain situations you can throw a solver in there to determine a forking path for those characters in the story.  Do they stay with you?  Do they resent you?  Do they adore you?  Or are they secretly plotting to kill you?

 

Once you know the values, you can RNG the shit out of it.

 

This could also be used to allow one access to shops that only the undesirable are allowed, or access to the castle of kings because of your renown.

 

I never fleshed it out other than through console code, but I think it's worth pursuing.

Share this post


Link to post
Share on other sites

There are many options for doing this. One is to organize your dialogue lines into groups and sort them by "most generic" to "most specific." [...] Now all you have to do is have game rules trigger dialogue.

 

Valve did a presentation on this called "AI-Driven Dynamic Dialog" and everyone acted like they'd invented this amazingly complex technique. Personally I think it's quite obvious, but hey, Valve.

 

If using text output (rather than voice acting) you can get more mileage out of such a system if there are parameters in the patterns; so instead of "Check out that area!" you could have "Check out that {location.name}".

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this