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...
but hopefully you could find a way around the problem...
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
www.spin-studios.com
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.
cheers,
drtremmie
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?
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
Subject:player
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
http://www.erasmatazz.com/library/JCGD_Volume_6/Inverse_Parser.html
(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.
-Geoff
[This message has been edited by ghowland (edited September 23, 1999).]
Couldn't you do some kind of matching system, where the NPCs are loaded up with strings and responses:
q:
"Someone would like to buy a candle"
a:
'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"<P>Then when someone types in<P>"I would like to buy your candle"<BR>"I would like to buy 2 candles"<BR>"I would like to buy a candle from you"<BR>"I would like to buy the candle"<P>You parse out the 'unimportant' words:<P>I buy a/your/the/<I>N</I> candle<P>further parsing would equate a/your/the to 1, and strip off the from candles.<P>Then you look for<P>I buy <I>N</I> candle<P>do a reverse lookup so you first match for candle, then <I>N</I>, then buy, and you filter out<P>"A would like to have a candle buy my ear"<BR>"Buy a candle from me"<BR>"buy a candle from the man" // its a conversation, not a text adventure game<BR>"Put the candle buy from you in my ear"<P>and such.<P>anyways.. symbol tables etc.<P>Some of the scripting tutorials might give you a good idea on implementing symbol tables.<p>[This message has been edited by Sphet (edited September 23, 1999).]
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).
-Geoff
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?
cheers,
drtremmie
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 )
/NJ