Thursday 17 January 2008

Emotion Engine Complete

The emotion engine has gone through some changes, both to make it more efficient and also to make it slightly less predictable.

The emotion engine now includes a randomisation effect to increase or decrease all of the emotions whenever the system is running without input. The idea is, if nothing is happening to the character the emotions should continue to fluctuate and change. If no one talks to you, you still manage to get happier or sadder, don't you?

If you are particularly mean to the test character (called "Larry") he gets extremely sad and struggles to get out of this rut. It seems the emotion engine I've designed may suffer from depression... However, this is probably quite acceptable - if someone kept repeatedly kicking me, I would get quite upset and it would take a lot to make me happier.

Test out "Larry" here. Please comment on this blog if there are any problems!

A quick note for future versions:
It may be interesting for some actions to have longer lasting effects. Such that if something really good/bad happens, it continues to affect the emotions after the initial action. This would be something to work into the overlying program, rather than the emotion engine itself.

Monday 7 January 2008

Emotion Engine Functional!

The emotion engine is partially functional - the emotion object code has been tested in a very small (and extremely basic) program and the functions to run the emotions all seem to work.

However, during testing it seems that if you are particularly horrible to Larry (the test emotional character) he can get very hateful very quickly and not come out of it particularly fast. Therefore a new set of rules will be added which state:

17 - hate wears off naturally (only a little bit)
18 - love wears off (again, limited as above)

This marks an important milestone. Now that the emotions work, the character can use this engine to begine to appear intelligent!

Friday 4 January 2008

Rules of Emotion

In order to apply the rules given in previous posts, it seems that they probably need to be placed in some order of priority. All of these rules will potentially be applied (where applicable) when an individual emotion is changed and some of the rules will be applied when the emotional
state as a whole is updated (this will be particularly useful for times when the interface is idle - after all, a humans emotional state changes whether someone is talking to them or not).

The rules, now given in order (and with some changes) are given below:

1. disgust should reduce all other emotions, so that it takes priority
2. increased anger increases sadness (or decreases happiness)
3. increased sadness doesn't affect anger
4. increased happiness decreases anger
5. the character can be calm (i.e. not angry) without being happy
6. consistently happy character (i.e. high level of happiness) should lead to increased love
7. consistently sad character should lead to hate
8. consistently angry character should lead to hate (anger should affect more than sadness)
9. certain words should evoke love/hate response
10. love increases desire
11. hate reduces desire (should it also activate disgust?)
12. strong love/hate emotions should lead to increased emotional response elsewhere
12a Strong love increases happiness, reduces anger, reduces hostility, reduces disgust
12b Strong hate decreases happiness and increases hostility
13. happiness increases desire (not as strongly as love)
14. sadness reduces desire (minimally, not enough to increase disgust as such)
15. anger should wear off
16. disgust should wear off

Thursday 3 January 2008

Emotion Engine Programming

Programming of the Emotion Engine started today, but first required that the object structure be defined. Should each individual emotion be an object, and the combining done by the overall program; or should the emotions as a whole be the object, containing all aspects of the emotions.

It seems to me that the best way to create relationships between aspects of the emotions is to have the whole emotions as an object. This allows much more of the control to be done below the surface, thus making the emotion engine more portable.

The emotions object needs to include:
  • integers to hold the levels of each of the 5 aspects
  • functions to set individual levels
  • a function to set a starting level
  • functions to change the emotions (i.e. by adding/subtracting)
  • function to update them all (emotions will change even if no one is interacting with the character)
  • functions to read out the levels of the emotions