Skip to content

How to: Import custom models to Cold Steel IV

TwnKey edited this page Aug 23, 2022 · 30 revisions

Introduction

This page is here to guide you in the process of adding custom models to Cold Steel IV. It is currently one of the most complex operations in modding as it involves several steps, and is still at a somewhat early stage. The guide will lead you to insert Van Arkride from Kuro no Kiseki to CSIV, but in a very rough state. He will not be able to fight or doing anything more than running on the field.

The current process includes the following steps in chronological order:

  • Obtaining the model to import (Van Arkride) as a FBX file
  • Importing it in Maya 2015/2016/2017/2018
  • Creating the dummy shaders, then applying them to Van's materials in Maya (including his shadow shader)
  • Exporting Van to .dae using the ColladaMaya plugin
  • Importing Van in CSIV using CSIVAssetImportTool to obtain a .dae.phyre file
  • Updating the shader names in it
  • Using Ouroboros' ED84 decompiler, scripting the Idle and Running animations.

Note that this guide could see an extension of it later if we find the time, where we would discuss how to reproduce craft attacks using camera control commands through ani script editing.

Obtaining the model

To extract Van's model from Kuro no Kiseki game files, we will be using KuroTools mdl exe.
First we search for Van's model file which is called chr0000.mdl. We will also grab his run (chr0000_mot_run.mdl) and idle (chr0000_mot_wait.mdl) animations. All the mdls are located in "THE LEGEND OF HEROES KURO NO KISEKI\c\asset\common\model".

Then we will put all the files inside a folder near ED9AssetExporter.exe:
image
And the folder (called "model", above) content:
image
All that is left is drag and drop the folder containing van mdl and his animations onto ED9AssetExporter.exe.
van1
The tool outputs a FBX file. However, it does not have any texture. It is because textures are separate from the mdl file, since they are located in "\THE LEGEND OF HEROES KURO NO KISEKI\c\asset\dx11\image". To know which texture you need to use, you will have to run the tool and take note of what the tool is outputting on the console; those are the missing textures:
image
Get them all from c\asset\dx11\image and place them in the same directory than ED9AssetConverter: image

Setting up the model in Maya

At the time of writing this guide, we didn't find a better tool than Maya 2015 to 2018, as Blender dae export doesn't seem to work well when injected in CSIV (supposedly, the skeleton doesn't seem compatible).
That's why we will be using Maya 2018 from here.
Once Maya is launched, import chr0000.fbx into the scene:
image
You can ignore the possible warnings that show up. The result should look like this:
image
When enabling the texture, nothing really shows up. It is because Van's shadow is a mesh itself and is covering him.
You can hide that mesh by selecting the kage one and CTRL + H.
image
Note: if any texture looks wrong, you might want to convert them to DDS BC1.
Right now, we don't really care, as the only thing we will be doing is applying a shader to each material. \

Applying shaders

The very first step is to select existing shaders from original Cold Steel models. We will select one for the shadow and will only do one material for this tutorial, because it is a very tedious process. Normally you would do all materials. The shader used for shadow is "ed8_chr.fx#7D5B6AA14716CB4C48A6EB8A4185E522.phyre", which is available in a lot of characters' PKGs.
image
(Example here, it is taken from a Rean DLC pkg)

We will keep this file for later, but first, we need to open the .dae.phyre which is using this shadow shader with the PhyreDummyShaderCreator. To do that, just drag and drop the .dae.phyre onto the PhyreDummyShaderCreator executable.
DummyShader
It will produce a list of fx files, one for each shader variant used by the .dae.phyre. The one we will open with notepad is the shadow one, #7D5.
image
It gives us the shader parameter for the shadow. Those are the ones we will copy in Maya for the ed8_chr.fx file applied to the shadow material.

We provide the ed8_chr.fx dummy shader without any code in it, only parameters. Well technically the current version has some code in there but we don't care about it, we only need the switches.
The trick is that we will be using existing shaders from Cold Steel that were already compiled by the developers. In Maya, we are just using empty shaders to set the parameters in the output dae.

So in order to do that, move the COLLADA.mll file corresponding to your Maya version to the Maya/bin/plug-ins folder. You also should switch the rendering engine to DirectX11 (Windows > Preferences):
image
Then restart Maya. Once Maya is restarted, you need to open the plugins manager (Windows > Preferences > Plug-in manager), find COLLADA and tick the Loaded box.
image
Now you will be able to import .fx files and set the parameters for each material. For this tutorial we will only do the body material.

In Hypershade (Windows > Rendering Editors > Hypershade), select the chr_shadow material.
image On the right (The attribute editor), instead of "Lambert", select colladadx11Shader1.
image
And then below, select the provided ed8_chr.fx.

Here is the hard part. Once the fx is selected, a few sections appears.
image
You will first open the Material Switches one, and proceed to select every switches (every parameter name, if you want) that is present in the dummy shader file we created for the shadow previously (and opened in notepad). When you reach the "sampler" part after BloomIntensity, instead of activating all Samplers, just tick the "Activate Samplers" box, which will take care of all of them. Finally, the last one you want to tick is the Texture2D (the last line of the dummy fx file), DiffuseMapSampler.
image
Once this is done, close this section and open the Material Parameters > Uniform section. You will get something like this: image
We will now port all the values obtained from the dummy fx file:
image
Including the chr_shadow_conv.dds texture that will be used for the Texture2D parameter called DiffuseMapSampler. You will find this texture in any character PKG after conversion from .dds.phyre to .dds. For the half4 parameters, they use a color + a ".w" component". You set the color in RGB value which will deal with the first 3 values and you set the .w to the fourth one.
image
image
However, usually they all have the same set of values, so the default values should do, and you shouldn't have to fill them.

You should finally obtain something like this:
image
where file1 is chr_shadow_conv.dds.

OK, that's one material done, now do all the others!...For this tutorial, we will stop here.\ But you get the idea: the same process has to be gone through for all the materials so that each
of them has a different, custom shader.

Export to dae

Now that the shader(s) have been taken care of, we will export the model to dae, which is the format used by the game.
To do this, go to File > Export All, create a new folder where we will extract the model, and set the export parameters like this:
image
The "Files of type" field must be set to COLLADA exporter (not DAE_FBX export)
image
It might take some time, the file might be quite large, but we can now proceed to the next step.

Conversion to phyre format