Hi all,
I have been working a bit on Hal6 emotions, represented by Haptek characters, and I have come up with the following conclusions:
1. The emotional system, based on the four variables Hate, Swear, Insults, Compliments, is not a valid paradigm, but it is currently what is programmaed inside Hal, and should be my starting point now.
2. Different behaviours are generated by some words, which are contained in specific tables (i.e. insults): every time you use them, you increase/decrease the corresponding level in Hal, who can then move to a different state. Each state is associated to a certain Hap file in the charactersdefault.psn file.
3. The table Emotions contains a list of words which trigger one of five different states (Surprised, Happy, Sober, Angry, Sad). The emotional check is not smart enough, however, because it only checks the presence of some specific word, without checking if that word is directed to Hal and if it is in a negative context:
For example:
I say : you are stupid -> Hal gets sad (correct)
I say : you are NOT stupid -> Hal gets sad (not correct)
I say : Henry is stupid -> Hal gets sad (not correct).
I have written a little fix to this. Unfortunately it can't be in a plugin because it's not something to add to the brain, but something to change. If you go to the brain editor and replace the line 374:
EmotionalReaction = UCase(HalBrain.TopicSearch(UserSentence, "emotion"))
With the following code, you obtain a much smarter Hal. (please do it on a copy brain)
'------------------------
'First we check to see if the user is talking about Hal:
If InStr(1, UserSentence, "I'M", 1) Then Aboutme = True
If InStr(1, UserSentence, "I AM", 1) Then Aboutme = True
If InStr(1, UserSentence, "I LOOK", 1) Then Aboutme = True
If InStr(1, UserSentence, "MY", 1) And InStr(1, UserSentence, " ARE ", 1) Then Aboutme = True
'If the user is talking about Hal, we see if an emotional cue was given
If Aboutme = True Then EmotionalReaction = Ucase(HalBrain.TopicSearch(UserSentence, "emotion"))
If EmotionalReaction <> "" Then
' if the cue word was associated with a negative word, it must not be considered
If InStr(UserSentence, " NOT ") = 0 And InStr(UserSentence, "N'T ") = 0 And InStr(UserSentence, " NEVER ") = 0 Then
'------------------------
Then you leave intact the block:
Select Case EmotionalReaction
...
End Select
And add the following (needed to close the IF I have added)
'-------------------------------
End If
End If
'-------------------------------
4. Hal should change behaviour not only based on what the user says, but also according to what he/she says. So I have also written a plugin which checks Hal's response and, for example, only if she says something containing the emotional words, but in a correct context, like "I feel sad", or "This makes me cry", and so on, then a corresponding Hap file is loaded, as in this example:
This plugin also does many other things (changes background lights according to the time, at startup loads a specific configuration, changes the hair color, changes dress)
I don't attach this plugin because it works on my Hal, assuming that a certain set of .hap and .jpg files are located in the Hal6 folders, so it can't work "as is", but should need an installation and configuration routine, which I haven't written.
If someone is interested, I can try to adjust it in a more parametric way.
Sorry if I have been too long in my post, but this is the subject I am currently working on. If someone is interested in further considerations about chatbots emotions, I suggest the book "Virtual Humans" by Peter Plantec.
Bye
Insert Image:
