Revisiting Starcraft 2

Of the many projects I put on hold back in 2011 (has it really been that long already?), one was based on Starcraft 2. I did a number of tests with this at the time, but some files have inevitably gone missing over the years. I guess it’s a good thing I documented a lot of my prior experiments.

Since I no longer bother with compositing, the first step to machinima involves creating an environment. I’ve learned through the years that it’s better to move assets to a single engine (such as UDK), rather than trying to master 100 different game engines and their tools (all which may change at any time).

There’s been multiple changes to the Starcraft 2 editor since I last used it. It’s a little more difficult to view and extract content, but I’ve spent the past few days refining the process.

The model previewer has been changed, and is now called the Archive Browser. They ditched the MPQ file format that was previously used (which was easy to extract assets from). Models and textures can still be viewed and exported within the editor, but only on an individual basis. I had to make an AutoIt script to automate the export of thousands of textures, which took many hours to complete.

Screenshot 2016-01-28 13.33.33
Materials can be now viewed using Object > Model Data

Getting everything into UDK is somewhat tedious and time consuming, but I am working on refining the process. Having this all done with just a few button presses may be possible (in theory), but the development of such automation would eat up a lot of time.

I’ve been making progress with the environment despite the challenges. Everything will continue to come together as more lighting, props, and post-processing effects are added. I still haven’t figured out what’s going on with emissive textures yet, it seems their coordinates are not exported.

Screenshot 2016-01-28 13.24.56

The next big challenge will be working with character models and animations again.

Converting Starcraft 2 Props to UDK

  1. Export files using the SC2 Archive Browser. Models are in M3 format, textures are in DDS format.
    1. Make sure to add your SC2 texture directory to 3DS Max by going to Customize > Configure User Paths prior to importing models.
    2. Most of the background environments can be found in StoryModeSets > Terran.
  2. Import the M3 model files into 3DS Max using, which is a slightly modified version of this plugin. [Pic] Make sure is in your 3DS Max plugins folder prior to this.
    1. Some scenes will have multiple M3 files (name_00.m3, name_01.m3, etc). They can take up to 3 minutes to import.
    2. If you are importing multiple m3 files of the same name, you will need to rename the meshes after everything is imported (Tools > Rename Objects). [Pic]
  3. Select everything and scale by 250%.
  4. Clear the extra UV channels.
    1. Some models have emissive textures and will need a second UV channel.
  5. Export all the meshes in ASE format to a new directory.
  6. Export the Summary Info file in 3DS Max (File > Properties > Summary info. Press the “Save to File” button). Save as summary_info.txt to the new directory.
  7. Copy the toolbox folder to the new directory.
    1. Optional: Run copy_m3_textures.bat to copy *all* textures (normal, light map, etc).
  8. Run convert_sc2_models_to_udk.bat.
  9. Import the textures into UDK.
  10. Save the package.
  11. Import the ASE files into UDK.
  12. Save the package.
  13. Import t3doutput.t3d into UDK.
    1. Alpha materials will have to be manually fixed in UDK.

Output Example #1

Helpful Links
SC2 Model Previews

This tutorial has been updated 1/28/16.

An Introduction to the Starcraft 2 Editor

This is a guide that will cover the basics of how the Starcraft 2 assets can be previewed. This guide is intended for understanding how the cutscenes work.

How to preview models
1) Open the editor and go to File > Dependencies.

2) Click the “Add Standard” button and select everything (there should be 4 items). Click Ok.

3) Go to Window > Previewer
– This is your model viewer. Use the tree on the right side to find models.
– Most of the high quality cinematic character models are in Assets > StoryModeCharacters
– Additional character models can be found in the portraits directory.

Viewing the cutscenes
1) Download the SC2 cutscene files from here. This will allow you to play the cutscenes in the editor.
2) Go to File > Open and select one of the scene files.
3) To select the default camera view, Go to View > Camera, then select the camera with the Cam_Export suffix.

– At the bottom are standard playback controls: play, pause, etc.
– Unfortunately, there’s not much you can do with these cutscenes other than see how they’re put together.

SC2 Model Previews

Importing Starcraft 2 Characters into 3DS Max

Starcraft 2 game assets can be extracted using MPQ Editor.

Importing the models into 3D Studio Max
1) The M3 files and textures can be exported using MPQ Editor. The main file containing the assets is “base.SC2Assets” which is located in your SC2 directory under StarCraft II\Campaigns\Liberty.SC2Campaign
2) Download and install Starcraft 2 Model (.M3) Plugins for 3ds Max.
3) Run the 3DS Max script Select the M3 file and import.

Rendering SC2 Characters in 3DS MAX
1) Import the character into 3DS Max.
2) Add a skylight to the scene and change the rendering options to enable Light Tracer.

From here we will need to redo the materials. The import script uses wrong settings for the materials, so we will need to fix that.
3) Create new materials for each of the textures. Change the “Alpha Source” setting to “None”.

Output Example #1

Converting Starcraft 2 Characters to the UDK
1) Import the character into 3DS Max with
– Most of the characters can be found in StoryModeCharacters > Terran.
2) Select everything and scale by 25000%. Reposition the model as needed.
– Any extra meshes and their bones can be deleted (example: the SM_RaynorCommander model has a gun and shot glass included).
3) Rename the meshes (head, teeth, etc) and apply a unique material ID to each of the meshes.
– Note: While you do have the option to attach the meshes together, doing so would break the face bones needed for facial animation.
4) Export with ActorX. Import the character and the textures into the UDK.
– Some of the character textures use a 2048×2048 resolution. Select TEXTUREGROUP_Vehicle when importing to prevent them from being re-sized.
– Some materials may need their texture coordinates changed (example: SM_FirstOfficer’s shoulder pads).
– The hair materials can be tricky and may require experimenting to find the best look.
– The eyes may need to have a separate material assigned in 3DS Max.
– A script can be used to create a biped rig.

Creating facial animations
1) Select the mouth bones. Link them to the biped head (Bip001 Head).
2) Export the reference PSK in ActorX.
3) Create the FaceFX poses using this guide.
4) Export each face pose as a separate PSK, then import into the UDK as morph targets.
– Rotating the jaw bone will control the teeth.
– You may want to delete the tongue mesh.

Some of the file formats contained in the MPQ files include:
.m3 – Contains meshes and sometimes animations as well.
.m3a – Contains additional animations. It is currently not possible to load these into 3DS Max.
.fxa – FaceFX file. These contain the facial animations.
– The Starcraft 2 Previewer can be used to find the material settings for the .m3 model file.
– The textures are in DDS format and should be converted to something more manageable (like TGA). You can use NConvert, or the save image feature in 3DS Max for this.
– Some textures have duplicates in different sizes. Check to make sure you’re using the highest resolution available (usually 2048×2048).
– Emissive textures will have a coordinate index of 2.

Helpful Links
Converting Starcraft 2 Props to the UDK
SC2 Model Previews