Head Animation Tutorial: Difference between revisions
No edit summary |
No edit summary |
||
| (7 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
[[head ani|Head animations]] are one of the more finicky things to deal with in Freespace | [[head ani|Head animations]] are one of the more finicky things to deal with in Freespace. It's actually not as hard as it looks. In essence, a head animation is an animated PNG (or .ani, more on that later) that the engine plays every time that | ||
==Terran talking heads== | ==Terran talking heads== | ||
* Create a short MP4 video - 8 seconds long of a person talking. You can use any MP4 video for this. For my [[No Tea's Retro Anis|retro-style heads]] and [[No Tea's Modern Anis]] I used [https://firefly.adobe.com/ Adobe Firefly's] video generator with Google's Veo 3.1 model. You'll obviously have to tweak it to your liking. A sample prompt for retro head generation is: | |||
''a light-skinned woman with a braid wearing a futuristic, minimalistic, light-colored uniform in a starship hallway. the woman has a neutral expression and is wearing a headset. the woman is talking continuously into the camera. the video is in greyscale with scan lines. the video is from a 3D playstation 1 game from 1999.'' | ** ''a light-skinned woman with a braid wearing a futuristic, minimalistic, light-colored uniform in a starship hallway. the woman has a neutral expression and is wearing a headset. the woman is talking continuously into the camera. the video is in greyscale with scan lines. the video is from a 3D playstation 1 game from 1999.'' | ||
* Downsize the video to 160 x 120. Yes, that's very, very small, and it's what's required by the Freespace engine. [http://ezgif.com EZGif] has good online, easy-to-use video tools for this. | |||
* Divide the shrunken video into three 2.66 second files. EZGif also works for this. (Head animations must be in sets of three.) | |||
* Convert the three files into APNG. Again, EZGif.com is great at this for beginners. I also converted any color videos to grayscale. | |||
* Drop the files into your mod's ''/data/hud'' folder. | |||
* Make sure your file names are appropriate for Freespace 2. In most cases, the Freespace engine requires you to use a mandatory file naming scheme of ''filenameA.png'', ''filenameB.png'' and ''filenameC.png''. The A and B files are used for normal chatter. The C file is unique: in pilot heads, it's used for the death animation. In other heads, it's used for normal chatter as well. Samples are included below. | |||
[[File:Head ani file naming scheme.png]] | [[File:Head ani file naming scheme.png]] | ||
* Extra step for pilot death heads: I created my death animations by doubling the speed of original animation, and stitching a "transmission lost" video to the end. EZGif has tools for this. | |||
[[File:uef-f-3-asianA.png]] | [[File:uef-f-3-asianA.png]] | ||
| Line 44: | Line 44: | ||
4. Once you have a suitable video, follow the instructions for Terran anis. | 4. Once you have a suitable video, follow the instructions for Terran anis. | ||
==Conversion to ANI format== | |||
Now, animated PNGs are a pretty fat file format compared to traditional video. The head animation pack I put to together is a gigabyte for 128 animations. To reduce the file size you can use [https://github.com/MjnMixael/AnimStudio AnimStudio] by MJNMixael. | |||
== Alternative naming and playback (FSO 25.0.0+) == | |||
FSO 25.0.0 and newer support an alternative to the legacy a/b/c naming convention. This was introduced in [https://github.com/scp-fs2open/fs2open.github.com/pull/6338 Upgrade head ani handling]. | |||
Create a file such as <code>head-settings-msg.tbm</code> in the mod's <code>data/tables/</code> directory: | |||
<pre> | |||
#Message Settings | |||
$Use newer head ani suffix features: YES | |||
#End | |||
</pre> | |||
Place the animations in <code>data/hud/</code>, using these filename stems: | |||
* <code>Head-example-reg</code> — normal communication. | |||
* <code>Head-example-death</code> — the built-in death-scream message for a non-Command persona. | |||
Keep the message's animation reference as <code>Head-example</code>. FSO appends the appropriate suffix before loading the animation. Command personas, and messages without a persona, use <code>-reg</code>. | |||
The setting defaults to NO and applies globally to automatic suffix selection. Convert any heads that rely on the legacy a/b/c selection, including those supplied by dependencies. An existing unsuffixed animation bypasses suffix selection, so do not supply <code>Head-example</code> as an actual animation when using this mechanism. | |||
Knossos users must ensure the mod launches FSO 25.0.0 or newer. | |||
==Following the voice duration == | |||
The separate <code>$Always loop head anis:</code> setting makes normal comm animations loop while the voice plays and stop when the engine considers the voice finished. To enable both features, use: | |||
<pre> | |||
#Message Settings | |||
$Always loop head anis: YES | |||
$Use newer head ani suffix features: YES | |||
#End | |||
</pre> | |||
Keep the settings in the order shown. Death-scream messages are excluded from this normal voice-following playback path. | |||
See [https://github.com/scp-fs2open/fs2open.github.com/blob/release_25_0_0/code/hud/hudmessage.cpp#L1241-L1249 the upstream playback implementation]. | |||
[[Category:Tutorials]] [[Category:FRED]] | [[Category:Tutorials]] [[Category:FRED]] | ||
Latest revision as of 21:37, 27 October 2026
Head animations are one of the more finicky things to deal with in Freespace. It's actually not as hard as it looks. In essence, a head animation is an animated PNG (or .ani, more on that later) that the engine plays every time that
Terran talking heads
- Create a short MP4 video - 8 seconds long of a person talking. You can use any MP4 video for this. For my retro-style heads and No Tea's Modern Anis I used Adobe Firefly's video generator with Google's Veo 3.1 model. You'll obviously have to tweak it to your liking. A sample prompt for retro head generation is:
- a light-skinned woman with a braid wearing a futuristic, minimalistic, light-colored uniform in a starship hallway. the woman has a neutral expression and is wearing a headset. the woman is talking continuously into the camera. the video is in greyscale with scan lines. the video is from a 3D playstation 1 game from 1999.
- Downsize the video to 160 x 120. Yes, that's very, very small, and it's what's required by the Freespace engine. EZGif has good online, easy-to-use video tools for this.
- Divide the shrunken video into three 2.66 second files. EZGif also works for this. (Head animations must be in sets of three.)
- Convert the three files into APNG. Again, EZGif.com is great at this for beginners. I also converted any color videos to grayscale.
- Drop the files into your mod's /data/hud folder.
- Make sure your file names are appropriate for Freespace 2. In most cases, the Freespace engine requires you to use a mandatory file naming scheme of filenameA.png, filenameB.png and filenameC.png. The A and B files are used for normal chatter. The C file is unique: in pilot heads, it's used for the death animation. In other heads, it's used for normal chatter as well. Samples are included below.
- Extra step for pilot death heads: I created my death animations by doubling the speed of original animation, and stitching a "transmission lost" video to the end. EZGif has tools for this.
Vasudan talking heads
For this, it requires three extra steps.
1. I took screenshots of the specific stance and camera angle that I wanted to use of Oddgrim's Vasudan Pilot model and Oddgrim's Vasudan model.
2. After that, I uploaded the screenshot to Firefly and asked Firefly to generate a background. Again, you'll have to play around with this.
the subject of the reference image is sitting in a futuristic cockpit. the lighting is high-contrast. there are scan lines. the image looks like a AAA video game. the result is a close-up of the subject.
3. Once you have a suitable reference image, then you can feed back into Firefly and use it as a first frame. Just be warned: Firefly does some really, really weird things with Vasudan head animations, and there will be a lot of trial and error. In the end, the only way that I got it to work was by prompting it with language that sounded like a nature documentary.
A close-up of a creature with a smooth, toothless mouth moving its head from side to side as it breathes. The creature does make eye contact with the camera, maintaining an unaware posture. The camera remains fixed. The video has a vintage, retro style with noticeable scan lines, adding a nostalgic and slightly distorted aesthetic.
4. Once you have a suitable video, follow the instructions for Terran anis.
Conversion to ANI format
Now, animated PNGs are a pretty fat file format compared to traditional video. The head animation pack I put to together is a gigabyte for 128 animations. To reduce the file size you can use AnimStudio by MJNMixael.
Alternative naming and playback (FSO 25.0.0+)
FSO 25.0.0 and newer support an alternative to the legacy a/b/c naming convention. This was introduced in Upgrade head ani handling.
Create a file such as head-settings-msg.tbm in the mod's data/tables/ directory:
#Message Settings $Use newer head ani suffix features: YES #End
Place the animations in data/hud/, using these filename stems:
Head-example-reg— normal communication.Head-example-death— the built-in death-scream message for a non-Command persona.
Keep the message's animation reference as Head-example. FSO appends the appropriate suffix before loading the animation. Command personas, and messages without a persona, use -reg.
The setting defaults to NO and applies globally to automatic suffix selection. Convert any heads that rely on the legacy a/b/c selection, including those supplied by dependencies. An existing unsuffixed animation bypasses suffix selection, so do not supply Head-example as an actual animation when using this mechanism.
Knossos users must ensure the mod launches FSO 25.0.0 or newer.
Following the voice duration
The separate $Always loop head anis: setting makes normal comm animations loop while the voice plays and stop when the engine considers the voice finished. To enable both features, use:
#Message Settings $Always loop head anis: YES $Use newer head ani suffix features: YES #End
Keep the settings in the order shown. Death-scream messages are excluded from this normal voice-following playback path.




