Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Dead or Alive series formats and tools

Post questions about game models here, or help out others!
Protocol X27
ultra-veteran
ultra-veteran
Posts: 341
Joined: Wed Dec 14, 2011 5:46 pm
Has thanked: 141 times
Been thanked: 128 times

Re: Dead or Alive series formats and tools

Post by Protocol X27 »

navmesh wrote: Thank you, that means we can add as much mesh slots as we want ,right ? if it is , i think it will break the modding limit :)
sorry for bad english :p
Good question, :) If you hadn't asked I probably wouldn't have considered it just yet. I don't know what the limit is for file size, but based on your idea I didn't limit the additions to only 1.

***

Ok, this ought to do it :D :D :D :D

I haven't had the time to fully stress test it, but I have done multiple tests with different buffer groups on various characters like Nyotengu, Alpha 152 and Rachel. Please let me know if anyone runs across issues. I also keep moving my files around, so if I forgot to update any file references when updating utilities, let me now on those too.

BodyShopToolkitV2.0 : New Utility > MeshReactorPC
- http://www.mediafire.com/download/7960d ... itV2.0.zip

Requires the ObjGeo Index & ObjGeo Mesh item index. The script will then clone the necessary information and add it to the end of the indicated ObjGeo Block. It is possible to add multiple items even of different buffer lengths, but it will only do one at a time. To do multiples you'll have to execute once, and then update the file name to the new output file or keep moving files around to each consecutive file. You're also on your own in terms of assigning images. If you clone the body object, but don't want the body texture you'll still have to manually point the new ObjGeo Mesh item to different textures that are available.

***
On a different note, for an upcoming project, I really want to be able to pull Xbox meshes directly, so if anyone (Rosalin!! etc) knows the proper conversion for values in the vertex buffer that are different between Xbox and PC and can explain the conversion (either by code or theory) it would be greatly appreciated. Thanks :)
bbbmods
beginner
Posts: 32
Joined: Fri Aug 21, 2015 3:40 am
Has thanked: 20 times
Been thanked: 7 times

Re: Dead or Alive series formats and tools

Post by bbbmods »

Protocol X27 wrote:
navmesh wrote: Thank you, that means we can add as much mesh slots as we want ,right ? if it is , i think it will break the modding limit :)
sorry for bad english :p
Good question, :) If you hadn't asked I probably wouldn't have considered it just yet. I don't know what the limit is for file size, but based on your idea I didn't limit the additions to only 1.

***

Ok, this ought to do it :D :D :D :D

I haven't had the time to fully stress test it, but I have done multiple tests with different buffer groups on various characters like Nyotengu, Alpha 152 and Rachel. Please let me know if anyone runs across issues. I also keep moving my files around, so if I forgot to update any file references when updating utilities, let me now on those too.

BodyShopToolkitV2.0 : New Utility > MeshReactorPC
- http://www.mediafire.com/download/7960d ... itV2.0.zip

Requires the ObjGeo Index & ObjGeo Mesh item index. The script will then clone the necessary information and add it to the end of the indicated ObjGeo Block. It is possible to add multiple items even of different buffer lengths, but it will only do one at a time. To do multiples you'll have to execute once, and then update the file name to the new output file or keep moving files around to each consecutive file. You're also on your own in terms of assigning images. If you clone the body object, but don't want the body texture you'll still have to manually point the new ObjGeo Mesh item to different textures that are available.

***
On a different note, for an upcoming project, I really want to be able to pull Xbox meshes directly, so if anyone (Rosalin!! etc) knows the proper conversion for values in the vertex buffer that are different between Xbox and PC and can explain the conversion (either by code or theory) it would be greatly appreciated. Thanks :)
Thanks :) Will give it a try when I start modding again. mgsv currently has me distracted :P
arch3r
ultra-n00b
Posts: 4
Joined: Mon Sep 21, 2015 7:49 am
Has thanked: 3 times

Re: Dead or Alive series formats and tools

Post by arch3r »

Protocol X27 wrote:
BodyShopToolkitV2.0 : New Utility > MeshReactorPC
- http://www.mediafire.com/download/7960d ... itV2.0.zip

Requires the ObjGeo Index & ObjGeo Mesh item index.
i never used an python script ,so please tell me what steps i did wrong ,thank you
i want to inject Objgeo and i use Protocol X27 's MeshReactorPC script

