Go Back   EQEmulator Home > EQEmulator Forums > Misc > Misc::Off Topic

Misc::Off Topic Want to talk about something that has nothing to do with EverQuest or the emulator? Post here.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-14-2009, 02:04 AM
Deimos
Hill Giant
 
Join Date: Jun 2004
Posts: 135
Default Programming AI

Hey all : D.

I've been really looking into AI recently and well, I thought it'd be neat to take a shot at doing an AI Engine (text parsing and what not). Because PERL is also the bomb at doing text parsing, I'd probably use PERL. There is still a chance I'll use C++ though ^_^, oh wells ;p.

So, let's move on to the AI. When I think of AI, I really start thinking of a text parser. Sure, you can get words out of text and so on, but how can you read these words? Have a million if statements based on context? Sub routines? O-o. In reality, you pretty much have to teach the NPC English (or w/e you're writing it for). This means you pretty much have a dictionary and you have the rules of grammar in there. From here, you have instructions on how to treat nouns, pronouns, verbs, etc, this way the NPC knows how to treat them, and if they are special things like I, me, you, and what not, then you have instructions for the NPC on each of those (the most basic of the basic, yes, there are various forms of you, but you only need one of them).

From here, you could actually get the NPC to deal with various ground objects to (for example, if the player is standing next to a chair), and you can add in coords for things like caves and what not. The real hard part I suppose is programming the initial instructions and storing it uniquly for the AI. The next hard part would be adding in various factors which change how they actually talk and respond to these various events (for example, the culture they've come from, their various personality traits, their IQ, what they already know, and so on).

I just really do find it interesting, and I know it's possible. In fact, I might even make a test AI on an EQEMu server and have people talk to it and what not for fun ^_^. If it works out, I could easily make more (tweaking their IQ and what not to make all of them unique) and populate the entire world with smart NPCs : P.

Oh well, what do you guys think?

Also, try posting some ideas on what instructions might be used and how things might be stored. Currently, for storage I'm considering just using a text file for each NPC (like an object) because it's very easy to store an entire NPC and retrieve it. Storing the stuff in SQL would be a hassle and could actually be much slower :\.

So what are your thoughts and ideas? : D.

Btw, I'd use a current AI thing, but I'm not impressed with any of them at all :\. They're not designed the way I'd do it (they're a bit unnatural too because saying the same thing over and over to them will yield the same response over and over again). They need to simulate some sort of emotion and memory ><.
__________________
//The Path of Chaos Server-
//Fate Industries
//Lots of stuff O-o
Reply With Quote
  #2  
Old 01-14-2009, 06:57 PM
bristle
Sarnak
 
Join Date: Jan 2009
Location: san jose, ca
Posts: 44
Default

it seems interesting that AI people (game people) dont do any of this.

i would chose something like python, ironpython, or even c#. the opensim is in c# so that is one reason. i the end it doesnt make a difference in what you use since you interface through an npc channel anyway. it just like your people, but not really your people. there server all ready has enough to do without worrying about npcs.

if you bring it out from the server, then you can make one of a kind or groups. personally, i would like to see groups like a troll manager or something like that.

+++

i would like to set a bot language evolve. then going from A to B pick you butt and going back to A would work about anywhere.
Reply With Quote
  #3  
Old 01-15-2009, 02:49 PM
Kobaz
Hill Giant
 
Join Date: Nov 2008
Location: Gold Coast, Oz
Posts: 119
Default

Getting this stuff to work well is hard. The fact that the contexts should be limited by being in a game will help though.

Typically these sorts of processors are done as Markov chains. This is why they eventually start to repeat themselves. I remember hearing a conference presentation where a researcher was using genetic algorithms to produce dynamic transition matrices to get more natural responses from a bot. I can't recall the guy's name (it was 17 years ago) but he was relying on the idea that the human response should relate to what the bot said if what the bot said made sense. The correlation between responses adjusted the weights in the matrix.
Reply With Quote
  #4  
Old 01-15-2009, 09:12 PM
bristle
Sarnak
 
Join Date: Jan 2009
Location: san jose, ca
Posts: 44
Default

i have had a interest going way back to before microcomputers. but i never went anywhere with it.

i think a.l.i.c.e may be the way to go. i have seen some bots in second life and i believe that are a.l.i.c.e based. of course they cant see so they are limited. i also ran across http://http://www.personalityforge.com/. once again, it is web base.

anyway, there are already things that people can use (even MUDs).
Reply With Quote
  #5  
Old 01-16-2009, 12:29 PM
Deimos
Hill Giant
 
Join Date: Jun 2004
Posts: 135
Default

as I said, I've seen those and I think they're done wrong :p

oh well, half the fun is designing it too ^^

But, those bots have screwy short term and long term memories ><

They also repeat because they don't know that repeating isn't good in most cases.

Another thing is they can't deal with hypothetical scenarios ^^.

And finally, if you give them a word they don't know but you use it in the context of a sentence, they have no idea what the word is, even with the given context, and they'll just go off topic :\.

Example:
I have 9 yuloaifs and I use them to buy things in a market.
Ok.

Do you know what a yuloaif is?
I was hoping you could tell me.

Deduce it on your own.
I'm afraid I don't have those capabilities (or something like that).

Even I, the lowly programmer, knows how to put deduction and reasoning into a bot ><.

If these bots had deduction/reasoning along with a good short term and long term memory (which makes it so they don't repeat so often), then they'd make good bots ^_^.

Since they don't, I'd rather make my own.

And I thought it'd be fun to have a thread to discuss programming AI to see what ideas people had concerning AI :p.

Also, Alice uses pre-programmed responses. An AI should look through a variety of words to make their own response. This is yet another problem.
__________________
//The Path of Chaos Server-
//Fate Industries
//Lots of stuff O-o
Reply With Quote
  #6  
Old 01-16-2009, 03:40 PM
Kobaz
Hill Giant
 
Join Date: Nov 2008
Location: Gold Coast, Oz
Posts: 119
Default

I used to work in a related field (hence being at conferences etc). Issues I recall are:

Some (human) languages have grammars that are purely positional. In those it is much easier to deduce what is the object and what is the subject. English is not one of those languages. This is why it's so easy to make alice produce gibberish.

There are a lot of people working on "context free grammars", particularly those working on the so-called "semantic web". If you can map human language to a CFG then it's much easier to deduce appropriate responses, and to elicit definitions of new terms (like yuloaifs) in interesting ways.

There is a base vocabulary of around 200 words that should be enough to establish the grammatical basis of an expression.

Human language is inherently fractal, in that each clause and sub-clause can be expanded into a phrase that defines it. The problem is that these in turn can be expanded. For example, "water ski" -> (liquid state of H2O) (horizontal slat that is placed on sole of foot for sliding over low friction surfaces) OR (act of sliding over a low friction surface, that being) (liquid state of H2O) -> ((fluid that is not a gas) (energy dependent phase of matter) (substance: H2O) ) ((plane perpendicular to the direction of gravitational field)( thin section of solid substance in form of rectangular prism) (verb: suppositional) (base surface of) (extremity of lower limb) (preposition: purpose of) (moving tangentially with minimal friction) (qualitative comparison: low) (heat producing force opposing direction of motion)) -> etc.
Reply With Quote
  #7  
Old 01-20-2009, 08:50 PM
bristle
Sarnak
 
Join Date: Jan 2009
Location: san jose, ca
Posts: 44
Default

well i hope i can get some ai gone at Mischief i have some tools and things that may help but at first i will have mobs just walking around. that will be enough.

they have some bots projects at second life that feels like EQ -- at least in part. once again, they are using web-based stuff to do that. i want to have npcs that learn and that mean keeping the sims online at least some of the time. i have some stuff in c# but i need to see if it does anything. and of course a robot walk in c# for an example but that is far from doing anytime.

i have stuff at sim and mischief with mischief more for ai. if anyone want to, he can register at the site and we can figure out what we need. i tried this a few years ago but didnt get anyone involved in it.

the thing is the ai could be for anything just like we do as real people. we had model of MUDs, some of the stuff was great. but now most of it has been forgotten.
Reply With Quote
  #8  
Old 01-23-2009, 01:54 AM
Deimos
Hill Giant
 
Join Date: Jun 2004
Posts: 135
Default

Well, I just thought of something rather interesting. You can't have true AI with current programming languages because these languages can't be written in real time (they have predefined commands and operations).

An AI needs to be able to manipulate anything about itself in real time (this includes its very foundations as well), otherwise it'll be nothing more than a very nice looking robot : p.

So, perhaps before creating this AI I write a language that has the ability to write anything in real time O_o, from commands to operations to w/e.

While commands like C++ look powerful, they still have their flaws... They can't dynamically generate a function (not written anywhere) and add it to itself. Until a programming language that can do that is devised, true AI will be impossible. Sure, we can write programs right now with current technology and languages that act exactly like real people, but they won't have true AI. They'll just be mimics. True AI must have the ability to write its own programming... Just like humans... we have the ability to program any part of ourselves to do something. When we do this, that something acts before we can even think about it. A great example would be me with guitar hero. I've gone through a song while thinking about something else entirely. I don't even pay attention to it, my hands just do it on their own (you can imagine how long I played it for for that to start happening though O_o), but the facts are still clear... any sentient being has the ability to reprogram itself in any way that being sees fit.

With current technology, a programming language like this is impossible though. When dealing with things like this, there is no true or false... It would have to work on an entirely different system.

So I guess my objective of writing a true AI Engine would be impossible right now : (... But I suppose I could write a language that would dynamically add functions and what not to itself in real time and use that for the AI engine. That'd be a start. It still wouldn't be true AI though because its very base would still be based off of binary...

Oh well : ).

Before writing this language, I'm going to do some research to see if someone already wrote a language like this or not : ). It has to be low level (cannot be a scripting language) :\.
__________________
//The Path of Chaos Server-
//Fate Industries
//Lots of stuff O-o
Reply With Quote
  #9  
Old 01-23-2009, 02:20 AM
Deimos
Hill Giant
 
Join Date: Jun 2004
Posts: 135
Default

Please disregard my last post.

After doing some research, it appears that using a high level language would be the best way to write an AI Engine (more specifically PERL or Lisp).

I'm researching their speeds now... heh... yes, we're already using PERL (feels kind of.. er..) heh
__________________
//The Path of Chaos Server-
//Fate Industries
//Lots of stuff O-o
Reply With Quote
  #10  
Old 01-23-2009, 05:02 PM
Kobaz
Hill Giant
 
Join Date: Nov 2008
Location: Gold Coast, Oz
Posts: 119
Default

LISP, Perl and Smalltalk are all reflective languages that do what you need. I have to admit that I like Smalltalk, but the learning curve is weird, as it's not like anything else. Check out Squeak at squeak.org, and don't worry about being totally confused by it at first.

A lot of language based AI research was done in LISP. I think it was invented for it. Massive learning curve, as it's also totally unlike anything else.

The catch with using Perl is that large perl programs can easily become unreadable unless you really work at keeping them maintainable. Perl has had some performance issues with it's psuedo OO features - this may be less of an issue with perl 6 onwards, as I haven't kept up to date with it.

In my work (a long time ago) I used a special purpose language called CELLANG to generate the cellular automata core (in C), then added sockets to that (reading generated code is not fun as variable names are not people friendly and there are massive tables of pointers to things that you have to touch), and had that talking to perl programs that managed the genetic algorithm code that modified the weights and rules of the automata, the perl in turn called small C programs that handled changes to rules for the mobile agents.

As long as you stay in the core of perl performance can be quite good. I believe that lisp can be very fast.

Runtime speed is not great with smalltalk. This is offset by the quite incredible efficiency with which you can program in it - quite sophisticated programs can be done in very few lines, and because everything is live code the debug cycle is very efficient.
Reply With Quote
  #11  
Old 01-23-2009, 05:28 PM
Kobaz
Hill Giant
 
Join Date: Nov 2008
Location: Gold Coast, Oz
Posts: 119
Default

And your thoughts of designing a language are probably a good idea, even if you don't implement it. The exercise of designing a "script language" that can be proven to do what you want will reveal exactly what you need. You might find there are slabs of code out there already that do a lot of the lower level stuff. For Debian there is cl-aima for example.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:39 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3