I'm in the process of writing a Sim animation editor. On the way I've got here, which whilst it doesn't do much useful for the game, seems worth sharing.
You now have one male, female, boy and girl figure available, plus the dark glasses and floor props.
You can add further choices to the droplists by copying model and texture files (extracted with FarExtract, downloaded from the web, or found in the SimShow GameData folders) into the appropriate SimPose folders. ObjX is a model (.skn) folder and TexX the equivalent texture (skin) folder, where X is: M (male), F (female) B (boy), G (girl) or P (prop). Inside each character folder are three others, for Head, Hand and Body models/textures.
The window is divided into two panels: the righthand panel is the character display, whilst the lefthand panel is a tabbed control with two pages.
The following sections will describe the controls on the two pages, and the menu items.
The main control in this group is a droplist that selects the feature to be controlled: the background colour, the ambient light, the camera, or the three directional lights. Depending upon the feature selected, the four sliders, the check box and 'Change' button become enabled as appropriate.
The required check box: directional lights only (the other three are always required). Is this directional light required?
The 'Change' button: for all but the camera. The patch to the left of the button is the colour associated with the selected feature. Pressing the button displays a standard Windows colour selection box to change that colour.
The remaining four controls, the sliders, control the position of lights and cameras around the characters. The characters can be thought of as being at the centre of a sphere, with the lights/camera positioned on the sphere and pointing in towards them.
The 'Direction' slider moves the lights/camera 360 degrees around the characters (think longitude)
The 'Elevation' slider moves the lights/camera 180 degrees from below the characters to directly overhead (think latitude)
The 'Zoom' slider moves the camera only toward/away from the characters (think radius)
The 'Offset' slider moves the centre of the sphere. Without this, the camera tends to be looking at the characters feet! The centre of view can be moved up and down (useful when zoomed in).
These select the camera angle, and whether or not the characters are rotating on their axis. The NS, SE etc positions are intended to mimic the views of the characters in the game. When a camera position is selected from the droplist, the camera slider controls move to reflect the same position.
When the model is rotating, the spacebar causes the motion to 'single step' on each spacebar press. The return key causes continuous rotation to resume.
The program internally always has two characters loaded: Sim1 and Sim2. However, the user can control which of them is displayed and which is being controlled.
The droplist controls what is displayed: both Sims, or just Sim1 or Sim2. If both are to be displayed, there is the option of having them appear at the same physical position, or at an offset (in effect on adjacent floor tiles). Basically I don’t know how the animations for character interaction are programmed (is the space between the characters part of the animation, or because they are on different tiles?) so I've given the program both options for the moment.
The radio buttons select the Sim to be controlled. If only one Sim is being displayed, then obviously only that Sim can be controlled.
The top droplist lets you select the age and gender of the character controlled (after changing the character type, you may need to step the display (spacebar) or move one of the sliders before the character displays correctly)
The next two droplists select the required body type and texture.
The last two droplists select the required head and texture.
The droplist selects the joint to be modified. The names are fairly self explanatory - but note that not all models have all joints - so some selections may not do anything. Since version 1, I've added the controls for the ROOT and PELVIS. These can have both rotations and translations (i.e. movements in space). You'll see that pretty much the same effects can be achieved with changes to the ROOT and PELVIS. My guess is that the ROOT is used to control the position of the Sim in space (e.g. when walking, the ROOT translation controls how far across a floor tile the Sim has moved), whilst the PELVIS is used to control the position of the Sim relative to objects (e.g. when the Sim sits down, the PELVIS is translated downwards)
The three sliders set the position of the selected joint in the three axes.
The radio buttons select the degree of control the sliders have: Course -180 to +180 degrees, Medium -45 to +45, Fine -10 to +10.
Whenever the radio button selection is changed, or a new joint selected, the sliders return to the mid-position. The sliders give control around the currently set position (i.e. they are not an absolute position - try it you'll soon see what I mean).
If a keyframe animation is being displayed by the controlled Sim, a droplist is provided of all the poses that can be adjusted (indicated by time). The user selects the time for the pose to be adjusted and then the Joint Controls adjust the pose at that point in the animation.
About |
Details of the program's version etc. |
Single Step |
As the space bar - single step animations/rotations |
Go |
As Return - cancel single step mode |
Show Blend Effect |
When checked, joint blending is used - really added so I could see the effect during development - normally leave checked |
Capture Image |
Ignore - not yet working! |
Exit |
Exit program |
New Pose Library |
Create a pose library with two entries - the default pose for an adult and child Sim |
Load Pose Library |
Reload a pose library, previously saved by one of the following commands |
Save Pose Library |
Save the current pose library (overwriting the file it was loaded from) |
Save Pose Library As |
Save the current pose library to a file - user asked to select location |
Select Pose |
The user is presented with a dialog including a droplist of all the poses named in the current library. One of these should be selected and OK pressed. The controlled Sim will move into that pose (may require the space bar hitting, to force the display window to be updated) |
Save Pose to Library |
The controlled Sim's current pose is saved to the pose library. The pose selection dialog is presented to the user. If the user selects a pose name (+OK), that pose is updated in the library (the default poses cannot be changed). If the Add Pose button is pressed, the user is asked for a name for the pose (must be unique), and a new pose is added to the library. This command works in any display mode (static, keyframe or CFP animation). If not static, the pose saved is that at the selected 'adjust time' |
See the notes on keyframe animation below
Load Keyframe Animation |
Load a keyframe animation from a file and apply to the currently selected Sim |
Save Keyframe Animation |
If the currently selected Sim is performing a keyframe animation, modify the animation previously 'Load'ed, else acts as SaveAs |
Save Keyframe Animation As |
If the currently selected Sim is performing a keyframe animation, save the animation to a named file |
Save Animation as CFP file |
Ignore - not yet working! |
New Animation: Bounce |
Make a new keyframe animation and apply it to the currently selected Sim. The user is asked for the length of the animation sequence (in frames, at 30frames/second) and the LinkFrame (from the pose library). Keyframes are created at the start/end of the sequence and the mid-point. |
New Animation: Translate |
Make a new keyframe animation and apply it to the currently selected Sim. The user is asked for the length of the animation sequence (in frames, at 30frames/second) and the start/end LinkFrames (from the pose library). Keyframes are created at the start and end of the sequence and the mid-point. |
Add Keyframe |
If the currently selected Sim is performing a keyframe animation, the user is asked for a time (in frames) and optionally a pose from the library. If no keyframe exists at the indicated time, one is added, otherwise the existing keyframe is modified. If a library pose is selected, the Sim moved to that position at the indicated time, otherwise the keyframe is set as the interpolation between the preceding and following keyframes (i.e. no immediately visible effect, but the pose at that time can now be adjusted) |
Move Keyframe |
If the currently selected Sim is performing a keyframe animation, the user is asked for the new location (in time) of the keyframe selected by the AnimationTime droplist. The keyframe is moved to that time. Note: a keyframes cannot be reordered this way, i.e. a keyframe cannot be moved to or before the preceding keyframe or to or after the next keyframe. |
Scale Keyframe |
If the currently selected Sim is performing a keyframe animation, the user is asked for a new sequence length (in frames) and the animation speeded up or slowed down to fit the new length |
Ignore all these items for now.
Change Left hand |
The user is presented with a dialog, in which they can select the mesh and texture to be used as the controlled Sim's left hand. |
Change Right hand |
The user is presented with a dialog, in which they can select the mesh and texture to be used as the controlled Sim's right hand. |
Clear Props |
Any props attached to the controlled Sim are removed. |
Add Prop |
The user is presented with a dialog, in which they can select the mesh and texture of a prop to be added to the controlled Sim. There is a limit on the total number of props that can be added to any one Sim - currently set as 4. |
These have been added to enable new 'props' (hats, carried objects etc) to be generated - see the notes on creating new props below.
Export OBJ |
The currently selected Sim, with any attached props, is exported as a Wavefront 3D object. |
Import OBJ |
A Wavefront 3D object is imported and attached to the currently selected Sim as a prop |
Export Head SKN |
The currently selected Sim's head mesh is exported as a SKN file (not really very useful - as you must have already had a SKN for the head!) |
Export Body SKN |
as above - for the body mesh |
Export Left-hand SKN |
as above for the left hand mesh |
Export Right-hand SKN |
as above for the right hand mesh |
Export Prop SKN |
The mesh of the first prop attached to the currently selected Sim is exported as a SKN file. This is useful, as the prop may have been created by 'Import OBJ' |
The term keyframe comes from traditional animation techniques (think Disney). A skilled artist would draw a character in significant positions (keyframes) to establish a movement (e.g sat in a chair, halfway out the chair, standing by the chair). A less skilled artist then performed the 'tweening', drawing the character in the positions between the keyframes, to get the required number of drawings for smooth movement over the timing of the action. So if the animation is to be shown at 25frames/second, if the keyframes were half a second apart, the 'tweener' would have to supply the other 12 frames.
The term keyframe has been adopted by the computer animation community, were an animation is stored as a series of keyframe poses, and the computer works out the intermediary positions to achieve smooth motion. In the diagram below, the vertical lines represent points in time where the computer will generate a display. The blue and green lines and dots represent the required value of some parameter defined in various keyframes. The black dots represent the intermediate values calculated for the other frames, and the red line is the apparent 'path' seen on the display.
There is one big difference between traditional animation and animation for computer games. In a film animation there is a single planned sequence of activities for the characters. In any scene, the animator always knows what the character will be doing next, and so how the animation needs to develop. In a game however, the action of a character is determined by the player (or by a choice made by the computer). For example, a Sim might be standing waiting, it could then: walk away, start dancing or start talking. The game stores these separate activities (standing, walking, dancing, talking etc) as separate animation files (CFPs). In order that the animation looks smooth, the end pose of an animation must be the same as the starting pose of all the animations that can follow it. I've called these poses/keyframes at start/end of an animation LinkFrames (if anybody knows a more generally agreed term for this idea I'd be pleased to hear from them).
The diagram above is a typical 'Translation' keyframe animation. It starts at one Linkframe (shown in blue), then after 3 intermediary keyframes (green) arrives at the end Linkframe (blue). In the example above, the length of the sequence is 18 frames, with the computer calculating the 13 intermediary positions (black). The important feature of the translation is that the start and end Linkframes are not necessarily the same, and that no assumptions are made about the intervening keyframes.
Looking at the CFP files, it is clear that the SIMs engine also supports animation where the activity is defined by half the number of frames you'd expect. I'm assuming that this is for symmetrical activities. That is those where the Sim moves through one set of motions, then the same set of motions in reverse, to return to the same Linkframe position. I'm calling this a 'Bounce' action.
A bounce action is defined by the end Linkframe and the keyframes between that and a keyframe at half the sequence length. For example, in the diagram below the left-hand half is defined by the user, then the computer calculates the mirrored right-hand half.
In order to create props, you'll need a 3D editing tool that can import and export Wavefront (OBJ) objects, or a 3d file format converter that can convert Wavefront objects into a format that your editor does know about.
Its important that the editor (and file format converter if used) maintains the object's 'face normal' data, which ironically means that my Wavefront editor, GMEdit (available on BBay for a mere $35) won’t do because it ignores normals (GMEdit was written for Poser, and Poser doesn’t use the normals data).
This is a bit fiddley, but following these steps should achieve the desired result (its actually easier than it sounds!)
As an example, I'll run through the process I used to create the floor prop supplied with V4.0
In the above examples the created objects are assumed to be attached to a single body part. However, there is no reason why different bits shouldn’t be attached to different parts. You might make a backpack that bends with the spine, or a glass and bottle that can be held one in each hand (though stored as a single object). However, this does require some degree of understanding about the way Wavefront objects are constructed.
The "g" commands in the OBJ format control which faces belong to which group, and so which faces become attached to which body parts. In the glass and bottle example, If the glass is to be in the right hand, the set of faces that constitute the glass should be preceded by a "g R_HAND" statement. Similarly the faces of the bottle should be preceded by "g L_HAND" - the easiest way to do this is to get the editor to create the glass and bottle as separate groups, and then edit as in step 5, but replace the names by "L_HAND" or "R_HAND" as required.
These need information I don’t currently have:
There are NO promises as to when (or if) such enhancements will become available
Contact me here: sim@pygott.demon.co.uk