i install python34 and create a bat file in the parent folder of python (which is "E:\mods" ,i put this in the the bat file

Code: Select all

"python34\python.exe" ".\MeshReactorPC.py"
Then i put KOKORO_DLCU_004.TMC and KOKORO_DLCU_004.TMCL into that folder ("E:\mods" , which is the folder that contain the .BAT file )

then i edit the MeshReactorPC.py like this

Code: Select all

###########
#User Input
###########


targetFileName = 'E:\mods\KOKORO_DLCU_004.TMC'

#Manually input these until UI is added
targetObjGeo = 1
targetObjGeoMesh = 1
################################
Then i run the .BAT file, but nothing happens

Thanks

p/s : new DLC info has been added
https://steamdb.info/app/311730/depots/
Protocol X27
ultra-veteran
ultra-veteran
Posts: 341
Joined: Wed Dec 14, 2011 5:46 pm
Has thanked: 141 times
Been thanked: 128 times

Re: Dead or Alive series formats and tools

Post by Protocol X27 »

@bbb that tends to happen during the long haul that is DOA modding, lol

@arch3r

You don't have to use a .bat file. If you already have python installed and working you can edit the .py file with IDLE. If you have it open with IDLE you can hit F5 to run it after you've saved your changes.

There is a hurdle that I haven't fixed yet and forgot to mention. Try putting the tmc files in a subfolder, so the targetFileName should look like '/mods/subfolderName/KOKORO_DLCU_004.tmc'

I usually do not put the full path for the .tmc so just use something relative to your script location.

/mods/pythonScript.py
/mods/someSubFolder/costumeFile.tmc
arch3r
ultra-n00b
Posts: 4
Joined: Mon Sep 21, 2015 7:49 am
Has thanked: 3 times

Re: Dead or Alive series formats and tools

Post by arch3r »

@Protocol X27 : Thank you so much, it works now ,its really awesome
i will try importing some mesh into new created meshslot and make a feedback later
navmesh
beginner
Posts: 24
Joined: Mon Mar 12, 2012 3:04 am
Has thanked: 32 times
Been thanked: 3 times

Re: Dead or Alive series formats and tools

Post by navmesh »

@Protocol X27 : Thank you for releasing this great script :keke: :keke: :keke:
abcdefh
ultra-n00b
Posts: 8
Joined: Tue Dec 28, 2010 4:22 pm
Been thanked: 2 times

Re: Dead or Alive series formats and tools

Post by abcdefh »

@Protocol X27
Thank you for a great tool.

Replication of itable in MeshReactorPC it does not conduct
Would not it be better to duplicate because such as those present few minutes Obj?

I'm sorry in English of the automatic translation.
Protocol X27
ultra-veteran
ultra-veteran
Posts: 341
Joined: Wed Dec 14, 2011 5:46 pm
Has thanked: 141 times
Been thanked: 128 times

Re: Dead or Alive series formats and tools

Post by Protocol X27 »

@navmesh, Glad to help. :)

@abcdefh, I'm sorry, the auto translate is not quite working. I do not understand your question. If you can phrase it differently, I might be able to help.
abcdefh
ultra-n00b
Posts: 8
Joined: Tue Dec 28, 2010 4:22 pm
Been thanked: 2 times

Re: Dead or Alive series formats and tools

Post by abcdefh »

@Protocol X27
I'm sorry.

Example:AYANE_DLCU_001
1.Mesh in first ObjGeo is copied.(WGT_body)
2.The number of subobject of ObjGeo will be 3.(Green part)

In this case.
The number of subobject in itable is made 3.
The index number of cutomp is also copied.(index 0)

A boundary adjustment is needed by a case.

Was it transmitted with this?
You do not have the required permissions to view the files attached to this post.
Protocol X27
ultra-veteran
ultra-veteran
Posts: 341
Joined: Wed Dec 14, 2011 5:46 pm
Has thanked: 141 times
Been thanked: 128 times

Re: Dead or Alive series formats and tools

Post by Protocol X27 »

abcdefh wrote:@Protocol X27
I'm sorry.

Example:AYANE_DLCU_001
1.Mesh in first ObjGeo is copied.(WGT_body)
2.The number of subobject of ObjGeo will be 3.(Green part)

In this case.
The number of subobject in itable is made 3.
The index number of cutomp is also copied.(index 0)

A boundary adjustment is needed by a case.

Was it transmitted with this?
I will test with the model and post screenshots once I get a chance.

To answer your question. No, the itable does not get updated. The customp also does not get updated.

Return question. What are itable and customp used for?
abcdefh
ultra-n00b
Posts: 8
Joined: Tue Dec 28, 2010 4:22 pm
Been thanked: 2 times

