Fun with Starcraft 2, 3ds Max and After Effects: Part 1
I’m the type of person who will eagerly attempt to teach myself all there is to know about a subject when my interest is piqued. Sometimes, I’ll even forget that I had originally set out to do some other task before the insatiable quest for knowledge struck. Lately, I’ve wanted to give myself some matchmoving projects to work on and I thought of the Starcraft 2: Heart of the Swarm “Global Invasion” video as well as the well done video for Dreamhack Valencia from a year or two ago. No doubt these videos are pretty damn ambitious and took quite a few man-hours to produce. I’m no expert in 3D modeling and animation, so I’m going to try to see how far I can take it with my existing knowledge and what I can learn along the way. I suppose the first thing I should do is figure out how I’m going to come up with models and animations. Since I come from a video production and editing background, I’d love to get these assets into a software package I’m familiar with like Adobe After Effects. After Effects isn’t exactly suited for 3d animation, but with the introduction of Video Copilot’s Element 3D plugin, the 3d capabilities of After Effects have been expanded quite a bit. Element 3d allows for the import of 3d .OBJ files where they can be skinned, rendered and composited within After Effects. First I’ll need to get the actual assets out of the Starcraft 2 MPQ file that is installed with the game. For that I can use Ladik’s MPQ Editor which extracts all the M3 model files and DDS texture files from the Starcraft 2 MPQ. The SC2 modding community over at SC2 Mapster have many tools for importing/exporting and creating game assets for various Blizzard games. They have a pretty good set of M3 import/export scripts for 3DS Max that I can use to import Blizzard’s proprietary M3 models out of the Starcraft 2 game assets into 3ds Max where I can export an OBJ file that will work for me in After Effects. There are a wide array of models within the game that range from low polygon count units that are used during gameplay and high polygon actors and sets used in the storymode cutscenes. After a while of browsing through the game assets, I figured that the “Recovered Adjutant” high polygon model would make a good test subject for pulling a model into After Effects.
After importing the model into 3ds Max, I need to separate the various pieces of the model into groups that use certain textures so that the model can be properly retextured within Element 3d in After Effects. In the adjutant’s case, there are separate texture/normal/specular maps for the head, chest, and the rest of the torso. I separate the sections by converting the overall model into an editable mesh, detaching the sections from the model, then assigning each section a standard material.
After the model is prepped, I export it as an .OBJ file. Next, I’ll grab all the textures associated with the model. I’m looking for .DDS files with the naming convention that start with “sm_adjutant …” “sm” stands for “Story Mode” files with this prefix usually are related to the high polygon models that are used in the campaign mode cutscenes. All the game textures can be found in the “textures” folder. Using Nvidia’s Texture Tools for Photoshop, I’m able to open each DDS texture file and export them as a JPG file that I can use in Element 3d. Now I can head over to After effects and start importing/texturing the model. Once I set up a new After Effects composition and apply the Element 3d plugin to a new solid, I head into the “Scene Setup” for the element 3d effect.
Here in the Element 3d scene setup window I select each segment of the mesh and apply the “diff” textures (this has the color information for the model), specular textures, normal maps and emission maps (this has the glowing bits for the model).
For this particular model, the eye texture map has a few selections for colors. To accomodate for this, the texture selection is trimmed within the Element 3d texture loading window and the color of the eye is chosen by offsetting the selection.
In addition to the adjutant model, I also grabbed the adjutant chamber that can be found in the Hyperion Med Lab set within the story mode sets and textured that as well. Now that I have the models in After Effects I can have some fun lighting everything as if it were a real-life movie set.
Below, you can see the result I came up with after a little bit of time dressing the scene with lights and some particle effects. I have also included a little animation of the Starcraft 2 logo that I pulled out of the game assets as well.
This is about as far as I’m going to go for this first part. I’m going to spend a little more time familiarizing myself with Element 3d and 3ds max and also see what kind of models I can dig up out of the SC2 assets that would look good in a matchmoving project. I also am 6 missions away from finishing the SC2 Heart of the Swarm campaign, so I better get on that as well. In part 2, I’ll try find an appropriate Starcraft 2 model and see if I can perform some crude animations with it and maybe composite it into some live action footage (which may spill over into a part 3? Who knows.)