Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

'intelligent' conversations with npc's

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 drtremmie   Members   


Posted 23 September 1999 - 11:43 PM

i am working on a game which will require that players be able to have conversations with computer controller players via text.

i am looking to make this portion of the game rather powerful (in other words, i would like to allow the input to be simple: "Have Candle" and as complex: "Do you have any candles for sale?").

should i be looking at NLP or something else?
i am afraid that NLP routines in the game will be too resource heavy, however i would rather the immersiveness of conversations with NPCs to be deep, so i would be willing to sacrifice fancy graphics for this functionality.

has anyone else worked with this "conversational functionality" before?


#2 Anonymous Poster_Anonymous Poster_*   Guests   


Posted 13 September 1999 - 11:19 AM

Well, I havent done much work like this before, but you could check the input string for defining combinations of letters, e.g.
check string for 'have' and 'candle' would be good, but it would not solve all cases, because the user could put
'do I have a candle in my ear?'

but hopefully you could find a way around the problem...

#3 mason   Members   


Posted 13 September 1999 - 12:07 PM

I can't offer any advice, just a word of warning -

NLP routines, even at their best, are FAR from perfect.

I wouldn't be concerned so much with the execution speed of NLPs (presumeably there's nothing else going on in the game when the player's talking to an NPC?)... I'd be more concerned with the *development* speed of the routines.

Off the top of my head this doesn't sound like it'd be worth the cost. I'd seriously reconsider using NLP... there's far better things to spend time developing.

Just MHO.

Mason McCuskey
Spin Studios

#4 drtremmie   Members   


Posted 13 September 1999 - 12:23 PM

i am hoping to use the intelligent conversation routines to create depth to the game. i really feel that this is of the utmost importance.

good thing that not much else will be hitting the processor when these routines are taking place

did i forget to mention that i want each npc to also have a pluggable personality module? this personality module could (and will) effect the NLP routines (someone who hates people will certainly be less wordy).

im investigating doing this the "right way" in the hope that in that process i will find middle point that will offer enough functionality to make it into a version one with the plan being to improve upon this part in a version 2 release. with so many parts to a game, it is hard to get all of it up to par (in reference to the original design) in one release. some parts will have to suffer a featurectomy...this maybe (hopefully) will be one of those parts that gets flagged as an "improve in version 2".

i would love to see the following:

PC: "Good morning. I was hoping to ask you a question."

NPC: "Morning?! It is 11:28pm, but anyhow, what did you want to ask me?"

PC: "Do you have any candles for sale?"

NPC: "Yes, but we are closed, it is 11:30 at night afterall. Try coming back again tommorrow morning between 8:00 and 5:00."

long way to that...idea of context within conversation and humour. version 2 maybe

this brings up another question:
when working on a game with so many components, how does one prioritise and organise so as to keep from getting drowned in all of the details? project plan, aye...but that will not make approaching the game any easier. so far ive been able to decide that the graphics engine will come near the end. that leaves quite a bit of things between.


#5 MikeD   Members   


Posted 14 September 1999 - 12:19 AM

Okay, ignore people who say it can't be done or isn't worth doing.
Always aim to take games to the next step, progression is more important than the possibility of failure.

Okay, pep-talk over.

Personally I see the problem being more in the NL generation than the parsing. With parsing you can get the gist of the conversation from selected words and without full grammar. Bascially I think you have to because otherwise you'd have to deal with all the different grammatical systems everyone in the English speaking world(and beyond)uses.
If someone asks about the status of a banana in their ear then, unless they're playing sim-fetish, they're not taking it seriously.

So, language generation, well you can have a series of templates, fairly generic, to express different facts. Describing objects or their costs or their current actions (if an object was, say, an attacking orc) limited by your willingness to type in endless(ish) sentence templates.
Then you could have sets of templates for different NPC groups. Representing the grammar of different social groups.

So what was the method you were considering?

#6 Turtle   Members   


Posted 21 September 1999 - 06:28 PM

I love the idea, and would love to make one myself, but I do not have the drive to go quite that far.

Here is a way that will work very well I believe, unluckly it is very extensive on the programming end.

