Archive for August, 2007

23
Aug
07

performance anxiety

Andrew Stern (of Façade fame) has just added me to the GTA blogroll.  So to any of you who are coming over from GTA, just let me reiterate that I’m using this blog to work through my accumulated supply of half-baked ideas and apologize for the inevitable incoherence and idiosyncrasy that goes along with that.

Oy, the pressure.  But thanks nonetheless, Andrew.

Advertisements
22
Aug
07

make love, not war

image

I was working yesterday on adding fighting behavior to my procedural character animation.  In particular, I wanted the kids to be able to shove one another around.  But due to a bug they kept approaching one another rather than stopping at “shoving distance.”  So they grapple in what looks like a particularly comical make-out session.  Possibly useful, but best saved for the parent characters…

22
Aug
07

what is anxiety anyway?

I’ve been trying to think about anxiety recently.  I want to argue that anxiety is part of a broader meta-level control system involved in risk assessment.  The obvious scientific response to this would be something along the lines of “well, duh.”  But I’ve had a great deal of difficulty articulating exactly what I mean to my friends.  So I’m writing this overly long post to try to work through it.  I’ll try using two different analogies, but first I’ll try to give some motivating background.

Continue reading ‘what is anxiety anyway?’

04
Aug
07

believability and attributional intentionality

image

Robot hackers have long realized that human observers tend to over-attribute intelligence, or at least intentionality, to robots, at least provided that they’re moving.  (Dave) Miller’s law states that the perceived intelligence of a robot is directly proportional to its velocity (Dave didn’t name this Miller’s law, but he said it once at a workshop and I’m fond of quoting it).

The image above is a screenshot of what appears to be two child characters playing with one another while being watched by an adult.  However, in actuality, what I’ve been implementing is attachment behavior, which is the response of children to stress by seeking out their caregiver (more on this another day).  To implement that, I need to have something to stress the kids out.  The right way to do it is to implement a real social engagement system with wariness and coy behaviors, play, turn-taking, etc.  However, the first step in that is simply to make a second child and then hack the children’s appraisal systems to assign negative valence to strangers (i.e. to each other).  All that does is make the kids watch one another and keep their distance from one another.  For example, one won’t approach the ball if the other is too close to it.  There’s no real sociality going on there.

The interesting thing is that it’s enough to make them look like they’re playing.  They both run to the ball, but then when one gets to close to it, the other backs off.  The first one will kick it until it happens to kick it toward the other one (which is pretty frequent since I haven’t implemented aiming).  At that point, the first one stays away from the ball and the second one plays with it.  This continues until they get far enough from the parent to engage the attachment system, at which point the attached child runs to the parent and hugs him/her, then runs back to play.

The point of this isn’t that this is a good simulation of anything, just that surprisingly simple behavior can appear engaging and intelligent, provided that whatever behavior you do have is relatively fluent.

04
Aug
07

character physics made easy

image 

One of the annoying problems with wanting to do AI for virtual characters is that those characters can’t really do much without bodies.  But giving them bodies means wading into all that bothersome graphics and physics.  If you’ve ever read a paper on hardcore physics simulation, it’s pretty daunting, especially when you think about trying to run it at frame rate.

Probably the single most useful paper I’ve read this summer has been Thomas Jakobsen’s 2001 GDC paper on Advanced Character Physics in the Hitman engine.  Jakobsen talks about how to implement believable ragdoll physics by basically ignoring angular momentum and modeling rigid and articulated objects as particles (with only linear momentum) connected by rigid constraints.  By using a combination of techniques – Verlet integration and constraint satisfaction by projection – you can make a system that’s easy to implement, runs quite fast, and looks pretty good.  I was able to implement a basic engine in about 800 lines of C# code and an acceptable procedural animation system in another 600 lines or so (I’m particularly proud of the hugging behavior shown above).  It took me about a week of hacking, which is pretty good given that it was only my third 3D graphics program.  I highly recommend Jakobsen’s paper.

04
Aug
07

the polyvagal theory of the autonomic nervous system

I just finished reading a paper by Stephen Porges on the Polyvagal theory.  It’s very cool.  Here’s my attempt as a non-specialist to summarize it.  The traditional view of the autonomic nervous system is that it has two opposing processes, the sympathetic and the parasympathetic systems, which speed up and slow down the heart, respectively, as well as shifting metabolic resources between organs.  The sympathetic system, which is stimulated in part by the perception of threat, raises heart rate and metabolism, and shifts energy to the brain and muscles, thus preparing the body for a fight-or-flight respond to the perceived thread.  The parasympathetic system acts through the vagus nerve to slow the heart rate and/or shift resources to the gut to aid in digestion.

Porges makes two arguments about the vagal (parasympathetic) system:

  • The vagal system isn’t just used for reallocating energy resources during rest and digestion, but it’s also part of the neural substrate for the freeze response (a different, and in fact phylogenetically older, threat response).
  • In mammals, the vagal system is split into two systems – the older dorsal system and a newer ventral system.  This newer system is also connected to facials, vocal, and neck muscles, and forms part of the social engagement system, a newer threat response system that’s only present in (social) mammals.

He argues that the autonomic system’s threat responses are organized roughly as a Brooksian subsumption hierarchy, with phylogenetically newer systems overriding older systems in when they conflict.  This is interesting if you’re interested in biologically-based AI because it gives us a much better understanding of the low-level threat-response systems and also shows that social behavior is wired in at surprisingly low levels.

Porges also makes two claims that as far as I can tell are logically independent of the poly-vagal theory, but which are nonetheless interesting.  One is that the (rare) phenomenon of voodoo death, in which people are literally scared to death, is not actually due to overactivation of the sympathetic nervous system overdriving the heart, but rather to the overactivation of the older parasympathetic (in this case, the dorsal system) slowing the heart down to the point where it can no longer supply enough oxygen for itself, much less the brain.  This apparently better matches the experimental results in a rather horrible rat experiment that was done in the 50s.  The claim is that it’s a case of a response that was adaptive for older species being carried over to mammals, in whom it is fatal because of their higher metabolic requirements.

The other claim is based on the observation that there are muscles in the inner ear, which modulate its mechanical properties so as to accentuate or attenuate certain frequencies, in particular, the frequencies associated with the human vocal tract.  He proposes that in at least some cases of developmental disorders involving lack of social engagement, it could be because of understimulation of these muscles, making it harder for children to attend to human voice, and thereby leading to understimulation of the social engagement system.  The description of the experiment in the paper is vague and I haven’t followed up to read the real papers on it, but he found that when he played computer-generated sounds that emphasized frequencies in the range of human speech, most of the children showed “noticable improvements in social behavior and communication skills following the intervention.”  Amazing.