Archived

This topic is now archived and is closed to further replies.

chuawenching

Interact with an AI in the game!

Recommended Posts

chuawenching    122
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

Share this post


Link to post
Share on other sites
fractoid    703
Expert system? Elizabot? Scripted conversation with selectable responses rather than freeform responses? Finite state machine?

Anything but a neural net.

Share this post


Link to post
Share on other sites
kapru    100
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

Share this post


Link to post
Share on other sites
chuawenching    122
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.

Share this post


Link to post
Share on other sites
Predictor    198
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


Share this post


Link to post
Share on other sites
ghost007    139
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.

Share this post


Link to post
Share on other sites