Basicly we learn how to structure sentences by following a bunch of rules, I believe that most grammar checkers will destructure sentences based on these rules. If I am not incorrect you could program an algorithm to detructure a sentence into the primary noun/s, the primary verb/s and the adj, adv, and prepositions. Then take these, and connect them with the item they describe as you go. This may allow you to deal with more complex sentence structures.

I want to buy a hat.

is changed to

Action: wants
What: hat
Which: unknown
How: buy

change to "I want to buy your hat.", and the which: would be NPC's

( I'd advise talking to someone that programs grammar checkers or such about this type of algorithm, because presently I believe this is the furthest area of computer science in the idea of identifing what someone is trying to say.)

I hope this helps with the first part.

As to putting in different styles of talking, and reactions to what is said. It may be possible to do this to some degree, but beyond having a few types of plugins I believe it would be far too much coding and that it would slow the game down tremendously to be sending every variable in all the talking through an improperly designed plugin.

Sorry but I believe that part is completely beyond me.

Tell the truth and you will never fear someone will figure out you lied.
<<I'm sure I'm quoting someone out there, wish I knew who!>>
David Abresch

#7 ghowland   Members   


Posted 23 September 1999 - 01:28 AM

My preferred way of doing this would be an inversed parser, there is a good article on it from Chris Crawford here:


(Actually, this article is really just a good overview for the topic, but implementation would be heavily dependent on your goals and interface anyway)

Good luck.


[This message has been edited by ghowland (edited September 23, 1999).]

#8 Sphet   Members   


Posted 23 September 1999 - 08:52 AM

I was thinking about this.

Couldn't you do some kind of matching system, where the NPCs are loaded up with strings and responses:

"Someone would like to buy a candle"
'Here is your candle'

The npc text parser would pack this down into some code you would include, but essentially it would only pack

q:"someone buy N candle"
a:"Here [is/are] your candle[s]"

Then when someone types in

"I would like to buy your candle"
"I would like to buy 2 candles"
"I would like to buy a candle from you"
"I would like to buy the candle"

You parse out the 'unimportant' words:

I buy a/your/the/N candle[s]

further parsing would equate a/your/the to 1, and strip off the [s] from candles.

Then you look for

I buy N candle

do a reverse lookup so you first match for candle, then N, then buy, and you filter out

"A would like to have a candle buy my ear"
"Buy a candle from me"
"buy a candle from the man" // its a conversation, not a text adventure game
"Put the candle buy from you in my ear"

and such.

anyways.. symbol tables etc.

Some of the scripting tutorials might give you a good idea on implementing symbol tables.

[This message has been edited by Sphet (edited September 23, 1999).]

#9 ghowland   Members   


Posted 23 September 1999 - 10:49 PM

An inversed parser would actually remove all these problems because you are feeding the user their choices. If you dont want them to use the candle with their ear, you just dont give them that as an option.

It eliminates players having to try to guess proper commands as well, as they can all be laid out in front of them through a list (or icons).


#10 Niels   Members   


Posted 23 September 1999 - 11:43 PM

Now that we are talking boolean tables and relations, I feel an urge to do a bit of advertising (feel free to skip ):

I happen to be working at a company that produce software to handle extremely large logic systems VERY fast and higly compressed (we're talking billions of combinations represented by a database in the <100K range). There's a few very small (and old) examples on our web-site www.array.dk (Yes I know, it's not pretty - a new one with larger examples will be available soon )...

The system essentially consist of a "compiler" that analyzes the complete set of variables and relations and generate a run-time database that:

1) Is guaranteed to be complete
2) Immediately gives ALL consequences to any stimuli (table-lookup speed).
3) Allow rollback to alternative solutions in case of contradiction (I.e. If you want to apply a selection that is illegal according to the current system state, the run-time system will give a complete list of the changes needed to allow the selection).
4) + a ton of other features

And a run-time part (Java or DLL) that give access to the compiled data base.

The system is defined in a simple declarative text format. Declaring each variable (of types: int, bool, string or interval + structures of these). And the relations (by equations or tables).

If you want to know more, feel free to contact us !!

Sorry for the shameless plug (No I'm not )


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.