[REQ] J-Stars Victory Vs+ model extraction script/tool
Posted: Thu Sep 19, 2019 12:04 pm
A couple of weeks ago I made a post about Burning Blood and shakotay2 made a Make_h2o tool. Since Spike also made J-Stars I wanted to try and extract its models too, sadly the encryption/compression hasn't been defeated, so I went ahead and extracted the unencrypted/uncompressed files from the memory of the RPCS3 emulator, and got them without a problem, they're fairly similar to the Burning Blood format with minor differences.
J-Stars Samples
.srd (pointer/reference file for the model and texture data)
.srdi (raw model data)
.srdv (raw texture data)
They also have the $VTX entries and $RSI subentries that ends with $CT0, but the values are in big endian.
This is the first $VTX entry in koro-sensei.srd, it points to the neck tie submesh in koro-sensei.srdi
20 bytes after $VTX we have the submesh vertices count 00 00 01 44, 0x144 = 324 decimal.
29 bytes after $RSI we have the vertices start address 00 00 00, and right below it, after 13 bytes, the face indices start address 00 83 A0, 0x83a0, right next to it we have the face indices block length 00 00 06 12, 0x612 when divided by 2 we get the FI count 0x309 = 777 decimal.
To get the UV start address we must add the bytes in blue to the vertices start address, they’re not always in the same position in the $VTX section, but they are behind 08 FF FF FF: 0x0 + 0x7980 UV start address.
For the FVFsize we divide the vertices block length by the vertices count:
0x5100 / 0x144 = 0x40 = 64 decimal (haven’t found models with other value).
To get size UVB we need to subtract the values in blue from the values in purple 1 byte after the vertices address and divide the difference by the vertices count: (0x83a0 – 0x7980) / 0x144 = 0x8 = 8 decimal (some are 8 and some 16).
And if I understood the hex2obj tutorial correctly the values between the vertices block and the UVs block should be the submesh’s normals, we can get their start address if we add the vertices block length to the vertices start address: 0x0 + 0x5100 = 0x5100.
Before the $CT0 we have the name of the submesh, in this case tieShape:C_CLOTH.
Open koro-sensei.srdi in hex2obj and input the calculated values from koro-sensei.srd.
Also if you're reading this post shakotay2, thanks for your help, if you're also interested in this, the pattern after $RSI is "01 05 01 02 00 00 00 00"
I've been extracting them manually, but it's getting tiresome and I've only managed to get 14 characters.
https://www.deviantart.com/josoukitsune/gallery
Extracting this guy was a nightmare, I don't want to go through that again
J-Stars Samples
.srd (pointer/reference file for the model and texture data)
.srdi (raw model data)
.srdv (raw texture data)
They also have the $VTX entries and $RSI subentries that ends with $CT0, but the values are in big endian.
This is the first $VTX entry in koro-sensei.srd, it points to the neck tie submesh in koro-sensei.srdi
20 bytes after $VTX we have the submesh vertices count 00 00 01 44, 0x144 = 324 decimal.
29 bytes after $RSI we have the vertices start address 00 00 00, and right below it, after 13 bytes, the face indices start address 00 83 A0, 0x83a0, right next to it we have the face indices block length 00 00 06 12, 0x612 when divided by 2 we get the FI count 0x309 = 777 decimal.
To get the UV start address we must add the bytes in blue to the vertices start address, they’re not always in the same position in the $VTX section, but they are behind 08 FF FF FF: 0x0 + 0x7980 UV start address.
For the FVFsize we divide the vertices block length by the vertices count:
0x5100 / 0x144 = 0x40 = 64 decimal (haven’t found models with other value).
To get size UVB we need to subtract the values in blue from the values in purple 1 byte after the vertices address and divide the difference by the vertices count: (0x83a0 – 0x7980) / 0x144 = 0x8 = 8 decimal (some are 8 and some 16).
And if I understood the hex2obj tutorial correctly the values between the vertices block and the UVs block should be the submesh’s normals, we can get their start address if we add the vertices block length to the vertices start address: 0x0 + 0x5100 = 0x5100.
Before the $CT0 we have the name of the submesh, in this case tieShape:C_CLOTH.
Open koro-sensei.srdi in hex2obj and input the calculated values from koro-sensei.srd.
Also if you're reading this post shakotay2, thanks for your help, if you're also interested in this, the pattern after $RSI is "01 05 01 02 00 00 00 00"
I've been extracting them manually, but it's getting tiresome and I've only managed to get 14 characters.
https://www.deviantart.com/josoukitsune/gallery
Extracting this guy was a nightmare, I don't want to go through that again