Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Artificial Intelligence?  (Read 2701 times)

0 Members and 1 Guest are viewing this topic.

fabiobasile

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 74
    • View Profile
    • my brand new website!!
Artificial Intelligence?
« on: August 19, 2006, 11:13:48 PM »

Is there a way so simulate a VERY basic type of A.I. conversation with an NPC? I think it's possible to have the NPC spit out random responses, but i wonder if there is a way to have the NPC respond to certain questions in certain ways so as to make the interaction a little more realistic.

In my game for example i would like to have my character doing random conversation with NPC's, until i manage to have the NPC pronounce a certain word or phrase and that would trigger an event.

For example:

Me: how's it going Granpa?

NPC: I'm good

Me: So... can i have some money?

NPC: Oh my... NO!

Me: pleeeeeease....

NPC: Stop pestering me

Me: pleeeeeease....

NPC: Stop pestering me

Me: Can i have your fake teeth?

NPC: Ok here you go but don't run with them!!

(At this point granpa's teeth appear in the inventory)


Ok i am not going to actually have my character sway an old man out of his fake teeth,  ::) that's gross. Really i swear. >:D

I really hope there is a way to implement something like that in my game, it would be the greatest thing! :)
Logged
What would i do with a million dollar? I'd give it to what's left of Black Isle/Interplay and tell them to finish the damn game!!!

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Artificial Intelligence?
« Reply #1 on: August 20, 2006, 08:57:38 AM »

You mean the player will be able to type the question? In that case you'd probably have to implement some ELIZA style artificial stupidity, that would check players responses for certain keywords and react appropriately.
Something like:

[code]
// get players line somehow, possibily by using some GUI window with editor
var PlayersLine = Editor.Text;
...
var TestStr = new String(PlayersLine);
// convert to lower case for easier testing
TestStr = TestStr.ToLowerCase();

// check for keywords
if(TestStr.IndexOf("please") >= 0) NPC.Talk("Stop pestering me.");
else if(TestStr.IndexOf("money") >= 0) NPC.Talk("I'm not giving you any money.");
else if(TestStr.IndexOf("fake teeth") >= 0)
{
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

fabiobasile

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 74
    • View Profile
    • my brand new website!!
Re: Artificial Intelligence?
« Reply #2 on: August 20, 2006, 07:05:54 PM »

Quote
You mean the player will be able to type the question?

Well... nah, that would be too complicated, my idea would still contemplate a selectable set of responses from a menu, the difference would be that for each response i click there would be at least three different responses that the NPC will be able to choose from and reply me with.

something like:

Me: "Can i play with your dentures?"

GrannyNPC:
                      random response #1. "No! Go bother the neighbor's dog!"
                      random response #2. "Bring me a glass of rum first!" ---> expected rum glass by NPC
                      random response #3. "Here you go, don't run with it!" ---> dentures appear in inventory

Me (to response #1): nothing to do, select alternate response from the menu
Me (to response #2): "Ok, (if i have the rum in the inventory) here is the rum!" ---> dentures appear in inventory
Me (to response #3): Thank you! (dentures appeared in the inventory when granpa picked response #3)
Logged
What would i do with a million dollar? I'd give it to what's left of Black Isle/Interplay and tell them to finish the damn game!!!
 

Page created in 0.047 seconds with 20 queries.