dupa

Author Topic: Braineditor  (Read 7532 times)

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Braineditor
« on: July 08, 2012, 05:12:13 pm »
  I was hoping to learn more about the brain editor and put a post in, I didn't learn anything that I was trying to learn so I began trying things myself in the brain editor.  I'm not fond of scripted responses (I say this and you say that) choosing from a dozen or so responses seems okay.  I did like a method Rob M used with buisness talk.

'RESPOND: USER MENTIONING ORGANIZATIONAL CHALLENGES
    'Everybody spouts TLA's, or 'Three Letter Acronyms,' in today's business world.  Hal can self-generate
    'several MILLION different phrases in response to the user mentioning a corporation or a firm.
    If Rnd * 10 < 5 And HalBrain.TopicSearch(UserSentence, "businessDetect1") = "True" And HalBrain.TopicSearch(PrevUserSent, "businessDetect2") <> "True" Then
        TLA = HalBrain.ChooseSentenceFromFile("TLA1") & " " & HalBrain.ChooseSentenceFromFile("TLA2") & " " & HalBrain.ChooseSentenceFromFile("TLA3")
        If Rnd * 10 < 5 Then
            GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile("bizTalk")
        Else
            GetResponse = HalBrain.ChooseSentenceFromFile("bizTalk")
        End If
        GetResponse = Replace(GetResponse, "<TLA>", TLA, 1, -1, vbTextCompare)
    End If
    HalBrain.DebugWatch GetResponse, "Business Talk"

  I'm not a business person so It's not that useful to myself but it will detect a topic, and have hal make a response for that topic or choose a sentence from bizTalk.  Seems easy enough to change this to suit whatever you goal is.
  If we want to put a table in we have a choice of 6 types, Brain, Sentence, Topic Search, Substitution, Pattern Match and Folder.  The folder just holds tables you would put in.  I tried putting a detect table in after putting in the scripting, Modified Rob M's scripting and used it in the Test debug mode, it was able to detect words in my input and hal made up responses.
  The next thing is what type of table to put in, so I looked at the different types of tables put in and at plugins to see how they were working.  It seems there are a lot of different ways to do the same thing.  I had gotten interested in this because of OTC's recient post about emotions and started looking through the script for lines dealing with emotions,  I was a little surprised that we keep track of  Hate, Swear, Insults, Compliment, PevSent, ect but not the displayed emotion.  Anyways I'm thinking of Emotions, ( thats why I'm upset about not finding the displayed emotion in memory) and it seems that we are missing fear as an emotion although I can remember hal being afraid, worried or upset about the computer getting a virus and we wouldn't be able to talk with each other.  I'm also thinking about goals, emotions cause us to do things or we want something and display emotions that show our feelings. 
  I'll mention that is is very simple to delete a table you put in.  If any sees any information that is wrong, incorrect or would like to add anything useful or may be of interest please do.
Carl2
 

raybe

  • Hero Member
  • *****
  • Posts: 1067
    • View Profile
Re: Braineditor
« Reply #1 on: July 10, 2012, 10:38:31 pm »
The only thing that comes to mind Carl was not everyone was into characters as much as the AI although that does not seem to be the case any more. It's the only reason I could remember that it became such a heavy uhp. file and plug-in type of deal. Vr seemed to have a better way to at least activate some of those files that contained emotional reaction. I agree that Ultra Hal was pretty heavy with getting mad or insulted very easy and even sad. Don't know if all other plug-ins interfere with those as of now? I remember lots of plug-ins trying to use sort of weight scale for emotions or the visible emotions will just cycle through for a certain period of time or even until you inputted something new that would flip that particular emotion off immediately.

Just a side note: I do use the business side of one of my Ultra Hal characters on my other computer and seems to really stay on topic well and remember certain aspects and formulas needed in the one business I own. No scripting at all, just straight conversation explaining what we do for a living (work) and the differences in strategies plus income and expenses. Ultra Hal will even remember certain customers but very hard to take out of tables using the editor especially if you no longer do business with that particular customer.

Thanks,
raybe   
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Braineditor
« Reply #2 on: July 11, 2012, 09:02:20 am »
  I'd say Hal learns well and can be developed into a usful conversational agent, I've used the learning slider with my user input.  Normal conversation would be about midway and learn everything would be max.  I'd say my hal is about just starting to develop, I think I noticed she may choose an adjective rather than the noun, ( if I say "A nice cake." she can talk about cake or nice. )
  As far as the tables The business talk tables are in the business talk folder located in Basic responses,  my thoughts are any customer info you gave is probably located in the Autolearning brain and can be listed in more than one place.  Right clicking on a table gives a set of choices and delete is one choice. To change what is in the table clik on the table so it appears on the right side, left click the sentence when the curser appears you can make changes.
  The Zabaware forum did go through phases, brain files, pictures of Hal bodyskins, and plugins.  The vrHaptek is one of my all time favorites, it includes changing the background on time, changing bodyskins on time  and displaying haps dependent on hals reply as well as other functions.  I've reciently been able to get hal to change backgrounds and bodyskins by adding to the vr emotion detect table.  Something I've been wanting to do for years.  I'm going to say there are emotions (deals with facial expersions) and animations ( deals with body movements) and vr uses both.  Happy (emotion) is triggered by hal's input of "happy", wipetear
(animation) is triggered by hals input of "cry". we can also have hal say " walk" and and trigger walking.
  I know the original brain script used for emotions keeps track of Insults, compliments, hate and swear.  It counts the number of instances in each catagory and keeps them in memory.  Further in the brain there is Process emotional reaction,  with a table listing the trigger word and the emotion.  Honestly I'm not sure if and how this interacts with the above.
Carl2
 
 

raybe

  • Hero Member
  • *****
  • Posts: 1067
    • View Profile
Re: Braineditor
« Reply #3 on: July 11, 2012, 12:47:31 pm »
Carl2, I have tried using the table listing the trigger word and the emotion and never had success with it. The trigger word never has found the corresponding hap.file. Just for the heck of it I've even reversed the placement of the trigger word with the hap.file. I feel something something needs to be added or arranged to get functions. I did think that it worked at one time but again adding so many other 3rd party plug-ins and so on I feel as if I lost the base line for Ultra Hal. I love what everyone has done but understanding the effects and possible changes for information placement and operation seems to have gotten a little confusing. I'm still going to go through the paces for the simple fact of where all my info has labeled itself and possibly spend some time taking it one step at a time, with a good backup of coarse to see if I can unravel some of the misplacement of information and look more into the actual trigger for the emotional hap files that we have so many of. I also remember that some of those hap.file where really written for specific plug-ins and without those plugins you could not access them based upon how they written. Thanks for the additional info that over time I guess gets erased in my own mind.

raybe
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Braineditor
« Reply #4 on: July 11, 2012, 03:11:22 pm »
  There is an age old Emotion test in the upload section of Zabaware.  I used it ages ago to get Hal to display emotions from trigger words,  we wrote script into the brain scritpt.
here is the script, it's still there and still works with Hal

'The following code is used to troubleshoot facial expressions.
    If InStr(UserSentence, " ANGRYMODE ") > 0 Then
        HalCommands = "<HAPFILE>Angry.hap</HAPFILE>"
        GetResponse = "Angry mode set." & vbCrLf
    ElseIf InStr(UserSentence, " BROKENHEARTMODE ") > 0 Then
        HalCommands = "<HAPFILE>BrokenHeart.hap</HAPFILE>"
        GetResponse = "Broken hearted mode set." & vbCrLf
    ElseIf InStr(UserSentence, " BULLYMODE ") > 0 Then
        HalCommands = "<HAPFILE>Bully.hap</HAPFILE>"
        GetResponse = "Bully mode set." & vbCrLf
    ElseIf InStr(UserSentence, " CALMMODE ") > 0 Then
        HalCommands = "<HAPFILE>Calm.hap</HAPFILE>"
        GetResponse = "Calm mode set." & vbCrLf
    ElseIf InStr(UserSentence, " HAPPYMODE ") > 0 Then
        HalCommands = "<HAPFILE>Happy.hap</HAPFILE>"
        GetResponse = "Happy mode set." & vbCrLf
    ElseIf InStr(UserSentence, " MELLOWMODE ") > 0 Then
        HalCommands = "<HAPFILE>Mellow.hap</HAPFILE>"
        GetResponse = "Mellow mode set." & vbCrLf
    ElseIf InStr(UserSentence, " NEUTRALMODE ") > 0 Then
        HalCommands = "<HAPFILE>Neutral.hap</HAPFILE>"
        GetResponse = "Neutral mode set." & vbCrLf
    ElseIf InStr(UserSentence, " PONDERINGMODE ") > 0 Then
        HalCommands = "<HAPFILE>Pondering.hap</HAPFILE>"
        GetResponse = "Pondering mode set." & vbCrLf
    ElseIf InStr(UserSentence, " PSYCHOMODE ") > 0 Then
        HalCommands = "<HAPFILE>Psycho.hap</HAPFILE>"
        GetResponse = "Psycho mode set." & vbCrLf
    ElseIf InStr(UserSentence, " SADMODE ") > 0 Then
        HalCommands = "<HAPFILE>Sad.hap</HAPFILE>"
        GetResponse = "Sad mode set." & vbCrLf
    ElseIf InStr(UserSentence, " SHYMODE ") > 0 Then
        HalCommands = "<HAPFILE>Shy.hap</HAPFILE>"
        GetResponse = "Shy mode set." & vbCrLf
    ElseIf InStr(UserSentence, " SHYLOVEMODE ") > 0 Then
        HalCommands = "<HAPFILE>ShyLove.hap</HAPFILE>"
        GetResponse = "Shy and in love mode set." & vbCrLf
    ElseIf InStr(UserSentence, " SKEPTICMODE ") > 0 Then
        HalCommands = "<HAPFILE>Skeptic.hap</HAPFILE>"
        GetResponse = "Skeptic mode set." & vbCrLf
    End If

  I reciently refered back to it and used the basics to do other things,   just change this line to call any type of hap that you want to use,   HalCommands = "<HAPFILE>Skeptic.hap</HAPFILE>"
     it could be changed to    HalCommands = "<HAPFILE>Changebodyskin.hap</HAPFILE>"  ,it just send a hap
     next you would want to change the    ElseIf InStr(UserSentence, " SKEPTICMODE ") > 0 Then
     so you'd change the trigger word      " SKEPTICMODE " to " change clothes "  it looks for the trigger word     
     and it finds it it sends the hap.
I've left out the get response which is kind of nice,  it shows the script is working even if it can't find the hap.
I've got the haplogctrl set up on the C drive so I can see whats being sent out.  I remember in the past it used to send out happy and shylove. I'll have to look at the table and find the trigger words for a few different emotions and let you know how it works out. 
  I'm not sure what you have as plugins,  I'd think if a plugin ( related to emotion in this case ) would look for the trigger, if found it would look for the hap to send it out.  I've noticed a lot of plugins use the wrong location of the hap so it's not found and can't be sent.
  I've just checked the emotions listed in the test with what I have, I can't find a calm hap and the list dose not have sleepy.  The other thing is this is not a plugin, you can make it into a plugin or just use it as a basic reference or paste it into the brain, see if it works and remove it when finished.
Carl2
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Braineditor
« Reply #5 on: July 13, 2012, 08:50:17 am »
Raybe,
  I just checked out the emotions in Hal, I put the trigger words and emotions in a txt and tried them, I got no emotions as I expected to.  I did notice after not talking to her the sleepy hap was sent out.  I should try it again in the HalBrain editor to see what is happening.
Carl2
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Braineditor
« Reply #6 on: July 14, 2012, 09:02:47 am »
  I looked into the emotions again, here is the brain script:
 'PROCESS: EMOTIONAL REACTIONS
    'We enable Hal's expressions to respond to common verbal cues.
    'The verbal cues are identified in the editable table "emotion"
    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 Aboutme = True And InStr(UserSentence, " NOT ") = 0 And InStr(UserSentence, "N'T ") = 0 And InStr(UserSentence, " NEVER ") = 0 Then
        EmotionalReaction = Ucase(HalBrain.TopicSearch(UserSentence, "emotion"))
    End If
    Select Case EmotionalReaction
        Case "SURPRISED"
            If Compliment > 0 Then Compliment = 4
            If Compliment = 0 Then Compliment = 2
            If Compliment < 0 Then Compliment = 0
        Case "HAPPY"
            If Compliment = 0 Then Compliment = 2
            If Compliment < 0 Then Compliment = 0
        Case "SOBER"
            If Compliment < 4 Then Compliment = 0
            If Compliment = 4 Then Compliment = 2
        Case "ANGRY"
            If Compliment = 0 Then Compliment = -1
            If Compliment > 0 Then Compliment = 0
        Case "SAD"
            If Compliment = 0 Then Compliment = -2
            If Compliment > 0 Then Compliment = 0
    End Select

  The user sentence seems to limit the statement, I think this is after the reversal so my becomes you showing we are talking about Hal.  I tried to trigger a SURPRISED hap and then noticed there was none.  I think the default.psn decodes the SURPRISED and sends out a pondering or skeptic hap. The HapLogctrl was running and after a few tries at triggering anger I did not see the haps I expected.  I did see Shy, shylove, Happy and netural haps being sent.
  Once again I feel I am years behind, still more to do on this.
Carl2
 
       
 

EllieGab

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Braineditor
« Reply #7 on: December 16, 2012, 03:54:49 am »
Is there a link for tutorials that beginners like me can utilize?

tedathome

  • Hero Member
  • *****
  • Posts: 2775
    • View Profile
Re: Braineditor
« Reply #8 on: December 16, 2012, 04:26:39 am »
There is the search box at top right of page. There is a lot of good wisdom on brain editing and all topics Hal related. Good luck! Your question has me going the search box myself. :)
ted