Interact with an AI in the game!

Started by
5 comments, last by chuawenching 20 years ago
Just say i had an online mmorpg game. There is 1 blacksmith. Blacksmith>> Welcome to Blacksmith, what do you want to buy? me>> (there will be a textbox for me to enter) me>> I want to buy axe (rather than selecting options, this allows better interaction between me and the NPC) Blacksmith>> Ok, i will show you the list of axe. The blacksmith knows how to filter unnecessary keywords. Actually what type of AI concept should i used to code that kind of AI? Any guidelines please? Thanks. Regards, Chua Wen Ching
Regards,Chua Wen Ching :p
Advertisement
Expert system? Elizabot? Scripted conversation with selectable responses rather than freeform responses? Finite state machine?

Anything but a neural net.
How bout searching the text for key words that the black smith has been programmed to know. Then search for verbs. Reassemble the sentance in the right order using only the key words and verbs.

eg.
"I would like to buy a small axe and 2 swords"
this would become
"buy small axe and 2 sword"
this could then be interpereted as
buy(axe,small,1)
buy(sword,normal,2)

buy(Product type , Product Sub Catagory, number of items)

the and tells the interperter to use the last verb

not sure how well this would work just something id been thinking about for desiging a NPC and can have a 1/2 decient non scripted conversation
This thread could be of interest to you:
http://gamedev.net/community/forums/topic.asp?topic_id=214853

[edited by - kevmo on March 22, 2004 9:48:33 PM]
I know how to do basic script engine (entering arguments).

But again, thanks for the tips.

eg.
"I would like to buy a small axe and 2 swords"
this would become
"buy small axe and 2 sword"
this could then be interpereted as
buy(axe,small,1)
buy(sword,normal,2)
--> Looking for something similar to this.

Any example source code.. maybe i can look into...

Hehe!

buy(axe,small,1)
buy(sword,normal,2)

buy(Product type , Product Sub Catagory, number of items)
--> Do you think i need any special language like lisp or prolog?

Thanks again.

Regards,Chua Wen Ching :p
quote:Original post by fractoid
Expert system? Elizabot? Scripted conversation with selectable responses rather than freeform responses? Finite state machine?



Can you sketch out how you''d use a finite state machine to solve this problem?

-Predictor
http://will.dwinnell.com


I don''t think FSMs will help much here, since the user can go way off on a tangent from buying weapons to asking for quests simply by changing their query.

As Kapru mentioned, the best way to do this is to search for words in a phrase, then use those words to predict the output. Things like buy, want, purchase, give, take, etc. would imply the user is reaching out for something. You would also group words up together with literals like and, or, maybe, compare, difference, etc... These would help define if you’re dealing with two transactions or queries to be answered.

As far as source code goes, I''ve never done this. In my opinion, the best way to do this would be to fill up some vectors. One vector contains a list of purchasing commands, another contains literals, and so forth. As you cycle through each word in the phrase, you do a check in the vectors to see where it belongs. Once found, you form a new sentence (one that will filter out the garbage) and tag the word belonging to which category. From here, your sentence parser will have to analyze the new phrase by having a pre-defined set of actions for a set of words.

This topic is closed to new replies.

Advertisement