11-02-2018, 08:11 AM
(This post was last modified: 11-12-2018, 12:45 AM by Spectator Sly.)
PART I: SWAPPING WEAPON MESHES
Introduction
Howdy, folks! Welcome to the first part of my guide towards better understanding how to modify SoulCalibur VI!
With the inaugural part of the series, we will do a mesh swap of an existing weapon already in-game with our own mesh. Any mesh you can think of, if you can make it work.
Well, I have nothing more to say, so let's get right into it, shall we?
Checklist
In order to follow this guide accordingly, I'll list the following that I will be using:
- SoulCalibur VI (duh)
- Umodel: http://www.gildor.org/en/projects/umodel#files
- Autodesk 3ds Max: https://www.autodesk.com/education/free-software/3ds-max
You can sign up as a student on Autodesk's website to get a free 3-year license for 3ds Max 2017-2019, as well as installing the program itself.
- ActorX Importer Plugin for 3ds Max: http://www.gildor.org/projects/unactorx
- An image editing software (Photoshop, GIMP, Paint Tool Sai, etc.)
NOTE: If you're using DDS files, you'll need the NVIDIA Texture Tools for Photoshop, or the the DDS Plugin, if you're using GIMP. I'm not sure how it is for other image editing programs.
- Unreal Engine 4.17.2 (This can be downloaded via the Epic Games Launcher.)
- U4Pak (Make sure you install Python first!): https://github.com/panzi/u4pak/archive/master.zip
Using Umodel to Extract Models
We must now decide which weapon to replace in the game, and to extract its assets. We will use Umodel to acquire said items.
Open up your Umodel and set up your settings like the following:
NOTE: Change the directory to wherever you installed your SCVI at (by default, it should be located @ C:\Program Files (x86)\Steam\steamapps\common\SoulcaliburVI\SoulcaliburVI\Content\Paks)
You will be asked to put in an AES encryption key, enter the following: QyNTD(BsaNlg_)q2uO96blfz%tNCy#.gKo*y7JpYe6U(TL,M#~88Pkqs/l0~x,gc
We now have access to the files inside the PAKs! Now we must locate the weapons.
Within the SoulcaliburVI folder, there will be a Content folder, and within that folder will be one named 'Weapon'. Open that up.
If you're wondering which weapon is which for each character, pick a number from 0 to 6, then add one of the following numbers to it:
01: Heishiro Mitsurugi
02: Seong Mi-na
03: Taki
04: Maxi
05: Voldo
06: Sophitia Alexandra
07: Siegfried
0b: Isabella "Ivy" Valentine
0c: Kilik
0d: Chai Xianghua (has a 7th weapon, so you can use 70d)
0f: Yoshimitsu
11: Nightmare
12: Astaroth
13: Inferno
14: Cervantes de León (has a 7th weapon, so you can use 714)
15: Raphael Sorel
16: Talim
23: Tira
24: Zasalamel
62: Grøh
64: Azwel
65: Geralt of Rivia
66: Lizardman aka Aeon_Calcos
02: Seong Mi-na
03: Taki
04: Maxi
05: Voldo
06: Sophitia Alexandra
07: Siegfried
0b: Isabella "Ivy" Valentine
0c: Kilik
0d: Chai Xianghua (has a 7th weapon, so you can use 70d)
0f: Yoshimitsu
11: Nightmare
12: Astaroth
13: Inferno
14: Cervantes de León (has a 7th weapon, so you can use 714)
15: Raphael Sorel
16: Talim
23: Tira
24: Zasalamel
62: Grøh
64: Azwel
65: Geralt of Rivia
66: Lizardman aka Aeon_Calcos
Essentially, if I wanted any of Nightmare's weapons, for instance, I'd just go to folder 011, 111, 211, 311, etc. If I wanted to replace a weapon of Taki's, it would be 003, 103, 203, 303, etc.
Select a folder within the Weapon folder. You can preview what mesh you're going to replace by double-clicking the 'weaponXXX.uasset'. This can be exported via the Tools -> Export current object option in the model viewer, or via the Export button at the bottom right of the file explorer.
You can double-click the folder to show the Material and texture folders. Go to the Material folder, and export the UASSET file that's in it. This will come in handy later for when we import our object into 3ds Max.
Preparing the Textures
It's now time to prepare our textures! Each weapon will usually contain the following 4 texture maps:
wep_XXX_all_COLOR
wep_XXX_all_MASK
wep_XXX_all_NORMAL
wep_XXX_all_SRMA
Each of these will have the dimensions of 512x1024, so keep this in mind when creating your textures.
Now to go over what which texture does:
COLOR (wep_XXX_all_COLOR): The basic texture map. If you want your weapon to have color customization, this should be greyscaled. Transparency can be achieved via its alpha layer, if your mesh supports it. However, it is uncertain if SCVI supports it natively. Test this out for yourself.
MASK (wep_XXX_all_MASK): Controls what areas of your weapon can be colored. As far I can tell, it has 3 (perhaps even 4?) colors that can be utilized to allow this. Here's an example that was provided to me using the SCIV Soul Edge's texture map:
As you can see, it uses the RGB format for determining the areas. Provided your weapon can support adding colors, it will utilize the three colors in-game in their respective color slots. You can experiment with this map to decide what you want you to be customized. If you want no means of customizing your weapon, you can just make this map completely black.
NORMAL (wep_XXX_all_NORMAL): Adds definition to your object's textures. These will usually come with most models, but if, for some reason, you don't have one, you can use a program like CrazyBump to generate one for you.
SRMA (wep_XXX_all_SRMA): Gives a finished look to your weapon. As far as I can tell, there are three main types of finish to a SRMA map:
- Red (255, 0, 0): A very shiny look; very wet/oily.
- Purple (255, 0, 255): A reflective shine; works best with shiny metals.
- Green (0, 255, 0): Little to no shine; ideal for matte objects.
As you can see, the hilt of Soul Edge will produce next to no shine, and the blade will produce a strong, reflective shine in-game. One can adjust the strength of each type of finish by lowering their color values; don't be afraid to experiment with this map!
Each of these textures should be named EXACTLY as they are above, but obviously replacing the XXX with the number of the weapon you're replacing. Each of these can be saved as a Taiga (TGA) texture; Unreal Engine 4 will recognize them when imported.
Adjusting the New Mesh
Now to get our new mesh rigged over the old mesh's skeleton!
Make sure you have your ActorXImporter script copied over to your 3ds Max's script folder:
- 64-Bit: C:\Program Files\Autodesk\3ds Max 20X\Scripts
- 32-Bit: C:\Program Files (x86)\Autodesk\3ds Max 20xx\Scripts
We'll start by importing the skeleton of the weapon we want to replace using the ActorXImporter script:
MAXScript -> Run Script... -> ActorXImporter -> ActorXImporter.mse
The ActorXImport window will pop up, if you select the correct script. Make sure to click on the checkbox for 'Load skeleton only', since we will be covering up the skeleton with the new mesh.
Now click on 'Import PSK...'. Your PSK file should be in your Umodel folder, in the UmodelExport -> Weapon -> XXX folder:
You should get something like this, or something slightly different (might have to zoom in and out a bit to see it):
This sliver (or slivers, depending on your weapon) is the bone you will rig your new mesh to. Since I prefer using exporting my meshes as FBXs, the key here is to have our mesh cover the skeleton just enough that it isn't sticking out anywhere. But first, let's import our object in:
Just find wherever you have your mesh placed at. No need to change anything in the import settings.
I have successfully imported, but there seems to be a problem:
It is too small. Thus, we must scale it up to cover the skeleton just enough to not notice it. The same should be done if your mesh is too large, otherwise, it will look gigantic in-game:
We will use the the Select and Uniform Scale to fix the size of our mesh:
Select your mesh, and make sure all 3 axes are selected (scale from the center):
By doing this, the mesh will now be properly scaled. Depending on how your mesh works, you may need to do further adjustments to get it just right:
Now, in order for our weapon to properly move in-game, we must add a skin modifier and some weights.
At the top right, you should see something called 'Modifier List':
From the drop-down menu, you'll want to scroll down and select the Skin modifier. This will allow us to attach the bones to the weapon:
With the Skin modifier selected, and going to the Parameters section, you can add the bones to your mesh. Each weapon should have, at the very least, 2 bones, so make sure to select them all. If you added them in correctly, they should appear on the list, like in the screenshot above.
For adding in the weights, select your Skin modifier's envelope, and under Parameters, click on Edit Envelope. Under Select in the Parameters section, click on the checkbox for selecting vertices:
Select both your mesh and the bones. Now, if you click and drag down a bit somewhere in your Parameters section, you'll want to keep dragging down until you see the Weight Properties section:
Select the Weight Tool (the wrench icon). This will let us add weights to the bones:
For each bone, you'll want to add a weight of 1. If you do it right, they should be appear on the list in your Weight Tool window.
Now, we need to see if textures load up properly on the mesh. We will do this via the Material Editor:
A window will pop up, and you'll notice a bunch of blank spheres. You can drag one of your TGA files to a blank sphere (preferably the top left one), like so:
Drag the orb with your texture on it to your mesh. If it looks correct when applied, then your UV map is fine. If, for some reason, it looks messed up, refer to my post down below for how to fix it.
Now, we must apply the material extracted from the weapon we have replaced. It will be located in your Umodel's UmodelExport -> Weapon -> XXX -> Material folder. Drag that material over to your 3ds Max, have it replace the top left material in your Material Editor (or the texture you tested on your mesh). Go back to where you got your material from, and copy its name. Rename the material that you just imported over:
Then just drag that material over your mesh. It is necessary that you do this, otherwise, your textures will not be properly loaded by the game. If there's more than one material for your weapon, make sure you create a multimaterial to hold them all; the game will give you a fatal error, if you're missing even one.
And with that, we're pretty much done with the hardest part of this process!
Cooking and Packing the Files
And now, for the final steps in this entire process!
Launch your Unreal Engine 4.17.2.
On your first launch, you'll be asked to create a new project. Set it up as such (can name the project whatever you want):
In the new project, within the Content Browser, you can right-click and create folders. Create the following folder hierarchy:
Replace the number with the number of the weapon you want to replace. You can import your textures to the texture folder by right-clicking and choosing 'Import...', or dragging them into the texture folder from your Windows Explorer. When importing your mesh in, make sure you check the box for Skeletal Mesh in the import options window. Uncheck 'Import Textures'. Move your material to the Material folder.
Now we can commence cooking the files! But we must change one option right quick: File -> Package Project -> Packaging Settings... ->Packaging -> Uncheck 'Use Pak File'.
Then just do File -> Package Project -> Windows (32-bit)/(64-bit) -> Save it wherever.
There will be a WindowsNoEditor folder, open that up, then go to SoulcaliburVI -> Content -> Copy the Content folder.
Go to your u4pak folder, create a SoulcaliburVI folder there. Place your Content folder inside. Delete the physics and skeleton files inside your weapon's folder, along with the Material folder; the game will use the default one.
Now open up a Command Prompt. Use the cd command to change the directory to where your u4pak folder is. EX: cd C:\Users\Spectator Sly\Downloads\u4pak-master\u4pak-master
Then type the following into the Command Prompt: u4pak.py pack NAMEOFYOURMOD_P.pak SoulcaliburVI
A PAK file will generate in the u4pak folder. Create a ~mods folder where your SCVI Paks folder is, and put the PAK there. Test that bad boy out in-game!
Not 100% perfect, but it can be improved on! (About to be replaced, anyways.)
(Will splice in a pic with the Giant Squid, once I fix the missing material issue.)
phew And that's part 1 done! This took a good a while to put together, and I'm not 100% if how I do it will translate into it serving others well, but we shall see. Let me know what you guys think of this, so I can improve on future parts.
Best of luck to everyone, and happy modding!