Announcement

This is my old blog. All going well, you'll be directed to my newer website with more content and more thoroughly revised guides.

Click this to make the redirecty go faster.
Showing posts with label texture. Show all posts
Showing posts with label texture. Show all posts

Model Swapping

Similar to the Thor -> Thor Collectors Edition swap, this time I'll show how any unit model in the game can be swapped to any other you want. As an example, one I've already prepared is Ghost -> Nova which you can download here. To apply it, simply extract the two folders to SC2\Mods\LibertyMulti.SC2Mod (R.I.P 1.3.3).
Now that the previous method has been removed due to a patch, a new more complicated method is required. Instead of creating a folder structure inside LibertyMulti.SC2Mod, you must copy the original MPQs required to that folder and then add the files to the relevant location within the MPQs in use, so you'll still need MPQEditor. By using this folder prioritising method, no MPQEditing actually takes places which supposedly considers this not disobeying the Blizz Tos, because nowhere did they say we can't add more folders to theirs. That said, Blizz still have the right to ban anyone for any reason they want, so don't consider yourself immune to ban just because of this method, although the risk is still incredibly low.

What this folder prioritising does is when you load the game and the game loads all the MPQs, it'll first look in LibertyMulti.SC2Mod and then Liberty.SC2Mod, but because ghost (or whatever edit you might make) was already loaded from the first folder, it'll simply skip it from the second, but still load everything else that wasn't in the first folder.



As you can see from this Nova file, it's been fully edited to give the correct icon, model, animations, portraits and sounds. With this particular file unfortunately I wasn't able to animate the portrait. Trying to get a static fully textured version alone took me hours due to Blizzards retarded organisation. A more simple and common edit such as Marine to Marauder would be possible to animate the portrait, because both characters are used within Multiplayer games. Characters like Zeratul, Kerrigan and Nova all have unique portraits which Multiplayer is unable to load animations for as they're separate files.

To get started on making your own, you'll need MPQEditor. All characters used in Multiplayer are contained in SC2\Mods\Liberty.SC2Mod folder. A majority of the files like base models, animations and portraits are contained in the base.SC2Assets folder, while sounds are enGB.SC2Assets. I'll give a simple example for this, being how to swap Marine and Marauder. Keep in mind that with this method you won't need to be replacing any files within the MPQ itself.

First off, open base.SC2Assets with MPQeditor. The locations we need files from are Portraits, Textures and Units. For portraits, you simply go to terran and extract Marauder  then rename the file inside from MarauderPortrait.m3 to MarinePortrait.m3.
Now go to textures and scroll down to Marauder and there'll be four .dds files. This will be the same combination for a majority of units, being Marauder_diffuse, Marauder_emmisive, Marauder_normal and Marauderportrait_static for people using the 2D portrait option. Extract these four and rename Marauder to Marine.
Finally go to Units, Terran and now you'll see some files differentiate a bit because Marine has a lot more than Marauder. The reason for this is because marine has more death animations. All this means is when your new Marine dies, if he dies to something like a siege tank, the model will turn back into a marine and explode. To counter this, just copy MarauderDeath a few times and rename it to MarauderDeathBlast.m3 etc.

You're now done with this MPQ and can move on to enGB.SC2Assets for the sounds (LocalizedData\Sounds). Open TerranUnitVO\Marauder and you'll see several files for Deaths, Attacks and so on. Extract them all and rename them to Marine. It's best to look into the actually marine sounds folder while doing this, because some characters have more sound files than others. Make sure you wind up with the same number. For example, if Marine has 8 attack sounds and Marauder has 7, just copy one and rename it to 8. Files must remain in the same format.

After you've done all this, create the same kind of folder structure I made for the Nova MPQ and add all your new files to the appropriate locations. It has to look the same as it did in the MPQ. If something happens like the model has changed but the sounds haven't, you've probably put them in the wrong place.


Now lets say we wanted to do something more difficult, like Ghost to Nova. The main problem with swapping a campaign model with a multiplayer model is the portraits. In campaign, characters portraits are full 3D models which load animations from an individual archive. When you're playing campaign you may only see the head of the model, but infact the entire body is there, just not visible. Because multiplayer portraits weren't designed to load animations from an individual archive, it can't be animated unless you design a brand new model yourself.

Ghost Portrait
Nova Portrait
As you can see, the Ghost portrait only contains the upper half of the original model and contains several animations, while Nova contains the entire model with none. This is the exact model used for Nova in the campaign. The black square at the back is where the background texture is applied.

Higher detailed portraits like novas also have a lot more than 4 textures. She has individual textures for hair, face, eyes, body and any effects. Some of these files are names so rediculously that it also makes them impossible to find, because often the file name isn't even relevent to the character name, such as "sm_tosh_cloak_noise_norm.dds", "reflection_marsarabar.dds" or "t1_sm_nova_hair_diff.dds". In total, novas portrait required  26 textures.

A great way to get the file names is to use the Starcraft II Map Editor you got with the game. After you open it, hold Control, Shift + V to open the model viewer. By default the campaign models aren't even loaded, so it's best to take the NovaPortrait.m3, rename it to GhostPortrait and put it within the correct folder structure withing SC2\Mods\LibertyMulti.SC2Mod. This way we can trick it into loading the Nova portrait instead.

Once in the model viewer, expand the Assets folder on the right and go to Portraits, Terran, GhostPortrait and load the .m3. A new folder will appear in the box below. Open it and go to Materials. Within this there'll be many directories. Expand the first one and a lot of details will pop up. The first four or five details will be follow by a .dds file name. You'll know which is which because it'll say .dds at the end.


