View Single Post
Old 11-02-2012, 07:23 AM   #22
SlothMUD
New Member
 
Join Date: Mar 2006
Posts: 14
SlothMUD is on a distinguished road
Re: Advanced AI in MUDs

We added something similar to a chat-box a few years ago. There are still some odd conflicts it has with other mob procs, as can be seen from Kavir's response in the following thread but here is a breakdown of it:




We are extremely excited to officially announce phase one of our talking mob code. This code will make mobs respond to players using say, tell, and ask to make statements and questions in plain English. It works like this:

1. A player says something aloud in presence of a mob
usually in the form of a greeting, such as "Hi <mobname>" or "Hey <mobname"
2. The mob decides if it's being addressed
3. If yes, the mob translates what the player says to one of a long list of possible things a player might say, like "how are you?" or "where is <person>?".
4. Custom code generates the best response . Each question has many logical responses, such as "East", "Never heard of him" or "That's you."
5. Grammar generator creates a unique phrasing, so the mob might actually say "I think he lives to the east of here." or "I heard he was off to the east." It's quite possible to ask the very same question ten times in a row and get ten different answers.


We have put in some careful checking so that the mob can decide whether you are talking to it or to someone else, so it shouldn't butt into conversations between players.


The greatest aspect of this code is that the majority of the information that can be garnered from talking to mobs can be directly used inside of SlothMUD. Currently, new players to our game will get the most out of this feature but we are busy adding information that our veteran players will be able to use as well. We believe a few shining examples of the usefulness of this can be found in everyday questions that our players hear on gossip, such as “where can I get some water?”, or “can I get some food around here?”, or "where can I rent?". These questions can now be asked to creatures throughout the game and they will helpfully point the way, sometimes even giving you exact directions to the very location you need to travel! **** off the wrong creatures with meaningless gibberish and you are likely to be killed!


This feature has been tied to our history database which tracks every mob and player’s movement throughout the game so questions such as “Have you seen Splork?” could possibly generate responses such as “He left a few minutes ago.” Or “He was just here a second ago.”

All said in done, this code can probably answer in the upwards of one thousand game related questions currently and we are expanding it every few weeks. One nice aspect of the code is that when speaking with a mob, a player can verse a question or statement in a variety of ways and the creature will normally gather the correct information and help direct the player correctly. An example of this would be a player mentioning that they are hungry or asking where they can buy food, the creature will get the basic idea of the question and direct the player accordingly.

This project has been in the works for nearly four years, with the initial emails regarding the topic originating on May 9th, 2006. Kjartan spearheaded the idea behind and developed the engine for which it runs on. The project consists of two separate but equally important parts: the code and the grammar files the code calls upon. This project involved a great deal of Immortal involvement but most notably besides Kjartan were Clink and Juggleblood on grammar, and Splork and Isabo with the code.



We have thoroughly tested this feature and it has been on the live machine for nearly three months now, though not widely announced. However, with any project of this magnitude, we do realize there will be some kinks to iron out. Please add any bugs that you may find to the bugs list and we will address them as quickly as possible. Hopefully, you will find this feature as interesting as we do.

An example of a brief conversation:
You say 'hi mayor'

The mayor of Lyme says 'It is a joy to see you.'

You say 'how are you today?'

The mayor of Lyme says 'I feel tired and all used up.'

You say 'im sorry to hear that'
You say 'do you know where the mage guild is?'

The mayor of Lyme says 'From here you walk south til you come to Statue.'
The mayor of Lyme says 'After that you go due east until you reach Entrance to Pleasure Gardens.'
The mayor of Lyme says 'And then go a short way north to High Street.'
The mayor of Lyme says 'Then head a smidge east to Guild of Mages.'

You say 'thank you'

The mayor of Lyme says 'Glad to help.'

You say 'im hungry'

The mayor of Lyme says 'You may obtain food nearby.'
The mayor of Lyme says 'First you go south til you come to Statue.'
The mayor of Lyme says 'After that you go east until you get to Entrance to Pleasure Gardens.'
The mayor of Lyme says 'Go north til High Street.'
The mayor of Lyme says 'That's the second such place.'
The mayor of Lyme says 'Finally, head a short distance west to Provisioner.'

You say 'bye mayor'

The mayor of Lyme says 'May the gods smile upon you.'

Enjoy,
Splork





The project was a huge undertaking and took the majority of our staff to help in one aspect or another. Here is phase 1 website which shows the basic path we chose to accomplish it from 2006, we have since moved the project to our Immortal website and have hundreds of questions coded, of course they can sit there and chat regarding nothing also:



Each question has a responding grammar file and a custom coded function. Some functions, such as those which require directions could be used to answer more than one question, such as " where can I find the warrior guild?" or "where can I find water?".

It is not perfect buts something we have never seen before on a MUD, especially since it can be used for specific things inside our our game.
SlothMUD is offline   Reply With Quote