Head Phaking, Phase 1

Demo of The Sims character animation, and early design description of “head phaking” feature (November 17, 1998).

Image for post
Image for post
The Sims Head Faking in the Hot Tub

The Sims Character Animation Demo starts at 17:40:

The Sims Character Animation Demo starts at 17:40

From: Don Hopkins
To: Chris Trottier
Date: Tuesday, November 17, 1998 7:57 AM
Subject: Head Phaking, phase 1

I’ve implemented a preliminary cut at head faking, and hooked up the “look at” primitive!

It’s not content based yet (it procedurally turns just the head, up to a certain amount), nor have I finished adjusting it, but it basically works!

The ideal content based approach (which we can move to if the current implementation doesn’t look good enough) could use an artist-supplied animation of the head (and possibly other bones like the shoulders) turning from the left most extreme to the right most extreme, so the artist could control the extremes and the timing (slowing down the turn as it nears the extremes), but right now those parameters are adjustable constants wired into the code. The head will turn up to 90 degrees to the left or right.

If you tell the person to look at something that is not in their range, their head will smoothly turn until it hits the extreme, then smoothly turn back to normal (canceling the look-at mode). If it is within their range, they will smoothly turn to look at it, and track it as they move around. If the object they’re tracking is moving as well, it must call the “look at” primitive
again and again as it moves, since it just sets a 3 dimensional vector in the person.

I added a test item (“Watch”) to the fountain to test head faking, that just makes the person look at the fountain, no matter where they are.

We need to enhance the “look at” primitive to have a “cancel look at” command, to make the person stop looking at something.

Also it could pass in a few flags to control the behavior, when it finishes looking at something (that is, when it’s finished turning and is looking directly at the target), and when it hits an extreme without looking at the target (so the tree code could decide to make a standing person turn around to look at something they’re really interested in). Probably it would be simplest to pass those arguments through some new person state variables.

The state machine could communicate these events back to the tree code
by setting flags in the person state.

The cool thing to do now would be to make the people in the hot tub look at each other!

But it occurs to me that the “look at stack object” command looks at the object’s location on the grid, and that might not be the place you expect it to be for the people in the hot tub. Maybe the “look at stack object” code could check to see if the stack object was a person, and if so, scramble around to get the actual location of the person’s head or something.

I will hold off checking this stuff in until I’m sure it won’t destabilize the build!


From: Don Hopkins
To: Chris Trottier
Date: Wednesday, December 09, 1998 4:33 PM
Subject: Recording & playing back character animation

I’ve added a character animation recording feature to the Animation dialog in Edith!

The Animation dialog lets you view all the different loaded animations on any skeleton with any suit.

Now it has a “Record” button at the bottom, as well as a menu to select which character to record, and a text/spin numeric field to specify how many ticks to record.

Select a character, modify the number of ticks to record if you want, and press record.

A new skill is dynamically created and added to the scrolling list of skills,
named “!<character name>-<id>”, like “!ross-0” or “!mercedes-1”.

It records the full body motion of the character for the duration of the tick counter, the end result of mixing all skills and applying the head faking.

The ticks in the record duration field count down to zero, and when it’s zero, it stops recording.

You can then play back the new skill you’ve created on one of the demo skeletons!

I will put more playback controls in, so it’s possible to precisely single step and examine every frame of animation, as well as an event log.

I will also record events like the beginning and ending of every skill it plays, and other interesting events like xevents and footsteps, so we can analyze after the fact what caused glitches in the animations. Right now the base coordinate system of the person is not recorded, so the playback is relative in place and the feet slide when walking. I will teach it to record the absolute person position (or displacement and rotation of the person relative to the start of the animation) in another track so you can play that back and analyze it as well.


From: Hopkins, Don
Sent: Thursday, December 10, 1998 8:33 AM
To: MAXIS CTG @ Maxis
Subject: recording and playing back character animation

The edith character animation browser dialog now supports frame by frame playback and new speed control buttons.

It has a text field with the frame number, and a spin control that increments and decrements the frame number.

And there are three buttons for playing backwards, halting, and playing forwards.

So you have much better control over the playback of any practice,.including practices you record from the characters!

There’s an event log list now, but it’s not hooked up yet. It will let you scroll through all the events in the animation.

And when you record some character animation, it will inject all kinds of informative events into that event stream, like begin and end animation names, blending info, footsteps, xevents, etc.

Next step is to dynamically make up an extra bone to represent the base translation and rotation, containing the normal root of the skeleton, and record the vitaboy position in that track, so when you play it back it remembers the position and rotation of the body (which normally isn’t represented by a bone, but making a fake bone to represent the outside position and rotation of the whole body, and recording a motion track for that, seems like the cleanest way to keep track of it.)


From: Don Hopkins
Date: Wednesday, January 27, 1999 2:35 PM
Subject: RE: Luc feedback to check into

Heads appear to be turning more than 180 degrees. (I wanna see this.). Mike, this might be something for you to dig into if no one has seen the problem yet. You could try to created & show one of the programmers, Don? Or Patrick?

Oops, my bug, now fixed! I was tinkering with the head faking to get it to record properly, and checked it in before I was done. Sorry!

The head faking uses a low level matrix rotation applied to the bone’s matrix transformation, but the animation recording captures the higher level quaternion rotations and offsets, so recording of head faking doesn’t work.

I will fix head faking to apply rotations to the quaternion rotations instead, so recording head faking will work, and the math will be cleaner when we want to add vertical head faking (so someone sitting in a seat and someone standing in front of them can look at each other while having a conversation).

The nodding and shaking heads in the pie menus use concatenated roll/pitch/yaw matrix rotations instead of mixing quaternions, and I don’t think it looks very realistic because of that… You can see the distortion when you make then look up or down and shake their head, or left or right and nod their head.

I think mixing quaternion rotations would look better than concatenating rotations, for the head faking and the heads in the pie menus.

When you use quaternions to mix an extreme left turned head with an extreme up turned head, the combined rotation is not as extreme and off kilter as when you concatenate those rotations.


Written by

User interface flower child. Pie menus, PizzaTool, SimCity, The Sims, Visual Programming, VR, AR, Unity3D / JavaScript bridge.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store