\documentstyle[ncs,11pt]{cmu-art}

\widowpenalty=10000

\title{Suggestions for Demo of Cat World}
\author{}

\begin{document}

\maketitle

Please read ahead of time to get general idea, then use as a reference
during demo itself.  

\section*{Phase 1: Cat wanders around.}

Just after you type (oz) the cat will wander around to learn it's
environment.  (The player is not yet in the world.)  This initial
script allows Lyotard to build up the information he would have from
having been in this house for a few hours or days before the player
arrives on the scene.  This takes about 10 ticks.  This is an example
of highly scripted behavior in HAP.

Lyotard starts up without specific knowledge about this world.  By
walking around and sensing normally as he goes, his sensory routines
and integrated sense model have a chance to learn such details as how
the house is connected, where his bowl is (he knows what his bowl looks
like presumably from having seen it in his last house), where the
windows are, etc.


\section*{Phase 2: Watch cat's actions from afar while exploring world ourselves.}

When you get a player prompt, first set *trace-hap-goals* to true.
This allows you to see the mental actions of the hap engine in the
cat.  During this phase, do some physical world things, such as taking
and dropping the mouse, walking around, and kicking the plant.
Meanwhile, watch the hap goal creation, failure, and success as
Lyotard decides what to do.

The keyword "avoid-loop-killer" will show up in the trace, as will
cryptic goals such as "par-cond-356".  These are all the result of
macro expansions of the "cond", "par-cond", "demon" and "let" forms.
You can usually tell what goal they are in pursuit of by looking at
the previous goal.  The "avoid-loop-killer" variable is present to
prevent the architecture from removing the goals created by these
macros because it thinks they are futile loops.

When we ran through this a few times, it seemed that Hap tracing got
to be overwhelming after a while.  So, you may choose to turn it off
and on at select times if this is the case.  For example, the last
time I ran the demo, I turned off Hap tracing soon after I started
Phase 4, then turned it on when Lyotard started eating, so that I
could show the success of his want-to-eat goal causing him to become
happy.


\section*{Phase 3: Watch cat's emotions from afar.}

When phase 2 is no longer interesting, move to phase 3.  Start tracing
the emotions in addition to the actions by setting *debug-emotions* to
t.  The emotional trace gives the list of current features.  It also
gives the intensity and direction of anger and fear.  It finally gives
yes/no status of happy, sad, like, and dislike.

\section*{Phase 4: Interact with the cat to influence its actions and emotions.}

Next try to make the cat like you.  You might not be too quick about
it, since it is interesting to watch it when it is afraid of you as
well.  It will be interesting to see how the cat's emotions grow more
friendly (it likes you more) when you do things like call it, pet it,
or feed it.  Actually because of a bug in the version that we sent to
you [which is now fixed in the version here], only calling the cat
will make it like you more, but petting and feeding it will make it
happy, and therefore friendly and content.  Petting (or in any way
touching the cat) when it is aggressive or ignoring will make it angry
and dislike you more because the cat doesn't like being touched when
he in the wrong mood.  Obviously, kicking, biting, scratching,
hitting, throwing, and throwing things at the cat will make it angry
and dislike you more.

In general, accomplishing important goals makes the cat happy,
grateful, and like the person responsible more and failing to
accomplish these goals makes the cat sad, reproachful, and dislike the
person responsible more.  In reality, this is true except that like is
never changed by goal success and dislike only changes when you hurt
the cat or touch it when it's in the wrong mood.  The emotions are
updated properly for all important goals, which include not being
hurt, not being touched when aggressive/ignoring, being fed when
hungry, destroying things when mad, cleaning himself, hanging out in a
comfy place, transferring aggression to the mouse, being held by
someone he likes, and being petted.

The cat feels like/dislike on a [-2,+2] scale with changes in unit
increments; this means that you should never have to call the cat more
than three times to make him actually like you.  Similarly, you may
need to hit the cat a couple of times to make him dislike you if he is
really fond of you.  The cat starts of in a like state of -1.  Both
liking and disliking lead to some interesting behaviors, so allow a
little time in both states to demonstrate some range of behaviors.

Emotions in the cat are made to decay fairly quickly with time, so
extreme emotions which you cause will go away fairly quickly when the
player is in another room.  You can see this by watching the intensity
of fear, anger, and gratitude drop in the Em debugging information.

\newpage
\section*{Finding out more about emotions (do any time it seems right)}

To get a deeper understanding of the emotions, you can explore the
reasons for a given emotion.  A good time to try this is when Lyotard
starts purring, which should happen before long.

Here is what to do to examine the emotions:

List of current behavioral features: 
\begin{verbatim}
(slot features (slot em lyotard))
\end{verbatim}

Determine whether a given emotion is present:
\begin{verbatim}
(call feel-<emotion> (slot em lyotard))
\end{verbatim}
For happy, sad, love, hate, reproach this will return t/nil.  For
fear, anger, gratitude this will return intensity and sense-node of
object of the emotion.
    
To go yet further in depth into the causes of specific emotions, you
can look at the actual lists of affects.  These lists are kept as
slots in Em named <emotion>-affects, where <emotion> can be joy,
distress, love, hate, fear, anger, gratitude, reproach.  These lists
are sorted by intensity, so you really only need to look at first few
affects in this list to get the useful info.  Each of the affects in
these lists will have an intensity slot that is the current intensity
of that affect.  Also, there will be slots giving some insight into
the cause of the emotion.  For example, joy affects will have a goal
slot that has the goal whose success caused that affect to be
generated.  In this case, it will often be a hap-goal-node that can be
printed out using (poo <object>) to get at useful information about
the goal.  Or you can just look at the goal-expression slot of the
goal object.
  

\section*{Interesting Scenarios to mix and match:}

\begin{itemize}

\item
When the cat decides to purr it can be interesting to see why.  Look
at the info above to see how to find out this information.  Two of the
goals which could cause the cat to be happy print out as par-goal-347
or some such.  These two are "hanging out in a comfortable place" and
"transferring aggression to the mouse".  You can easily tell which is
going on by the actions of the cat.

\item
Bouncing the ball or the mouse near the cat, to get it to play with
it.  (The ball and mouse start out in the kitchen.)  You should see
the final note on the ball, though.

\item
Petting him or picking him up and carrying him when he likes you.

\item
Bothering him when he is ignoring you or doesn't like you.

\item
If he gets hungry when he is also afraid of you, he will suppress his
fear until he eats a bit.  Then when his hunger no longer dominates,
he pays attention to his fear and reacts to it (usually by threatening
you or running away.)

\item
You might want to feed the cat at some point.  You should notice that
the ``catfood''s lying around are containers, so you should open them,
and then pour them into the bowl (or whereever).

\end{itemize}

\section*{Final Notes:}

Needless to say, this demo is not perfect.  Here are a couple of
things to avoid doing to keep the demo going smoothly:

\begin{itemize}

\item speech is not recognized at all by Lyotard.  the call act is used
  instead to interact verbally with him.

\item you can't call Lyotard until you see him.

\item Lyotard is a little too fascinated with moving objects, and the ball
  moves a lot when it gets started bouncing.  So after a while you may
  want to take the ball away to go on to other behavior.  If there
  were a way to make the ball stop bouncing that would work as well.

\item When Lyotard is afraid of you, it is too easy to make him really
  terrified of you.  When this happens he gets paralyzed with fear and
  squishes down indefinitely.  You can stop this by calling him a few
  times (so he likes you more) or stepping out of the room (so his
  fear subsides).

\end{itemize}

\end{document}




