Character reindex (swaping ) tool

User avatar
aman
Mortal
Posts: 30
Joined: Tue Jul 14, 2015 2:57 pm

Character reindex (swaping ) tool

Post by aman »

Thanks to Tetzrep's awesome work of Skeletalmesh re-index (model swap) work and guide . I followed that guide and was able to swap RetroNinja_Female_MK3 (from NPC_ClassicJade.xxx) with Skarlet. His reindex guide is here http://psx-scene.com/forums/f277/mortal ... ex852.html

There are hundreds of indices need to be replace in skeletalmesh, so I create a tool to take care of most of the replacements.

v0.2 http://www.mediafire.com/download/y61je ... swap0_2.7z

ChangeLogs:
v0.2: Fixed tool crashes with RetroNinja_Male_MK2, added Interior_MIC indices convertion
v0.1: initial release

-Note that this tool does not fix it all. A good understanding of Tetzrep's guide and hex editing is needed to fix the unresolved indices in the resulted SkeletalMesh file.

To use this tool: extract mk9swap.7z to some directory to get mk9swap.exe
- create "in" and "out" sub-directories at the same location of mk9swap.exe
- put NameTable.txt ExportList.txt and SkeletalMesh of the character you want to reindex in the "in" directory
- put NameTable.txt ExportList.txt of the target character in the "out" directory
- There is not much of error checking, expect tool crashes if it does not find file in the expected places.

For PC skeletalmesh, I reindex Classic Jade and replace Skarlet, for example run :

mk9swap.exe RetroNinja_Female_MK3 Skarlet > reindex.log
- RetroNinja_Female_MK3 is the file name of the SkeletalMesh to be reindex (no extension is needed)
- Skarlet is the character to be replace
A Skarlet.Skelectalmesh will be created in the "out" directory

Full command syntax is: mk9swap.exe [-ps3] char_basename1 char_base_name2 [string1=string2]
- parameters inside [] are optional

check reindex.log for error, any line saying "ExportList "xxx" not found" pretty much means that name "xxx" have no equivalent index in the target ExportList.txt. Some manual patching is needed. Some character just will not work no matter what index I tried to assign to it. In the case of RetroNinja_Female_MK3, tool create a working skarlet.skeletalmesh with no needs for manual patching.

- follow Tetzrep's guide to inject Skarlet.skeletalmesh to the end of Skarlet.xxx and update offset table.
- next you need to update 8 textures inside Skarlet.xxx using DDSInjector1.5
Skarlet_Diff.dds replace content with RetroNinja_Female_MK3_Diff.dds
Skarlet_Spec.dds replace content with RetroNinja_Female_MK3_Spec.dds
Skarlet_NormHQA.dds replace content with RetroNinja_Female_MK3_NormHQA.dds
Skarlet_Pmsk.dds replace content with RetroNinja_Female_MK3_Pmsk.dds
SkarletDMG_Diff.dds replace content with RetroNinja_Female_MK3DMG_Diff.dds
SkarletDMG_Spec.dds replace content with RetroNinja_Female_MK3DMG_Spec.dds
SkarletDMG_NormHQA.dds replace content with RetroNinja_Female_MK3DMG_NormHQA.dds
SkarletDMG_Pmsk.dds replace content with RetroNinja_Female_MK3DMG_Pmsk.dds
(I forget replacing the hair texture. oh well.)

I have not tried HowardC's DLC manager , only have Steam MK9 xxx file for now.
ClassicJade replace Skarlet result file here http://www.mediafire.com/download/w8cc0 ... t_moves.7z.


I try my best to make this tool handle some special cases:
- Detects "Name" that contains character name and replace it with target character name before look up the new index, for example: RetroNinja_Female_MK3_PhysicsD need to be changed to Skarlet_PhysicsD.
- Detects "MKClothSet_nnn" and pick the highest nnn in the target ExportList.txt, it seems that always give me either XRAY_Clothset or Meat_Clothset which prevent game from crashing
- If a "Name" show up in ExportList.txt more than once, only index of the the first one will be used.
- If EyesDamage_MIC is not in target ExportList.txt, substitue with index of Eyes_MIC insteads.
- Tool does not handle backgroud character feet sink below floor issues. Need to patch it manually with Tetzrep's instruction.

Some character use a different character "nickname" in ExportList.txt which does not match skeletalmesh file name. i.e
RedErma_B.skeletalmesh uses symbol "Erma_B_PhysicsD" not "RedErma_B_PhysicsD" , to customized symbol translation. do this :

