Artificial Intelligence Personality

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Message
Author
User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

Artificial Intelligence Personality

#1 Post by DaFool »

This thread was somewhat inspired by the GOD chat-bot.

I know next to nothing about the subject matter, and am just opening the floor to anyone who has read anything on the matter and could possibly help narrow the focus for research.

Is it possible...within the limitations of python / Ren'Py, to program the responses of a character based on a preprogrammed personality rather than within event contexts?

I was thinking maybe it would be neat if you have a dating sim and then by interacting you have an inkling that perhaps what you're reading is not exactly a 'preprogrammed response' and could perhaps be *gasp* coming from a live person.

Either that or else maybe just make a 100+ line possibilities for every response, and have a randomizer pick one. That way you'd have to play 100^100 games in order to have the exact feel.

monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#2 Post by monele »

I'll veer away from this right away (sorry) and say : it's all about illusion. People know they're not playing with a real person anyway... so much for that ^^;... Now, though, if you make your characters react to more things than usual characters do, it might at least give them a lot more life.
Just the fact they would remember little things, or react to how you don't... Stuff like that?
For replay value, going with a random picking of sentences could work, but do you really want to do it for every sentence? :P...

Actually, forget about programming... forget about *how* to actually implement it. *What* would you think would be good? Something that just creates sentences out of the blue that even you, the creator, haven't seen? Or something that is still pre-scripted entirely?

User avatar
PyTom
Ren'Py Creator
Posts: 16093
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#3 Post by PyTom »

The hardest part of programming is figuring out precisely what you want. (The other hardest part is actually doing it.)

In this case, there's an interesting idea... but if we drill down, a lot of the details are missing.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Adorya
Miko-Class Veteran
Posts: 541
Joined: Fri Aug 18, 2006 4:51 pm
Contact:

#4 Post by Adorya »

Actually tried the 100+ thing and I can say for one personality you won't make more than 5 random quotes for one situation...because especially one personality restrict you to a few answers.
And I can tell about the fact if one answer lead to a specific path, it's very hard to avoid paraphrasing or dull sentences that mean the same thing.

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

#5 Post by DaFool »

Paraphrase: Is the God chat-bot doable using python? That would be neat, to have a dating sim where you actually type out most of your interaction.

Come to think of it, the 5 line option seems to be the most efficient way to do things.

monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#6 Post by monele »

The chat bot is doable in *any* language, I think. It doesn't use highly technical resources such as OpenGL or physics calculators. It's all about storing data and analyzing input to "understand" what's meant, and then try to form an appropriate response formed through the database content. That's what the human brain does at a much higher level.
So... as long as you can store and extract, any language should be okay.