Re: Dead or Alive series formats and tools

Post by abcdefh »

Protocol X27 wrote:
abcdefh wrote:@Protocol X27
I'm sorry.

Example:AYANE_DLCU_001
1.Mesh in first ObjGeo is copied.(WGT_body)
2.The number of subobject of ObjGeo will be 3.(Green part)

In this case.
The number of subobject in itable is made 3.
The index number of cutomp is also copied.(index 0)

A boundary adjustment is needed by a case.

Was it transmitted with this?
I will test with the model and post screenshots once I get a chance.

To answer your question. No, the itable does not get updated. The customp also does not get updated.

Return question. What are itable and customp used for?
You can use the alpha channel of texture as a specular map, it seems to manage to use as a transparent.
User avatar
Rosalin
mega-veteran
mega-veteran
Posts: 187
Joined: Fri Jun 13, 2014 11:38 am
Has thanked: 62 times
Been thanked: 56 times

Re: Dead or Alive series formats and tools

Post by Rosalin »

Well..sorry, long time no see.

I've been playing as harry palmer on somewhere else, and I was able to make or get most of things that I wanted about these stuffs before.
so I was losing most of interest.
Only thing that left is that I feel I didn't make enough notes about that.

first, these are tools I made.


I got major hints from prot's codes for some tools.
And I was able to make b0ny's rotation tool for PC version also.

***

Converting vertex buffer(PC-360) requires understandings of how numbers are stacked in each 4 bytes .
Normal vector requires three float numbers and tangent vector requires 4 float numbers.
In PC version, each numbers are placed in each 4 bytes independently. (so pc version has longer vertex buffer.)
but in 360 version, 3 normal vectors and 4 tangent vectors are stacked in a each 4 byte block in a complicated way.

This is code from b0ny's rotation.py.
I hope this helps.

Code: Select all

[360]
X	Y	Z	N	W	B	T	U	U	U	U
[PC]
X	Y	Z	N	N	N	W	B	T	T	T	T	U	U	U	U

class HEND3N(BigEndianStructure):          #Normal Vector
    _fields_ = [('z',        c_int, 10), #/511
                ('y',        c_int, 11), #/1023
                ('x',        c_int, 11)] #/1023
class DEC4N(BigEndianStructure):           #Tangent Vector
    _fields_ = [('w',        c_int, 2),  #/1
                ('z',        c_int, 10), #/511
                ('y',        c_int, 10), #/511
                ('x',        c_int, 10)] #/511

def HenD3NToFloat3(I):          #Normal Vector
    x = tosigned(I       & 0x7FF, 0x400) / 1023
    y = tosigned(I >> 11 & 0x7FF, 0x400) / 1023
    z = tosigned(I >> 22        , 0x200) / 511
    return (x,y,z)

def Dec4NToFloat4(I):           #Tangent Vector
    x = tosigned(I       & 0x3FF, 0x200) / 511
    y = tosigned(I >> 10 & 0x3FF, 0x200) / 511
    z = tosigned(I >> 20 & 0x3FF, 0x200) / 511
    w = tosigned(I >> 30        ,   2  ) /  1
    return(x,y,z,w)
4bytes are 32 bits.
take a look how each part of bits is making a float number.

just tell me if you want something more detailed.
***

Anyway, when making skeleton patcher, I think it's good to copy all three skeletons for any good reasons. you know we were copying Hielay and BnOfsMtx only. another one is GlblMtx.
Last edited by Rosalin on Wed Feb 10, 2016 11:24 am, edited 1 time in total.
Protocol X27
ultra-veteran
ultra-veteran
Posts: 341
Joined: Wed Dec 14, 2011 5:46 pm
Has thanked: 141 times
Been thanked: 128 times

Re: Dead or Alive series formats and tools

Post by Protocol X27 »

Ros! Amazing, good to see ya again! I figured you'd been working on stuff elsewhere, but didn't know if you were still active. I know activity has dropped off for some people.

You've made some serious progress. The fact you finished the Rotator will save me some time, since I was going to use a lame method copy from Xbox to PC since I don't know all the math for the conversion.

I know you made some vertex conversion stuff already, but I want to understand how it works, so I can actually integrate the process into some current tools. :) Thanks for explaining the breakdown. I may need a little extra help on what you posted. So if I pass the Xbox Normal or Tangent values into their respective functions, I'll get a value in the proper PC bytes right?

