In Siboot, the “greet” verb is used to initiate a conversation with another actor using the form Subject “greet” Direct Object. Once a conversation is started, actors will have a whole web of 2nd level verbs to choose from (see the Verb Categories section in Design Document 4).
I made a design decision early on to limit a conversation to two actors. It goes without saying that if an actor is in a conversation, they should not show up as a Direct Object of another actor’s “greet”. Trying to implement this simple condition over the past months has caused me unnecessary heartache. I’ve tried setting an actor’s OccupiedUntil status and using that status as a “greet” Direct Object filter. I’ve tried locking a stage once a conversation starts between two actors. Nothing has worked to my satisfaction and some attempts at implementation have had unanticipated side effects.
My 925 company shuts down for a week during the July 4th holiday so I spent six days debugging this “greet” situation part-time and believe I’ve come up with a solution that works without causing any unanticipated side effects. Here’s how it works.
Each actor has several traits that indicate whether or not they’re in a conversation with another character (I’ll use characters from the TV show LOST in my examples since it’s one of my favorite shows):
Each trait can have a value between -0.99 and 0.99 (these are BNumbers). So if Jack were in a conversation with Kate, the value of Jack’s TalkingToKate would be 0.99 and the value of all his other TalkingTo traits would be -0.99.
Every verb can have Consequences. These consequences, if they exist, “fire” automatically when a verb is used in an event. One of the things you can do as a verb consequence is set actor traits. So in the “greet” verb I set up the consequences I need to set an actor’s TalkingTo traits.
For clarity I’m only showing the consequences related to Jack’s conversations with the other actors.
- Jack SetTalkingToKate
- Jack SetTalkingToSawyer
- Jack SetTalkingToLocke
- Jack SetTalkingToAnaLucia
- Jack SetTalkingToHurley
- Kate SetTalkingToJack
- Sawyer SetTalkingToJack
- Locke SetTalkingToJack
- AnaLucia SetTalkingToJack
- Hurley SetTalkingToJack
In a full-fledged storyworld you have N to the power of 2 consequences where N is the number of actors in your storyworld.
Let’s look at the Sappho code behind the Jack SetTalkingToKate consequence. The SetTalkingTo<Actor> requires these parameters.
Actor? is the actor whose TalkingToKate trait we’re setting.
BNumber? is a value (-0.99 to 0.99) that the trait should be set to.
Since Jack is the actor whose trait we’re trying to set, we put in his name for the
Actor? parameter. To determine the BNumber value to set the trait to I use the
SetResetConversation operator for the BNumber? parameter.
SetResetConversation is a custom BNumber method that I’ve created to calculate an appropriate BNumber value based on parameters you pass in to it. The paramaters are:
Actor1?– The actor whose trait you’re trying to set
Actor2?– A 2nd actor, who may or may not be involved in the conversation with Actor1?
greet-Subject?– The subject of the “greet” verb
greet-DirObject– The direct object of the “greet” verb
TalkingToWho?– The trait you’re trying to set
Filling in the parameters with the appropriate values give you this:
Let’s look at the SetResetConversation operator in more detail. Here’s the code at a high level.
If both actors are part of the greet, i.e. Jack greets Kate, the value of 0.99 is returned and Jack’s TalkingToKate is set to 0.99, indicating he’s in a conversation with Kate.
If Jack is part of the greet but Kate is not or Kate is part of the greet and Jack is not, the value of -0.99 is returned. Setting Jack’s TalkingToKate to -0.99 would indicate that he’s not in a conversation with Kate.
If none of the three conditions is true, the operator returns the current value of the actor’s TalkingTo<actor> trait. In this case it would return the value of Jack’s TalkingToKate trait. This is to prevent resetting any other conversations going on between other actors who are not the Subject or Direct Object of the “greet” on the same stage.
The detail behind each section of code is as follows (PartOfGreet, ActorIsPartOfGreet, and ActorIsNotPartOfGreet are custom Boolean methods that I created that take their own parameters).
For those who are interested in the messy gyrations that accompany software development, here are the pages from my Siboot design notebook related to implementing the conversation method outlined above.