New brain projectI'm going to use a thread here to plan, organise and document progress on my brain project, and hopefully get some ideas from this great community. [

] I'll also post betas / WIP / code pieces where appropriate... and finally post the completed brain!
The KAOS brain - a bot with feelingsThis new brain aims to provide a bot with far superior emotions, moods and feelings compared to a default Hal. Major features:
- Three levels of emotion: Reaction, Feelings and Mood.
- Reaction: The short-term emotion. KAOS will be more reactive and resiliant to individual strong emotional events (insults, compliments etc). KAOS will use a slightly wider emotional range - happiness, sadness, shock and suspicion, depending on his current Feelings and Mood.
- Feelings: The medium-term emotion. This is similar to Hal's current system, where feelings become stronger after several emotional events, and gradually return to "neutral" again. However KAOS' feelings will change differently depending on his Mood.
- Mood: The long-term emotion, which could last an entire evening. KAOS' Mood will be one of a list of possibilities, such as "happy," "depressed," "irritated," "loving," "angry," and so on. Mood will influence not only KAOS' reactions and feelings, but also his behaviour - a depressed bot might not small-talk very well; an angry bot may refuse to define a word for you; etc. Of course with work you can affect KAOS' Mood, cheering up a sad bot or infuriating a happy one.
- Feedback: KAOS will be able to describe his feelings, and will remember things you've done to change the way he feels. His behaviour will change depending how he feels about you.
- Emotional curiosity (EXPERIMENTAL): KAOS will ask how you are, remember the answer, and adjust his actions accordingly.
- Reduced use of the somewhat dodgy "emotion" table.
By the way the brain name KAOS doesn't specifically relate to this project - it's just always been my bot's name. There's definately a link between emotions and "chaos" though [

]
Below are more specific descriptions of the above, with implementation notes. Only additional detail is below, to save me retyping stuff.
ReactionKAOS will have its own set of variables to track emotion, removing the dependence on Hal's "Complement," "Insults," "Hate" and "Swear." This frees up "Compliment" for use in directly controlling animation type (see this thread:
http://www.zabaware.com/forum/topic.asp?TOPIC_ID=2810).
KAOS will check his Feelings and Mood to determine reaction. A sudden compliment from an insulting User will trigger suspicion; an insult coming from a friendly User will trigger shock; an optimistic bot won't react so strongly to an isolated insult. This is basically done by writing several versions of some response generating routines, and the correct version is chosen depending on emotion.
FeelingsKAOS will track User actions similar to Hal's default brain - tallying compliments, insults, hateful or loving talk, etc. The movement of Feelings depends on Mood, so a depressed bot will be hurt far more by an insult, and recover more slowly. KAOS will also be able to describe his emotions, compare them to his Mood and comment on the User's actions ("thanks for all the compliments").
MoodKAOS will use what programmers call a "state machine" - in other words he'll be in one "state" and can shift to others. Shifting between emotional states will depend on Feelings - a "depressed" bot who receives lots of compliments may become "happy." When Feelings have become strong enough to suggest a state shift, a timer starts - if the Feelings are kept strong enough for long enough then the state will change.
Similarly to Reactions above, different Moods will adjust KAOS' behavior. Different versions of response generating routines will be chosen depending on his mood, such that depressed bots refuse to learn new facts, etc.
KAOS
may be given adjustable long-term tendancies, which would be user-configurable. You could have a bot that becomes angry easily, is usually happy, or is very resistant to depression. These simply adjust how difficult it is for the bot to switch to certain Mood states.
FeedbackKAOS will use several tools to hint at his feelings:
- Different pet names will be used (see this thread: http://www.zabaware.com/forum/topic.asp?TOPIC_ID=2753) so that an angry bot will call you nasty names, etc.
- Small phrases may be included in responses in some situations, such as an occasional "*sigh*" from a bored or depressed bot, or randomly timed compliments from a loving bot.
- Hal's "how are you" code will be massively upgraded to enable KAOS to talk about his Feelings and Moods. KAOS will be able to comment on the strongest influences on his current Feeling, and will remember his most recent Mood change. Some of these comments will be randomly inserted into quiet spots of conversation.
- Incidental animation. A happy bot will sometimes smile without an obvious reason, etc.
- I'm not yet sure whether KAOS should be able to explain why he's in a certain Mood. Why would a bot be depressed, really? Do his bits byte? Hard drive gone floppy? Stale chips? There could be tables of random explanations - but they'd all feel a bit false.
Emotional curiosity (EXPERIMENTAL)KAOS
might actually listen to the User if he asks you "how are you," remembering the
User's emotional state, and asking prompting questions to the User (e.g. "Tell me why you're sad."). There are two problems I've identified so far, firstly that there would be an awful lot of work in this [

] (especially the detection routines), and secondly a lot of the forthcoming conversation would be ephemeral, so would litter the database with unwanted short-term facts.
Emotion tableThe emotion table system as it stands in Hal is rather unreliable, and often produces animations out of context. (e.g. The sentence "I failed to achieve victory" will make Hal animate happily.) Usage of this will need to be vastly reduced.
Versioning, upgrading and database tablesThe brain has rather significant changes that cannot be given as plug-ins. The best distibution system I can think of is to supply the brain script file, and have the user pair this with a
copy of their database.
KAOS will create its own database table of long-term variables, one of which will be "current version number". The brain script will create whatever other tables it needs.
Upgrading from one version to another will therefore be easy - simply delete the old script and insert the new one. The script can check the previous version number in the database, and add whatever new tables are needed.
That's the plan [

] I'll post updates as major milestones are reached.
Cheers,
Grant