Improving NPC Dialog:

Started by The Crazy Animal, Feb 22, 2006, 10:55 PM

Previous topic - Next topic

The Crazy Animal

There are a few ways that we could improve basic dialog and at the same time provide discrete methods of locking and unlocking dialog related content.

What is needed for this in terms of game engine programming:

A Dialog Engine would need to be built that is able to filter data based on three impendent data sets. The general game engine would also need to require NPCs to request a cluster of PC related data when a player greets or asks a NPC about something. What this would do is enable NPCs to seem like they are aware of the PC?s attributes and general condition.
Secondly, each player would need to have a dynamic list of who they have meet in terms of NPCs. This would allow the NPC to appear to remember a PC and not treat them as if they have never talked before.

Now In the dialog data you would have a primary filter that gets used for sorting who can say what. What this allows is for dialog to be automated, shared by similar npcs as well as related to location, fraction membership, class and other similar groupings. This makes it so that you get the most use out of a single line of dialog that you want with out having to repeat the line over and over in messages.

Each of the following dialog data sets would relate to information in the NPC data tables and would represent the first set of filters that dialog has to pass through:

Example dialog data:
Dialog number: #
Dialog type: # ?greeting = 1, topic = 2?
Topic Name: ?only used with dialog type 2?
Message: ?Message Text?
Textblock: ?This field would be for script effects.?
NPC Filter information:
NPC Number: ?Filter dialog to a single NPC?
NPC Gender: ?Filter dialog by a NPC?s gender?
NPC Race:  ?Filter dialog to be used only by a single NPC race.?
NPC Class: ?Filter dialog to be used only by a single class of NPC?
NPC Faction: ?Filters dialog to be spoken by a NPC in this faction
NPC Faction Rank: ?Filters dialog to a single faction ranking?
PC Faction: "Filters dialog against a PCs Fraction"
PC Rank: "Filters dialog against a PCs Fraction ranking"
Location Filter: ?filters dialog to an area range?
Map number: #
MIN/MAX Room number: # Room number: #
PC Conditions: Each of the pc conditions relate to the query able fields I mentioned?
There?s many more available than this but here are some examples of PC conditions:
Function: Condition: Variable
Random100 ?=, <,>,= >,= <?, # - ?checks against a random number generator?
Gender, =, # ?1 = true, 0 = false? ?checks players gender?
Level, ?=, <,>,= >,= <?, # - ?checks players level?

Now this would allow for very rich dialog that any NPC could speak provided it matched the conditions. For this to work well there should be a large number of PC conditions that can be used also: Class, Race, Level, Gender, Faction, Fraction Rank, Faction Enemies, Faction Friends, General Alignment, PC Worn Item Total Value, player stats, known NPC are just the basic ones. Then each of the data sets listed above would pass through a basic dialog engine filter to further filter what is appropriate for a NPC to say to a PC when interacting.

Also with this type of dialog engine, there are two types of dialog; greetings would be said first, and topic would be used for all other dialog. When you ask an NPC about some thing, they would automatically check the all of the available topics for a dialog line with a matching topic name and then speak the first one that matches all the conditions. This allows dialog to be imputed with out having match message numbers and allows the dialog to flow more naturally. NPCs can then also respond to you differently as your character progresses through the game.

Secondly, this allows you to ask someone about a topic to try to get an answer rather then pick the bold words out of a paragraph. Some examples:

Examples of what this is capable of:
You get to a new town and walk up to a ranger.
You ask ranger ?dangerous creatures.?
The ranger replies with some dialog about the local creatures in that area.
You walk into a different town and walk up to a different ranger.
You ask ranger ?dangerous creatures.?
The ranger replies with a different dialog about the local creatures in that area.
Since the ranger knows, his location now he can responds with the correct information. Topics can have the same name but use the location filter so that the same question in a different area might yield a different answer.

You walk up to a priest and ask about his class, not only could he tell you about the priestly class but also as tell you the key differences between your class and his class. This would be using an example of using a PC Condition to determine an appropriate response.

You are wounded and go looking for a healer. You walk into the healer for the first time and greet her. Normally in MMUD you would just get some basic text saying ask about the services if you need help. However, with this dialog engine when you greet a healer when wounded the healer could query against your current health tell that you are injured and tell you about his services rather then you having to ask. Then when you greet the healer when not wounded the healer would respond differently.

When greeting a NPC of the same Faction as your self they could offer information not available to non-faction members. Further the information could vary based on your or the NPC?s faction rating.

By having a player keep a list of known NPCs would allow you to track how often a PC interacts with a NPC. Using this feature, you could have quests unlocked after a set number of meetings or after a set number of meetings and provided, the player meets the rest of the requirements. Secondly, this would allow NPCs to act as if they remember a player so when greeting a shop owner or a guild leader for the 100th time they might respond by using your name. Some thing like Nice to see you again ?player name? how can I help you today. This type of greeting could progress with the number of interaction with the NPC increase.

What do you think?
?I already know I?m crazy so you don?t have to inform me about that?

TCA

One last thing - You could keep the old dialog functions in and just provide a switch to enable the use of this so that it wouldn?t screw with any legacy functionality.


DeathCow

What function is this providing that isn't allowed currently?  I know the currently textblock system is a little confusing...but..it can do all of that..i think..it is post bar time..but......am i missing something?

The Crazy Animal

#2
Ya you missed a few things the most basic being what the textblock system doesn't do is allow you to not need you to link from one topic to the next with this its all done with filters. Second depending on the NPC filter options you set this would automatically give any new NPCs of that filter set the dialog lines previously coded in while still allowing that new NPC to have its own lines too.

For example:
If you have a generic NPC ranger in the game and an named NPC ranger the named NPC ranger would inherit all the generic NPC ranger dialog as well as having its individual lines. Doing this wouldn't take any additional dialog programing. The only thing that it would take is a class slot in the monster data that would need to be set to ranger. The dialog engine would then handle all of the filtering and assign the lines appropriately.

One of the big ones is that it can use real logic in the PC condition filter rather than just true false tests. If in the textblock you wanted to test if a persons agility was above 50 it would take one test for each value above 50 up till the max agil. With this you would just use equal to or greater than in the test and would take a nice chunck of programing out.

One of the biggest benifits actually comes out of viewing the data in this format because you can instantly tell who uses the dialog lines.

If you want to know more let me know.

TCA