Note: This tutorial is no longer recommend as a way to make L4D/L4D2 machinima. It is much easier to move the assets to another game (Garry’s Mod or UDK) than to use custom animations within L4D. However, I will leave this tutorial here in case someone is really curious about the process.
Creating a Left 4 Dead 2 Scene
Part I: Lip-sync
L4D2 has a few differences you need to be aware of, compared to other source games. I spent a good amount of time figuring out how to make a scene, and documented the process for anyone else who is looking to learn.
1) Start by creating the Faceposer files.
– Make sure you add the phonemes before aligning the words, or else the program will crash.
2) Once your vcd files are finished and saved, go to File -> Rebuild scenes.image.
3) After that has finished, copy your scenes.image file from left 4 dead 2\left4dead2\scenes to left 4 dead 2\left4dead2_dlc2\scenes.
4) Rebuild your sound cache by going into the game console and typing snd_rebuildaudiocache.
– This will take a few minutes so make sure you add all your audio files before running this command.
Part II: Creating a $definebone file for the model.
Before you can use custom animations, you will need to create a $definebone .qci file.
1) Decompile the original model.
2) Open mdldecompiler.qc and remove the $lod lines. There should be about 3 of them at the top of the file.
3) Open the command prompt and run the following command “studiomdl -definebones mdldecompiler.qc > sharedbones.qci”
4) Delete the lines from sharedbones.qci that don’t start with $definebone.
5) The hand bones in the qci file will contain junk data. Notice how the highlighted numbers are different than the other lines. This will make the character hands act funny. Fix this by changing it to 0.000000 0.000000 0.000000.
Part III: Custom Animations
L4D2 doesn’t have many animations that are useful for conversation, so it goes a long way to make a few of your own. Again, compared to other Source games this requires a little more work.
1) Create your animation in 3D Studio Max and export as an .smd file.
2) Use this tutorial for the next few steps to set up the .qc file.
My .qc file looks like so:
$modelname "survivors/anim_mechanic.mdl" $includemodel "survivors/anim_mechanic_original.mdl" $include "ellis_bones.qci" $sequence z_stand_still "stand_still.SMD" ACT_NONE 1 fps 30.00
Part IV: Hex Editing
This next part is L4D2 specific. You will need to use a hex editor to change a file in order for it to read from your newly created animation file.
1) Open pak01_dir.vpk with a hex editor.
2) Search for the name of the animation file. In this example it’s anim_mechanic. There will be two results. Replace the second one with anim_mechnaniz.
– By changing this name the game will look for the local file, otherwise it will use the animation file stored in the .vpk files.
3) You should now be able to preview your animation using the model viewer.
Part V: Mapping
You will need to create a custom map to play your .vcd files. See the vcd_tutorial attachment for a very basic example.
Part VI: Recording
You should now be ready to play your scene in game. It’s a good idea to use players as actors rather than bots. The bots tend to move around a lot randomly.
There’s a few camera options you can try:
Noclip – Very basic and easy, but requires a dedicated cameraman.
Recording a demo – The built in demo recorder is the only way to record something in game (ie without Fraps), but is not really ideal for machinima. It is an option though.
Built in cameras – Cameras can be placed in the map file that can be triggered. Unfortunately there’s no way to preview where these cameras a looking. The attached map l4d_camera_tutorial provides an example of a moving camera intro.