mk9swap.exe RedErna_B Skarlet Erma_B=Skarlet > reindex.log

this way tool will search for Erma_B not RedErma_B in the NameList.txt and replace them with Skarlet before looking up the new index.

Note: Although I added code to handle Big-Endian SkeletalMesh, I cannot verify it works or not. I don't have knowledge of modding PS3 or Xbox360. Finally for PS3 file you need to add "-ps3" switch:
mk3swap.exe -ps3 RetroNinja_Jade_MK3 Skarlet > reindex.log

Please let me know if you run into issues.
Last edited by aman on Wed Sep 16, 2015 11:41 pm, edited 1 time in total.


User avatar
zepterrian
Grand Master
Posts: 659
Joined: Fri Jul 10, 2015 3:50 pm
Side: Light

Re: Character reindex (swaping ) tool

Post by zepterrian »

I developed a program to take care of the manual patching part. It will also inject the new skeleton for you.
You can get it Here.

---------------------- ORIGINAL POST------------------------------
well here what i wrote:

"mk9swap.exe RetroNinja_Male_MK2 Rain > reindex.log"

i tried to see what happen if i change the item (which the tool had problems with) renaming it to "None" (so it does not have problems finding the old one) and making the change also inside the skeletalmesh file with the corresponding value for "None". then i ran the tool but it had the same problem, but now with the new item. i am sure the problems come with the offset (Offset [0x00146047]) because once the tool read it, it goes mad and start repeating the same "info" you see in the reindex.log file. besides you can see that the same number of lines were writen in the .log file before and after modifying the nametable and skeletalmesh as i told you before.

regarding mk1 mesh my game crashed again. you´d better check for your self..

i´m not with steam version of the game but i guess that´s not problem ´cause i managed to make work the same you did with skarlet.

on the right you see smoke´s nametable and on the left is the modified nametable.
Attachments
.log.png
Last edited by zepterrian on Fri Nov 19, 2021 1:05 pm, edited 1 time in total.
For the raptor race...
User avatar
aman
Mortal
Posts: 30
Joined: Tue Jul 14, 2015 2:57 pm

Re: Character reindex (swaping ) tool

Post by aman »

*edit* "Name Table" not found message is not a concern, tool will replace missing name table entry with "None" which is the right thing to do: i.e. "Name Table item 'C_Tie_L00' not found, Use index of 'None"
Take closer look at "ExportList" not found message. that is where tool cannot find a matching name in ExportList. that index need to be assigned manaully.

v0.1 tool crashes while reading RetroNinja_Male_MK2.skeletalmesh, I fixed that and update first post.

I did two MK1 and MK2 character reindex test, both loaded in my Steam MK9 fine
Attachments
NPC_ClassicSoke(RetroNinja_Male_MK1) over Rain: <br />mk9swap RetroNinja_Male_MK1 Rain  &gt; reindex.log
NPC_ClassicSoke(RetroNinja_Male_MK1) over Rain:
mk9swap RetroNinja_Male_MK1 Rain > reindex.log
CHAR_NOOB_D.xxx(RetroNinja_Male_MK2 ) over Rain: <br />mk9swap RetroNinja_Male_MK2 Rain &gt; reindex.log
CHAR_NOOB_D.xxx(RetroNinja_Male_MK2 ) over Rain:
mk9swap RetroNinja_Male_MK2 Rain > reindex.log
User avatar
zepterrian
Grand Master
Posts: 659
Joined: Fri Jul 10, 2015 3:50 pm
Side: Light

Re: Character reindex (swaping ) tool

Post by zepterrian »

i made it work too.. guess the version of the game doesn´t matter in this case.
i was thinking about rederma_b skeletalmesh.. if that file was extracted from xbox it´s sure it has Big-endian format. is it posible to change something so the pc can "read" that skeletalmesh file like the others? like changing it´s big-endian format to little-endian? it´s a very wild thought after all..
by the way, i don´t know if you ignore about this but in that case just check this in case you care about it http://www.mksecrets.net/forums/eng/vie ... =95&t=8331 i found it yesterday..
For the raptor race...
User avatar
zepterrian
Grand Master
Posts: 659
Joined: Fri Jul 10, 2015 3:50 pm
Side: Light

Re: Character reindex (swaping ) tool

Post by zepterrian »

