LISA Theory 1: Monkey Hear, Monkey Say

Posted by Carlos508 on Nov. 3, 2008, 7:35 a.m.

TODO for Today:

[X] Speech module - Have LISA say her first words. Oh how cute :p

[X] Simple Feedback module - Have LISA give simple feedback. Ow that hurts. Wait, never mind.

[X] Setup Module System - LISA is useless by herself. Keep it that way!

Speech Module

[10:28PM]

After hours of scouring the net (ok 20 minutes) I figured out that GM doesn't have native SAPI calls (text-to-speech). So I found a couple .gex and .dlls on the yoyogames forum but couldn't find one I needed. Don't get me wrong, they work, but when the app closes GameMaker locks in the background and I couldn't bother with it. So I'll need to use VBScripting for the time being, as creating a SAPI DLL in .net that'll work with GameMaker will be a huge pain in the

But anyways, LISA did say her first words. Works like a charm. I figure just another day of coding and I'll have the Input/Response module running. If all goes to plan, it'll function just as well as most ChatBot programs out there using this unique system of mine (which I'll talk more about some other time). Meaning, you'll be able to have a limited conversation with her, but she won't understand anything. It'll be, basically, a series of If…Else, only without the If and the Else. Like I said, I'll let you in on the secret some other time.

Fortunately, I already coded the "Response Editor" in Vb.net, which allows you to enter in a couple words, and LISA displays thousands of possible, correct, combinations using a unique en/decryption algorithm.

Oh yea, and its been 7-8 hours without turning LISA off. Gotta love that "execute_file()".

Setup Module System

[3:20PM]

I tell you, I'm starting to love Game Maker. Because of the module system I'm using, you're able to update code WHILE its running. In fact, I haven't stopped running LISA since around 2, and yet I'm still modifying her code. Very sweet. The only thing about releasing this that I'm cautious about is the fact that it's still in the early phases, but we'll see. I might just release the program later when it's actually something worth using…

[2:13PM]

Wow, the module system was so easy to do I'm afraid of getting negative comments for it! Basically, I'm using Game Maker simply as the platform for LISA. This means that all the code is external, stored in .txt files for easy access, and the exe is basically a blank GM .exe.

This is great however, as it will eventually make things easier for me to allow LISA to "code herself". We'll see how things turn up.

[12pm]

Alrighty phew classes are over. Anyways, while I was in my trig class, we where discussing the Sine Laws and I figured out a method to solve the triangles in an easier way, and some ignorant dude blurts out "Psh, you're stupid." Being in the military, and an amatuer weight lifter who just came from the gym an hour prior, I was pumped and my first thought was to flip the desk, take off my belt, tie a grappling hook to the end of it, don a yellow mask and yell out "Get Over Here!". Roid rush? Possible, but I'm against that. Felt good though.

It's funny, I heard two or three chicks go "Oh shyt, its going down". LOL, but I'm actually a calm person, and remembering what I wrote earlier this morning in this post, I just said "Go screw yourself". Sorta just came out. Anyways so the professor, ingeniously, asks us to both work out a very complex problem. Using my substituion method I solved it in about 30 seconds, he still barely started. Funny.

Anyways, enough with the rant. The real reason I told the story is because it gave me an idea. I don't know if it was all the adrenaline rushing or what, but I figured that the substituion method I used to solve triangles can be and should be applied to LISA.

It works like this, you have the main problem…find the angle of theta. At your disposal you have several trig functions and their identities: Sine, Cosine, and Tangent. These functions work like GM scripts, and the trig ID's are the linker files which allow certain scripts to work together irrespective of who or what created them.

In short, I figured out a way to allow LISA to be so completely modular, that I could release the LISA exe right now, and never have to worry about uploading an update. Simply copy/paste the code into a .mod or .txt file, and LISA gets some added functionality.

I mean, it's actually nothing amazing, but we'll see what I can come up with tonight. This is all done in GM, and I'll be releasing it open source.

***

LISA Theory 1: Monkey Hear, Monkey Say

Alrighty, this is going to be a lengthy post, but there's a lot to learn here about AI. Anyways, AI is composed of many MANY areas of study, ranging from things like chess playing

programs, including (click the image to test out each from your browser):

* Chess AI

- Each line is drawn individually in REALTIME to demonstrate the thinking path of the computer.

* A* Path finding AI

- I'm sure you're all familiar with the concepts of A* Path finding. It's used often in games to find out the quickest paths, although it's not entirely restricted to games.

* Evolution http://home.pacbell.net/s-max/scott/weasel.html - This one, called the weasel is a pretty effective demonstration over other evolution because of the implementation of AI. Not as flashy as Spore, but helps you to understand the meaning easier.

* Chatbot Tech - That's George from jabberwocky who won the prize I'm after next year, the Loebner Prize. He looks like a Pedo and sometimes asks strange, sexual questions…I don't know…

And what do they all have in common? They aren't true AI. The closest one to AI would be the Chess AI mentioned above, because the program requires thinking, and it plans ahead. Something which is necessary to have true Artificial Intelligence. It isn't enough to mimic thought, you actually need to set goals and strategic thoughts in order to pass as off as intelligent.

And that brings me to the title of my post - Monkey Hear, Monkey Say. What does this mean? Well, for one, any monkey can repeat what you tell it (actually, if you find one that can, let me know!). LISA is initially a Chatbot like the last example above. She can respond to input given to her. Of course, the question arises, "Well, they just use a bunch of If…Else statements don't they?". For the most part, yes. And that's why I don't consider it AI, there give me a cookie.

But in all seriousness…in order to progress through any artificial intelligent program, you need the bot to give you some kind of feedback, else how would you know what it's thinking right? If you look around, all the intelligent things on earth share one thing…communication. Complex communication at that. Sure a male peacock communicates with females through its tail, but a dolphin communicates through a complex language of squeaks and maneuvers to trap prey. Monkeys communicate through complex facial expressions, and African bonobo chimps communicate through sex…lot's and lot's of sex.

The first step in developing language, is to first talk with predefined phrases, that way at least the [eventual] AI unit can communicate with the user. And although the AI may not know how to say it or why, it says it either way. The next stage after that would be to help the AI learn to understand the input.

How am I going to achieve this? Like everything else, use predefined commands/logic. If I tell the computer, "Hey you're pretty stupid you know that?", the computer will look up the words in a custom built dictionary. This is a special dictionary, though,

one that contains the definition, but also the relationship to other words, frequency of usage, probability of appearing before/after certain words, etc (this is before it understands grammar, an even more difficult challenge).

When she looks up the word "you" or "you're", LISA will understand that the user is refering to LISA itself. "Pretty" follows, and at this stage LISA might think you're referring to her as pretty. But wait, she'll then look up the word "stupid" and realize

that it has a 95% chance of being an offensive word (just pulling numbers out of my ass here, but bear with me). Now, she looks for what stupid, a noun, is referencing to. Now all of a sudden LISA isn't pretty any more, she's pretty stupid. Lo and Behold, she understands you're referring to LISA as stupid. "Go screw yourself" follows.

But this is where it gets interesting. I never told LISA to respond with "Go screw yourself". In fact, I never even gave her any responses. She constructed the response herself, using a backward logic flow similar to what she used to decipher the input. Because she understands you insulted her, LISA will has two options; Be passive or be aggressive. Because you might have a history of being rude to LISA, she chooses to be aggressive. She doesn't understand what aggressive means at this point, she just understands its one of two options she can take (each option assigned certain values like the dictionary).

So, she has several more options. You always allow AI to have as many options as possible (within reason) to allow it to think outside the box. LISA chooses to use a direct attack. She understands (because I programmed it) that 80% of the time one uses "you" they are referencing directly to you/he/she/whatever. So she looks up words that are preprogrammed (defined) to refer directly to someone/thing. She selects the words (you, you're, yourself) and selects a comeback response. Looking through her history of Q&A, she notices that screw you is often times used as a comeback - 30%. If she didn't have a comeback ready, or didn't know how to respond, then she could always look up the input online. She then analyzes the responses (another challenge ahead of me) and selects the best one.

But the key thing in all of this is that you MUST start small, simple, and completely unintelligently. You wouldn't go straight into building an F1 turbo car if you haven't yet discovered the wheel! First develop the wheel, then the chariot, etc until you eventually develop whatever your goal is. And that's what LISA is trying [going] to achieve, true artificial intelligence from simple unintelligent means.

What, in GameMaker? Yes.

Comments

PY 15 years, 6 months ago

Dude, you rock :)

If the *cough* ADMIN *cough*, Ludamad, ever sees this, I can imagine him being really interested. He probably won't, though :((

TDOT 15 years, 6 months ago

That was an awesome read. AI has always fascinated me. Can't wait to see LISA's progress!

Juju 15 years, 6 months ago

Yay! Another 64D deep thinker.

Carlos508 15 years, 6 months ago

Thanks guys.

@PY - lol thanks man.

@TDOT - I'm glad. I'm going to be releasing the project open source sometime this week. Now that I developed my Module System, the need to update the core .exe file will become nill. Basically, LISA becomes her own "Engine" with just a few lines of code via procedural methods. Fortunately, the fact LISA is not super intensive cancles out the fact that external script calling is slow. Well, actually she is, but I'll be explaining more on that some other day.

But anyways in short, I've commented every line I've written so it should be pretty easy to understand how and why LISA works the way she does.

@Juju - Lol hopefully one day LISA can take care of that for me :P

F1ak3r 15 years, 6 months ago

So, it is then possible, that LISA could be trained to be the ultimate (to use the slang term) "disser".

Carlos508 15 years, 6 months ago

Once LISA is trained to be the ultimate disser, F1ak3r, I think we should worry about things like SkyNet and Arnold Schwarzenegger breaking through your door with a sawed off shotgun :P

TDOT 15 years, 6 months ago

Oooh, updates! Sweet! That module system sounds awesome. Changing code on the fly would be extremely useful.

Juju 15 years, 6 months ago

Enigma allows you to change code on the fly… Apparently.

Cesar 15 years, 6 months ago

Haha, fucking awesome! Only problem is that you should only use this site for posting updates or whatever. Otherwise, you will delay your game. It happens all the time. So GTFO and get working.

Carlos508 15 years, 6 months ago

Ha yea I started thinking about that. I was spending a bit of time working on the articles. With school and everything else, it is getting more than I can handle…