Expand every one and take note of all the .dds names. These are the files your going to need to find in the textures folder within SC2\Campaigns\Liberty.SC2Campaigns\base.SC2Assets which you open with MPQEditor and go to Assets\Textures. You won't need to rename these textures as the m3 is designed to load specifically named dds files.

If you have some knowledge with 3D modeling or just want to rescale a model bigger or smaller, these .m3 files can also be imported into Autodesk 3Ds Max using these plug-ins. Extract the 4 .ms files in the scripts folder to C:\Program Files (x86)\Autodesk\3ds Max 2011\Scripts\Startup and then the sc2_objects.ms in plugins folder to C:\Program Files (x86)\Autodesk\3ds Max 2011\plugins.


1. If you want the textures to load with it, put the necessary .dds files into a folder, click Customize at the top of 3Ds Max, Configure User Paths, External Files, Add, then select the folder directory.

2. Then click the hammer icon on the right side of the taskbar on the right of the program, then click MAXScript and use the scrolldown menu to select M3 - Import. Press Open and then locate your .m3 file.


To export your new models, just click on the drop down menu again, select M3 - Export and click Export on the bottom.

If you do replace a model using a character from the campaign, you'll notice that the characters textures weren't designed to support the team colours as heavily as one would like. If you want to learn about how to make the team colours a lot more noticeable, I've also written a guide on Model Texturing.

Model Retexturing

Similar to the background image replacing, we can also use SCs MPQs to change the colour or texture of any of the games models. While this might be a bit simpler to access as we only need to use one MPQ rather than four or five for the backgrounds or having to replace five different folders for the collectors edition thor, this does require a small amount of photoshop knowledge. Nothing that can't be learned with a few minutes of google.

The MPQ needed to be used for this is called base.SC2Assets and can be found at SC2 > Mods > Liberty.SC2Mod. After opening the MPQ with MPQEditor, go to Assets > Textures and this is pretty much all the stuff you're going to be working with. This consists of every texture used for units and buildings by each race. Select anything and type out the first few letters of a unit you want to retexture. Whatever you choose, there'll be a few .DDS files for each unit. The one you're looking for is the one with "_diffuse" written after it.

After you've chosen one, extract it to where you want. Because of the .DDS format, you're going to need the NVIDIA DDS Plug-In. Unfortunately this only works with x32 versions of Photoshop, and even with that, I can't confirm that it works with CS5 at all as I don't think it's been updated recently. A fairly nice alternative is Paint.NET as it can still be used to retexture with a bit of practice and is fully working with .DDS files. If you really really want to use photoshop to recolour, you can just use Paint.NET to convert the .DDS to png, then do what you want in photoshop and then save again from png to .DDS with Paint.NET. jpeg won't work.
(Update: After many years of incompatibility, the wonderful people over at NVIDIA have finally released the plug-in to work on all x64 versions of Photoshop, including the recent CS5 release! It's a fine day for science. That said, if you can't get your hands on Photoshop, Paint.NET still does the trick.)

After you're done retexturing them, instead of replacing the old one inside the mpq, go to SC II\Mods\LibertyMulti.SC2Mod and create a new structure of folders here starting with base.SC2Assets, then a folder in that called Assets and another in that called Textures. Put your new textures in here. This solves the lag issue created from simply replacing the old dds files within the mpq, as well as being a lot simpler. Note that this method has been said to be troublesome on US clients.

For my example, I've chosen the Colossus texture. It's 3am here so you'll have to forgive my lack of effort put into the recolouring. If I'm honest, all I did was press invert.

Before
After


This also works for buildings. I was feeling generous this time, so I added a nice teal tint. I'm not sure how though, because I don't usually use Paint.NET. It was actually an accident but I just decided to roll with it.

Before
After

Yes, mine looks rather dire, but that's not the point.

After you're happy with your modifications, I strongly advise you to start a custom game by yourself to make sure everything is loading properly. The first time I started a game after adding some custom textures, I was having rediculous lag spikes whenever I tried to make the modified units, and when I made a modification to a building, the game took a lot longer to load. So, make sure you go to the Unit Test Map and get your game client used to all your new textures.

Modifying the texture of units will also effect your opponents or allies units, but only from your perspective.

Team Colours
Lets say you wanted to make a brand new texture by yourself, or were using my tutorial on model swapping, focusing on swapping a model such as Zeratul or the Hero units. One thing you'll notice is that these textures weren't designed for team colours. If you swap a model that's used commonly in team games, you'll notice this can be quite distracting or could even cause you to A-move your own team mates.

The way team colours work on textures is with the transparency. The actual team colour itself obviously isn't attached to the texture, else you'd need like 10 textures for every single section of each model. The colour is applied underneath the texture which will then be shown through the transparent parts of the texture.

Using the colossus_diffuse.dds as an example again, take note of the grey and white chequered boxes. This is where my team colour will seep through the texture for others to see.


To show the effect, you can now see I'm using the eraser tool to remove the entire texture, turning everything to chequered boxes. Remember that the dimensions must always remain the same. Before you start, be sure to remove the lock icon in Layers on the bottom right by double clicking the layer to remove layer from background. Some of these dds files also have an alpha one layer which must be removed before saving.
To do this, click Channels next to Layers and the right click Alpha 1 and delete. Once you try to save, the NVIDIA plug-in will prompt you with a pop up. So far, I've found the best setting to be DXT5 ARGB 8 bpp ¦ interpolated alpha (The fourth one).

As you can now see the entire models texture is gone and the model is completely red as that was my teams colour. The light effects are still there because they belong to a separate dds file. You can change that too if you wanted, but it's not going to kill anyone.

Obviously if you're going to be remaking your own model and need to do a change like this, you're not going to be doing a 100% reveal. This is just to give you an idea of how to make team colours more revealing, should you be using a model not designed to support multiplayer.