Jump to content

Sonic Adventure/Character Faces

From SA Docs
Revision as of 23:31, 13 November 2025 by Speeps (talk | contribs) (Created page with "right|320px|Faces The expressions characters make in events can be loaded at any time, in contrast to later entries in the series where they're baked into cutscenes. ==Faces in Events== In events, face animations are called using <code>void EV_SetFace(task *tp, char *str)</code>. The parameters are player's Task and a character string that creates a queue of animations to play, with each letter representing an animation. The strings are cas...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Faces
Faces

The expressions characters make in events can be loaded at any time, in contrast to later entries in the series where they're baked into cutscenes.

Faces in Events

In events, face animations are called using void EV_SetFace(task *tp, char *str). The parameters are player's Task and a character string that creates a queue of animations to play, with each letter representing an animation. The strings are case-sensitive: A-Z (Uppercase) and a-e (lowercase). The list of faces is called faceTbl (PC: 0x91D010).

There are two heads the player uses - one for gameplay and one for performing these expressions. Once the animation ends, the player's head doesn't reset to the gameplay one automatically. Usually, the game uses void EV_ClrFace(task *tp) to reset it. However, putting the number 0 at the end of the EV_SetFace string - it's a unique character that tells the game to reset the player's head.

Resetting the head after playing an animation is recommended, as the event head constantly plays a blinking animation when it's loaded.

Faces in Gameplay

When the game uses faces outside events, it uses void PFaceChange(Sint32 pno, Sint32 faceno). This one is less complex than the event version because it can only read one face and is given an ID to read directly instead of forming a queue through a string. However, it resets the head automatically afterwards, though it can also be reset using void PFaceCancel(Sint32 pno). Due to the game being slowed down to play events, all face animations look very fast outside events.

Faces outside events are only used in 3 situations:

  • When the player is hurt.
  • When Sonic, Tails or Knuckles are frozen*.
  • The scene at the beginning of Icecap 3.

* The only way to be frozen (Attacked by an Ice Ball enemy) is only accessible to Sonic. 2P Tails can't be frozen and Knuckles doesn't go to Icecap.

Structs

There are two main face structs. The two functions to change the face use different ones, but they're both used when the game processes the animation itself.

The struct EV_SetFace uses is facewk, found in playertwp[id]->ewp->face (NOTE: There is no old struct version of eventwk, but ewp is known as field_3C in EntityData1).

Faces are always interpolating to the next one, so to create a static face the game makes a single animation play multiple times.

struct facewk {
 char old;		//Previous face, or 1st frame in the interpolation.
 char __new;		//Next face, or last frame in the interpolation.
 Sint16 nbFrame;	//Number of frames the interpolation lasts
 Sint16 frame;		//Current frame in the interpolation.
 char *dataPtr;		//Stores the string given by EV_SetFace.
 FACETBL *tablePtr;	//Face array, usually facetbl.
}

The struct PFaceChange uses is PL_FACE, found in playerpwp[id]->pfp (offset 0x70, known as SomePointer in CharObj2).

struct PL_FACE
{
 char lastface;
 char face;
 char reqface;
 char tblpoint;
 Float frame;
 Float framespeed;
 FACETBL *tbl;				//Face array, usually facetbl.
 NJS_OBJECT *sibling;		
 NJS_OBJECT *faceorg;
 NJS_OBJECT *facebuf;
 NJS_MOTION *facetypes;
}

Processing the faces is done in void PlayerFaceMotionExec(task *tp) (PC: 0x440560).

Raw Expressions

Each entry in facetbl is an array of the following struct:

struct FACETBL
{
 char nbFrame;
 char faceNo;
}

For Sonic, Tails, Knuckles, Amy and Tikal, there are 20 raw expressions that faceNo can use. While it's possible through directly editing pwp->pfp or ewp->face, the game doesn't have a way to manually fix the character on one face - it can only play animations through the methods given above.

Dreamcast
SADX

Eggman and Gamma don't have faces and nothing happens if they're told to use one. Big is a unique case, as he has facial expressions but they exist in an incomplete state - he only has 6, and his regular head model isn't removed when he uses them, making him look like he has two mouths.

Some faces are rare, only used by specific characters, or not used at all:

  • 10 (Row 3, Column 1) is unreferenced.
  • 11 (Row 3, Column 1), for Sonic and Knuckles is only visible as the first frame of their hurt animation.
  • 12 (Row 3, Column 3) is only used in animations played by Tails and Amy.
  • 18 (Row 4, Column 4) is only referenced by the animation 'c', which is unused.

Animation List

This is a list of face animations, their number (for PFaceChange) and string character (for EV_SetFace). Some of them are rare or unused, which have been marked accordingly.

ID Char Used? Description
0 A Yes No expression.
1 B Yes Blink.
2 C Yes Talking. Commonly used with D and E.
3 D Yes Talking. Commonly used with C and E.
4 E Yes Talking. Commonly used with C and D.
5 F Yes Talking ("Something Buggin' You?" animation)
6 G Yes Talking
7 H Yes Blink->Surprised->Buggin animation.
8 I Yes Hurt/Surprised expression. Also triggered when taking damage in gameplay.
9 J Yes Slow Shock expression. ("Watch out! You're gonna crash! Aah!" animation)
10 K Yes Closes eyes for a few seconds.
11 L Yes Closes eyes: Same as K but shorter.
12 M Yes (Rare) Slow Surprised expression.
13 N Yes Sad expression.
14 O Yes Very Sad expression.
15 P Yes Happy expression.
16 Q No Very Happy expression.
17 R Yes (Rare) Slow Surprsied expression. Similar to M but slower.
18 S Yes (Rare) Talking animation
19 T Yes (Rare) Half-closed eyelids.
20 U Yes (Rare) Half of a slow blink animation.
21 V Yes Closed eyes.
22 W Yes Sleepy eyelids animation.
23 X Yes Opening eyes.
24 Y No Quarter-closed eyelids.
25 Z Yes Surprised expression.
26 a Yes (Rare) Sad expression. Only used by Amy in EV0072.
27 b Yes Happy expression.
28 c No Side mouth expression.
29 d No Side mouth expression.
30 e Yes (Rare) Surprised expression. Only used while frozen in Icecap.


Sonic Adventure Information
General Information File FormatsLevel ListTexture FilesGame BuildsCAM & SET Files
Character Information Character ListActionsAnimation ListsFaces
Sound Information General Voice ListMusic Files
Sound Effects Stage SoundsStage Background Sounds
Other Cutscene ListFish List