This post outlines my approach to introducing to my virtual pet prototype the possibility of meaningful emotional responses to its environment. I’ve designed an object-based approach where the virtual pet is able form opinions of different types of objects based on its prior emotional responses to objects of that type.
The core design parameters I used to build this prototype are:
- Response. Different objects should trigger different emotional responses in the virtual pet, based on its preferences and personality.
- Memory. The virtual pet should remember its prior interactions with object, and use this memory to form preferences for objects of certain types over others.
- Decision making. When introduced to an object, the pet should be able to make simple decisions about whether to approach or ignore this object, based off its memory and preferences.
The prototype designed to implement this approach was built in Unity, using C# classes to assign objects a ‘type’ and an ‘archetype’, and using sortable Lists to allow the pet to remember responses and form opinions about object. The approach I used is outlined below.
Using a simplified version of the emotional matrix I’d previously developed, Catbox is capable of emotional responses to objects based on parameters set within the object and his own preferences. These responses are stored and sorted to impact his preferences in future.
Proximity-based decision making
Using a system of recognition based on object classification and object proximity, Catbox is able to use his memory of prior interactions to decide whether to approach or ignore an object. Repeated interactions reinforce his preferences; Catbox will always approach an object he has a strong preference for over an object he dislikes or one he is unfamiliar with.
The resulting system is flexible and easily expandable. In the current prototype, it is easy to add a potentially unlimited number of objects by assigning them different values, and Catbox will sort them into his preference hierarchy depending on his pre-set personality.
While Catbox currently makes a binary decision about a new object based on his preferences – like (approach) or dislike (ignore) – it would theoretically be possible to easily implement a range of different responses based on the core emotions of joy, sadness, anger and fear.
Design challenges for future consideration:
- Distinct personality. Currently Catbox responds the same way to every object regardless of situation; if he likes it or doesn’t recognise it, he will approach and attempt to interact with it, and if he doesn’t like it he will ignore it. I would like to add personality values that change how each pet might react; a cautious Catbox might be reluctant to approach an unknown object, for example, while a curious Catbox would be more likely to.
- Player relationship. Currently Catbox’s opinions are based entirely on the objects in the scene. What I’d like to do is give Catbox an opinion of the player, based on the pet’s personality and how the player uses objects to interact with him. A trusting Catbox would be more likely to interact with an object the player gives them, for example, even if their preference suggests they won’t like it. However, if the player keeps giving Catbox objects that he reacts negatively to, then he will become less trustful and less likely to accept objects from the player.