Thanks for the tip on the GlblMtx as well, I don't know that was necessary, but based on recent mods, I can see some costumers still weren't full matching the character they originally came from. Is there any trick to it? I remember that matching the HieLay was only the first 0x40 bytes or something like that.

***
abcdefh wrote: You can use the alpha channel of texture as a specular map, it seems to manage to use as a transparent.
If you are able to explain which values should be changed to, I could see what I might able to fix.

Since I don't know how these sections work, could you show an example of the difference between one using the alpha as specular vs one using the alpha as transparency?
User avatar
Rosalin
mega-veteran
mega-veteran
Posts: 187
Joined: Fri Jun 13, 2014 11:38 am
Has thanked: 62 times
Been thanked: 56 times

Re: Dead or Alive series formats and tools

Post by Rosalin »

I almost quit this league actually.
I just sometimes wanted to look back what I didn't explained enough about what I've done.

***

I think matching only 2 skeletons will be fine as we did.
I don't know about exceptions.

But reason why I suggested something for GblMtx is, a japanese modder made a tool about 'bone and weight' based on GblMtx shapes.
that's all.

***

And I happened to know that using skeleton matching tool with object rotation tool at a time can cause unwanted coordinate distortion.
I couldn't figure out the reason why.
Last edited by Rosalin on Thu Sep 24, 2015 10:29 am, edited 1 time in total.
Protocol X27
ultra-veteran
ultra-veteran
Posts: 341
Joined: Wed Dec 14, 2011 5:46 pm
Has thanked: 141 times
Been thanked: 128 times

Re: Dead or Alive series formats and tools

Post by Protocol X27 »

Rosalin wrote:I almost quit this league actually.
I just sometimes wanted to look back what I didn't explained enough about what I've done.
So are you done for good? Freeloaders tick you off, or are there no more challenges for you?

Guess I had best ask anything technical while I can. ;)

Here's what I figured how to assemble based on your suggestion.

Code: Select all

import struct, os, io

def tosigned(unsigned, signflag):
    return unsigned - (0 if unsigned < signflag else signflag*2)

def HenD3NToFloat3(I):          #Normal Vector
    x = tosigned(I       & 0x7FF, 0x400) / 1023
    y = tosigned(I >> 11 & 0x7FF, 0x400) / 1023
    z = tosigned(I >> 22        , 0x200) / 511
    return (x,y,z)

def Dec4NToFloat4(I):           #Tangent Vector
    x = tosigned(I       & 0x3FF, 0x200) / 511
    y = tosigned(I >> 10 & 0x3FF, 0x200) / 511
    z = tosigned(I >> 20 & 0x3FF, 0x200) / 511
    w = tosigned(I >> 30        ,   2  ) /  1
    return(x,y,z,w)

i = 0xE6ABFCFE
hResult = HenD3NToFloat3(i)

print('Xbox - E6 AB FC FE')
print('PC1 - F2 C6 40 BF')
print('Result1: ' + hex(struct.unpack('<I', struct.pack('<f', hResult[0]))[0]))
print('PC2 - F9 7A 20 BF')
print('Result2: ' + hex(struct.unpack('<I', struct.pack('<f', hResult[1]))[0]))
print('PC3 - B4 B4 4C BE')
print('Result3: ' + hex(struct.unpack('<I', struct.pack('<f', hResult[2]))[0]))

Code: Select all


#Xbox Vertex
#3F 15 9A A4
#BD 7A 2B 1C
#3C 68 D7 B0
#E6 AB FC FE   <<
#00 00 00 FF
#00 00 00 24
#6C 85 6F 32
#37 EC 3A 6F
#37 EC 3A 6F
#37 EC 3A 6F
#3B 35 36 6E

#PC Vertex
#A4 9A 15 3F
#1C 2B 7A BD
#B0 D7 68 3C
#F2 C6 40 BF  <<
#F9 7A 20 BF  <<
#B4 B4 4C BE  <<
#FF 00 00 00
#24 00 00 00
#Clipped

I compared an Xbox Vertex & PC Vertex to see how close they were. It looks like the first 2 Bytes are exact, but the last two bytes in each result are not. Is this normal? Is my conversion back to hex correct? I'm not sure if there's a different pack/unpack method I should be using.

Result

Code: Select all

Xbox - E6 AB FC FE
PC1 - F2 C6 40 BF
Result1: 0xbf40b02c
PC2 - F9 7A 20 BF
Result2: 0xbf20681a
PC3 - B4 B4 4C BE
Result3: 0xbe4c6633
Post Reply