aman something happens with the cloth damage. It seems it happens in every mesh swap i do . i have cyber smoke from Tetzrep but apparently that one is fine. do you think it has to do with the tool?. Check this MK2 rain (the same happens with MK1 rain and a "cyber reptile" i was testing but that last is not that serious). also his eyes are totally brown as you can see.
Attachments
Damage.png
For the raptor race...
User avatar
thethiny
Immortal
Posts: 2258
Joined: Fri Jan 17, 2014 12:08 pm
Side: Light
PSN: thethiny
XBox Live: thethiny
Location: Earthrealm
Contact:

Re: Character reindex (swaping ) tool

Post by thethiny »

Could you maybe update the tool to allow for MKX swapping too? I can provide you with the help you need on info and such.
Image

All of my Mortal Kombat 11 Mods are now unified under a Single Thread. Click The Image to go to the thread.
User avatar
aman
Mortal
Posts: 30
Joined: Tue Jul 14, 2015 2:57 pm

Re: Character reindex (swaping ) tool

Post by aman »

@hunter92 I also hate people that take credit of others work. Maybe those know the source should post link to original mod author anywhere that guy post his video.

Convert big-endian file to pc format is not too wild if we know the byte size of every numbers in xbox file. My issue is the only redrema beta file I found (http://www.mksecrets.net/forums/eng/vie ... =82&t=7503) only have one normal mesh, there is no damage, dismember support and reindex willl not support cloth physics. It is not going to work fully with PC. Just to entertain the idea, here is the converted RedErma_B for pc (use HowardC DLC manager to create diff file if you don't have latest steam MK9)

Your MK2 Rain damage texture looks transparent. You can post your reindex.log file so I can check for error or you can try invert alpha channel of damage texture as Tetzrep's has mentioned that may help.
Character Standard/Damage MIC's
standard character mic's hold reference to the characters undamaged textures.
damage character mic's hold reference to the characters damage textures.
if your textures show up with transparenty, try invert the .diff alpha channel.
Attachments
RedErma_B_PC.7z
RedErma_b for PC , replace Skarlet.xxx
(24.11 MiB) Downloaded 717 times
Last edited by aman on Mon Sep 21, 2015 12:10 am, edited 1 time in total.
User avatar
aman
Mortal
Posts: 30
Joined: Tue Jul 14, 2015 2:57 pm

Re: Character reindex (swaping ) tool

Post by aman »

@thethiny If you already have reindex working with MKX and provide the steps like Tetzrep did, I can update this tool to support MKX. I don't feel like spending time researching MKX format at this time.
User avatar
thethiny
Immortal
Posts: 2258
Joined: Fri Jan 17, 2014 12:08 pm
Side: Light
PSN: thethiny
XBox Live: thethiny
Location: Earthrealm
Contact:

Re: Character reindex (swaping ) tool

Post by thethiny »

Well actually not yet because in MKX there is one extra thing missing from MK9. What I wanted you to update is support for MKX naming, like for example, Characters are Called CHAR_Subzero_N while in the name table they are either Subzero_N or Subzero or simply CHAR_Subzero_N which causes your tool to crash.
I wanted to use your tool to check what updates exactly so it can help me reindex MKX files easier.
Image

All of my Mortal Kombat 11 Mods are now unified under a Single Thread. Click The Image to go to the thread.
User avatar
zepterrian
Grand Master
Posts: 659
Joined: Fri Jul 10, 2015 3:50 pm
Side: Light

Re: Character reindex (swaping ) tool

Post by zepterrian »

thanks for the files you uploaded.. i managed to fix the transparency issue with Rain by inverting the alpha channel but there is still something with his eyes that are totally brown. any idea about what that could be? here an image.. there are lines in the texture bacause i injected the DetailA_Norm and DetailB_Norm files.
i was also checking mk1 costume.. looks like he missed his left eye
Rain test.png
Rain test2.png
For the raptor race...
User avatar
HowardC
Mortal
Posts: 48
Joined: Wed Mar 25, 2015 12:27 am

Re: Character reindex (swaping ) tool

Post by HowardC »

aman wrote:@hunter92 I also hate people that take credit of others work. Maybe those know the source should post link to original mod author anywhere that guy post his video.

Convert big-endian file to pc format is not too wild if we know the byte size of every numbers in xbox file. My issue is the only redrema beta file I found (http://www.mksecrets.net/forums/eng/vie ... =82&t=7503) only have one normal mesh, there is no damage, dismember support and reindex willl not support cloth physics. It is not going to work fully with PC. Just to entertain the idea, here is the converted RedErma_B for pc (use HowardC DLC manager to create diff file if you don't have latest steam MK9)

Your MK2 Rain damage texture looks transparent. You can post your reindex.log file so I can check for error or you can try invert alpha channel of damage texture as Tetzrep's has mentioned that may help.
Character Standard/Damage MIC's
standard character mic's hold reference to the characters undamaged textures.
damage character mic's hold reference to the characters damage textures.
if your textures show up with transparenty, try invert the .diff alpha channel.
The diff files don't work that way. The author has to make the diffs because for them to work correctly the diff must be made on the same version of MKKE that the mod was made with. Once this is done they will work on any version of the game because only the modded components (and not the differences between versions) will be included in the diff file.
User avatar
zepterrian
Grand Master
Posts: 659
Joined: Fri Jul 10, 2015 3:50 pm
Side: Light

Re: Character reindex (swaping ) tool

Post by zepterrian »

Rain´s eyes issue fixed..
For the raptor race...
User avatar
L0a
Mortal
Posts: 14
Joined: Wed Oct 14, 2015 3:12 pm

Re: Character reindex (swaping ) tool

Post by L0a »

When I did the MK9SWap.exe Step.. I got a skeletalmesh file with 0 size. Is that normal?

I'm really lost, especially with the Tetzrep's guide to inject Skarlet.skeletalmesh

I'd like to get Jade with kitana fightstyle
User avatar
zepterrian
Grand Master
Posts: 659
Joined: Fri Jul 10, 2015 3:50 pm
Side: Light

Re: Character reindex (swaping ) tool

Post by zepterrian »

well i can´t tell exactly what´s wrong but i´ll tell you what to do just in case you did not understand the tutorial.

1- take CHAR_Jade.xxx and CHAR_Kitana.xxx files and extract the files inside them through extract.exe tool (drag each package over extract.exe). this step is for taking their name tables.
2- now you have to get their export lists. to do that you need to type "umodel.exe -list CHAR_???.xxx >ExportList.txt". using umodel in cmd mode. "???" is where you have to type the name of your character. Do this same process for the other package. Finally decompress kitana´s package.
3- Now take the jade´s export list and nametable and put them inside "in" folder. take her .skeletalmesh file and put it inside the "in" folder too. Now you´ll have 3 files inside the "in" folder.
4- take kitana´s export list and name table file and put them inside "out" folder.
5- run "mk9swap.exe" through cmd and type "mk9swap.exe Jade Kitana > reindex.log" where "Jade" is the name of jade´s skeletalmesh file as aman explained in his tut.
6- Now you´ll need to inject this new skeletalmesh file. to do this first:
a)- open kitana´s .xxx decompressed package with some hex editor (i use HxD) and go to the end of the file. Take note of the last offset. It is 1395D12.
b)- open kitana´s export list and search for "SkeletalMesh Kitana". On the left you´ll see three columns of numbers. the third column is what you´ll use. Take note of that one. It is 13F79B. this number is the size of kitana´s original skeletamesh file.
c)- open jade´s export list and search for "SkeletalMesh Jade". Take note of the skeletalmesh size as you did for Kitana.
d)- go to your hex editor where you opened kitana´s decompressed package. what you´ll do now is to search kitana´s original skeletalmesh size. The number is 13F79B but you can´t search it simply like that, first you have to write it in little endian format. So if the number is 13F79B you will need to write it as 9BF713 and then search it. Here is a pic.
HxD.png
the values marked in blue are the size and what is marked in red is the offset of the skeletalmesh.
e)- replace the size values with jade´s. Jade´s values in little endian format are BE1B1500. you´ll have something like this
HxD2.png
f)- now replace the offset values (those which are marked in red in the previous pic) with the package´s last offset in little endian format. If the values were 1395D12 now converted to little endian they are 125D3901. You´ll have something like this
HxD3.png
g)- open the new skeletalmesh file in hex. copy and paste it at the end of kitana´s package.
7- replace kitana´s textures with jade´s.
Don´t forget to make a backup of your original file. This will replace Kitana´s main costume.
Remember that you will not have the cloth animations which includes the hair. This is the down side of this swap method.
What you get is Kitana with Jade´s "skin" so every move and special move, xray, and everything else is from Kitana.
Last edited by zepterrian on Fri Nov 19, 2021 12:26 pm, edited 1 time in total.
For the raptor race...
User avatar
L0a
Mortal
Posts: 14
Joined: Wed Oct 14, 2015 3:12 pm

Re: Character reindex (swaping ) tool

Post by L0a »

Sounds like an amazing answer.
I'm going to try today and I'll let you know the results.
Thanks for helping me
Post Reply

Return to “Mortal Kombat 9 PC Modding Tutorials and Discussions”