Still... do you find the chat-bot realistic? Okay it's amusing and it does get a few things right... but 90% of its appeal is in how silly the answers he gives are ^^;... While amusing out of context, it would be very laughable in a serious game context.
Do keep in mind that this chat bot is part of many experiments to recreate realistic conversations and that's it's taken years and years to reach this... amazing, yet pitiful result (I admire their work, but honestly, we're lightyears from a human).
I still think you're better off working on meaningful characters and giving them unique dialogues, without that many choices.

If you really want to make something more interactive (but not typeable), you could go the adventure game way. You get quite a few choices for conversation (and usually a choice of witty phrases ^^) and choosing one gets you a unique reponse, usually followed by a rebranching into the main conversation. Only a few sentences and you get to make a choice again.
While this doesn't make for personal and world-changing conversations, it makes them rather unique for the player.

Another approach is that of western RPGs where you get to roleplay the protagonist and choose wether to be nice or witty or harsh or whatever... It doesn't change the outcome of things most of the time but even then, the player gets conversations fitting to the way he wants to play.

Counter Arts
Miko-Class Veteran
Posts: 649
Joined: Fri Dec 16, 2005 5:21 pm
Completed: Fading Hearts, Infinite Game Works
Projects: Don't Save the World
Organization: Sakura River
Location: Canada
Contact:

#7 Post by Counter Arts »

Hmm... didn't Enix do something like this before called wonder project?

Chat-bot probably is doable.

I kinda had a simliar idea of an AI that actually tries to really simulate human emotions. Simulate as in replicates how a real person would learn based on classical conditioning. If I had just a year of doing nothing, I could probably program it.

miriam
Regular
Posts: 46
Joined: Fri Mar 30, 2007 6:41 pm
Location: Australia
Contact:

#8 Post by miriam »

AI is a really important topic and a lot of people are working on it. The god-bot is an example of the Eliza-style of doing things (Eliza came out in the 80s if I remember right). Lately Alicebot has taken the same kind of thing a fair bit further -- it is free, open-source software.
http://alicebot.org
Unfortunately, it is still top-down AI, using databases. It kinda works, but it really is a quick way to fake AI and will never be any more than that.

The only way to get real AI is bottom-up, like Rodney Brooks and Cynthia Brezeal are doing. The problem there is that it is early days yet and probably won't have speech for several years yet. Bottom-up AI uses many layers of very low level behaviors to gradually build intelligence from simple insect-like behavior. So you can see it is not likely to be holding sexy conversations just yet.

Top-down AI can get some way towards, as Monele said, the illusion of intelligence... but it will always make dumb mistakes because in the end it doesn't understand what it is saying.

If you want to make a dating sim using top-down AI then python is as good as any language, and better than most. In fact RenPy's ability to store stuff and use it in responses is halfway to top-down AI already. I'd say go for it. Be aware of the limitations and work within them. Most of the big problems with top-down AI become evident when you try to hold long conversations with them. If you keep conversations short, to only 5 or 6 lines at a time then it should look far more convincing. And if you fake a strong personality for the AI then it also tends to work better at using people's expectations to fill in the gaps.

If you get it to work really well you could enter it into the Loebner prize and maybe win some money with it.

Additional: I just did a quick search, for the heck of it, and came up with an AIML (the system Alicebot uses) implementation written entirely in python:
http://pyaiml.sourceforge.net
Maybe it could be used from within RenPy.
My current, and first, RenPy story: A Loving Soul
script: 100% -- scenes: 100% -- character art: 20% -- programming: 20%
(spoilers in the story of the same name on my website)
_ _ _ _ _ _ _

A life! Cool! Where can I download one of those from?

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

#9 Post by DaFool »

Wow, thanks for the leads, miriam.

Here's what I think will be doable somewhat: establish a time limit to the totally-open interaction.

For example, you're on a date in a restaurant, and a timer will start counting for 10 minutes after the waiter takes your order until the food is delivered. Within that limit you can freely type any conversation, and your A.I. date will attempt to respond appropriately. Behind the scenes, impression points will be added or removed depending on how you, the human, is able to carry on a somewhat meaningful conversation with the A.I. without tripping her/him up (thereby causing insult -- "You made me say something stupid, puny human! You'll regret this"). The way to keep track of this would be using some relevance pattern recognition (using keyword topics...eh, I have no real idea).

When the time is up, the waiter delivers your food, the rest of the conversation carry more or less pre-scripted (with slight variations depending on the results of previous interactions).

Then you will know whether you will get a second date or not.

How about that? As close to a real dating simulator as can be. I'm pretty sure all the programmers here can whip up something like that without too much trouble.

absinthe
Regular
Posts: 194
Joined: Sat Dec 10, 2005 12:26 am
Contact:

#10 Post by absinthe »

After much fiddling with programming an interactive personality in IF, I've come to the conclusion that it's a lot of work with no real benefit, at least within the scope of writing a game.

Say I have this AI-program I've written, Jane. She's pretty smart, has pretty sophisticated brain code, and I've labored long and hard to teach her everything I can so she can respond to human input almost as well as a human can.

But... why? She's stuck in a game, hopefully one with a plot and specific settings. She doesn't *need* to be able to respond to questions about everything under the weather -- just questions about the things around her and the plot and the setting and maybe herself.

And I can do that with a lot less code than I need to create an essentially 'thinking' character. As monele said, it's all about the illusion... creating the illusion of interactivity is far easier than creating the reality of it.

And, the thing is, the two or three encounters I've had with "AI" in games have been disappointing. Either there's nothing there that I couldn't replicate with some clever reactional programming, or it's a novelty, and one that I lose interest in quickly because there's no forward motion.

Which isn't to say it's not a neat idea (so tempting...) or doesn't have applications... I just don't see how "full" AI (a hybrid is another story) is necessary or even desirable in a game.
DaFool wrote:The way to keep track of this would be using some relevance pattern recognition (using keyword topics...eh, I have no real idea).

[...]

How about that? As close to a real dating simulator as can be. I'm pretty sure all the programmers here can whip up something like that without too much trouble.
What you're describing is definitely doable. Just a matter of how many keyword/response pairs the programmer takes the time to put in. And if you narrow the scope even further -- say, you let the PC pick the girl based on her major or something, so she'd be expected to be strong in that area but wouldn't need to know everything about everything -- it'd be even easier.

The issue you'd run into is the facility of keywords versus typing.

Compare:
Type in: "what do you think about global warming?"
NPC: (keywords "think" -> "opinion", "global warming": access "opinion" database... look for "global warming") "I'm a Ecology major, so I think it's..."

To:

Pick from menu: "global warming"
NPC: (global warming picked) "I'm an Ecology major, so I think it's..."

The end result is the same either way. So you'd really need to customize it beyond 'points'. Maybe store all the responses so she can refer back to specific parts of your conversation later, or bring up the conversation again. Hmm, something to think about.

Yikes. I think I'm going to go stare at my seven failed attempts at AI under TADS until the desire to code something like that goes away. :D
My 2007 NaNo entry: Eidolon

Counter Arts
Miko-Class Veteran
Posts: 649
Joined: Fri Dec 16, 2005 5:21 pm
Completed: Fading Hearts, Infinite Game Works
Projects: Don't Save the World
Organization: Sakura River
Location: Canada
Contact:

#11 Post by Counter Arts »

Hmm...

I guess I should add on my list games to program is an AI that learns desires and actively searches them out. Then you can play a game where you try to win a girl's heart. Of course, she would be able to like any objects you insert into the game.

Well I can dream can't I? I suppose how it would work would be storing memories and how they interact with each other with internalized objects.

miriam
Regular
Posts: 46
Joined: Fri Mar 30, 2007 6:41 pm
Location: Australia
Contact:

#12 Post by miriam »

DaFool, I think such a thing is definitely do-able. You could even plug the python version of Alicebot directly in to do it I think. I have to agree with what absinthe said about looking carefully at the balance of gains vs effort though.

On the bonus side Alicebot does already come with most of the hard stuff already done -- it can sort out important parts of speech fairly reliably and already has large "brain files" (really dictionaries) that you can add to or alter as you desire (pyAIML is only about 20k, and the standard brain file is about 500k compressed).

On the down side the craziness of some of its responses are well known. If we had a logical language like Latin or Korean then it might not be such a problem, but English is a frankly horrible language for an AI -- a computer programmers nightmare (but a poet's paradise). Context counts for an awful lot of the meaning in English. Sorting that out is a monster problem. "Switch the light off." "Hands off." "I'm feeling off." "That's a write off." "It's not on the list -- it's been left off". "I have the day off." "The grapes have gone off." The lid is off." "To you, hats off." -- All those use "off" in different ways. Alicebot might cope with some, but probably couldn't know that "hands off" is an order, probably angry; the human is not happy about "feeling off"; is probably delighted about having the day off; is saluting you in saying "hats off". See how hard the problem is? All I'm saying is don't expect too much from such a bot. The trick, as I see it, is finding ways to play to the bot's advantages.

I would keep sequences down to way, way less than 10 minutes -- I'd look at ways to interrupt things a lot more often, like every several replies... preferably in a way that would tend to change the direction of the conversation. It might be possible to get the bot to do this itself. I'm not sure. If you could force the human to react every several replies instead of making the bot simply reactive, which ends up producing such loony responses, then it might help. You could use standard interviewing techniques here -- get the bot to ask specific what, who, how, why questions, like reporters are taught to. These limit the way a human can respond while giving the illusion of freedom. Also, if the bot appeared to be emotional about things (ecology, for instance) and managed to elicit an emotional response in the human then things would remain far more natural and fulfilling for the human. By the way, you'd have to vary the frequency of topic changes, otherwise the human would see it happening. (OK, 5th sentence -- here comes the topic change.) We humans are amazing pattern recognition machines.

It is a rather neat idea to get the bot to react to it saying dumb things, but it might be harder than you think. The only way I can think of that it could be done is to use the human to indicate it somehow ("Huh?" "What do you mean?" "That doesn't make sense." etc). It can't be figured out simply from the bot's own responses. The bot gives nutty replies because it doesn't understand that it is not a proper response -- you can't get the bot to signal something it can't see.

Counter Arts -- you might have to wait for bottom-up AI to come of age for that (a few years from now). Desires and wants are what that stuff is built on. Unfortunately top-down AIs are really just sophisticated databases and have no feelings... that said, you can program bots to respond to key words and phrases in ways that appear emotional. As absinthe said, though, it really is a matter of weighing up the effort against the payoff.
My current, and first, RenPy story: A Loving Soul
script: 100% -- scenes: 100% -- character art: 20% -- programming: 20%
(spoilers in the story of the same name on my website)
_ _ _ _ _ _ _

A life! Cool! Where can I download one of those from?

User avatar
PyTom
Ren'Py Creator
Posts: 16093
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#13 Post by PyTom »

miriam wrote:you might have to wait for bottom-up AI to come of age for that (a few years from now).
Celebrating 40 years of being a few years away from AI!
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Counter Arts
Miko-Class Veteran
Posts: 649
Joined: Fri Dec 16, 2005 5:21 pm
Completed: Fading Hearts, Infinite Game Works
Projects: Don't Save the World
Organization: Sakura River
Location: Canada
Contact:

#14 Post by Counter Arts »

miriam wrote:Counter Arts -- you might have to wait for bottom-up AI to come of age for that (a few years from now).
Well, crazier stuff has happened to me before and I hear some crazy things.

First, let me state that this does not involve sentance reconigion or any of the sort. It just, you pick a place to date, pick from a large list of menu items to choose from, pick presents etc... and the AI will just generate fun things.

Like, I heard about how some guy realized that everyone in the finance industry was using the wrong math for a problem. The correct math theory could be found in high school textbooks.

He made crazy amounts of money from selling a program that did high school math.

I would guess for some people here this is not suprising as I don't really know what everyone else knows.

Besides, I'll have preset actions to take based on desire levels. Maybe program some behaviours like... when she gives you a gift, what the gift is might be what she actually wants.

Like, instead of keywords which imply some hard and annoying programming, use actual persons, places and things (objects) in a game.

Then specifically program some annoying ones like player's perceved likes and dislikes.

Then simulate memories as internalized objects and give them a score based on emotional level and number of times recalled and time lapased since last recollection of this memory.

Then when remembering, poll for the highest scores that relate to the stimulating object. Kinda like with object orientened programming and pointers.

... I guess what I am saying is... do a top-bottom memories created from bottom-top desires. Then just limit actions to generalized pre-programmed actions. Some how I get the feeling that this may have been done before.

miriam
Regular
Posts: 46
Joined: Fri Mar 30, 2007 6:41 pm
Location: Australia
Contact:

#15 Post by miriam »

Celebrating 40 years of being a few years away from AI!
Heheheh :lol: How very true!

I think top-down AI will forever be reaching for realistic intelligence, but never quite get there. On the other hand bottom-up AI has made truly amazing strides in less than one decade. "Messy" problems such as navigating a space populated by people and chairs that can be moved, and lighting that changes, are things that are almost impossible for top-down AI, but these are the very kind of things bottom-up AI has had great successes with.

I know it sounds silly to predict that we will have useful AI in a "few" years, and I guess I should really say "somewhere between a few years to a few decades away". Sometimes when working on this stuff I feel like we must be almost there. Sometimes I think it is going to take 20 years. Just now I feel optimistic again. :)
My current, and first, RenPy story: A Loving Soul
script: 100% -- scenes: 100% -- character art: 20% -- programming: 20%
(spoilers in the story of the same name on my website)
_ _ _ _ _ _ _

A life! Cool! Where can I download one of those from?

Post Reply

Who is online

Users browsing this forum: No registered users