[PS2] Death by Degrees UV extraction (500$ compensation)

Post questions about game models here, or help out others!
User avatar
mariokart64n
ultra-veteran
ultra-veteran
Posts: 529
Joined: Sun Jun 05, 2005 12:00 pm
Location: Ontario, Canada
Has thanked: 23 times
Been thanked: 165 times
Contact:

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by mariokart64n » Wed Mar 25, 2015 9:38 pm

MrAdults wrote:Hey mario, did you find the mirrored vertex flag? Looking at one of the skeleton bits in one of those nina models, there are two draws referencing the same VIF segment, and I know one of them has to be the mirrored draw. I thought for sure it was bit 0x200 of the value 12 bytes into the draw structure, but apparently it isn't. That bit and the first bit of the structure are the only bits that change between those two draws, but they also change for geometry that doesn't seem like it should be mirrored. Did I miss a separate lookup table for mirrored geo or something? I figure either that or there's a pointer to the microcode that's gonna be run for the thing which is implicitly dictating whether the draw will be mirrored. That's the less appealing option, since it requires sifting through all the models to find the mirroring microcode variants.

Edit: Oh, and I noticed the texture is just the first 4 bytes of the draw struct, referencing it by global index. Dunno if you figured that out already or if it points you in the right direction for Tekken.
yeah I tried mirroring that skeleton mesh in 3dsmax and the vertices are not along the origin of the X axis.. so it doesnt even mirror correctly in 3dsmax. there was something odd going there Im not sure what.

also the first 4 bytes, they are global offset or global index? i got large values when i was looking at tekken5. Silly I never considered that they might be offsets into the texture resource file though?
Research: [DOA2U] [DOA5U]

User avatar
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 499 times

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by MrAdults » Wed Mar 25, 2015 11:02 pm

You mean the fact that the verts are all offset a little bit from the origin? Yeah, I noticed that too. I also noticed that the bone reference table for each draw is the same, which means there's probably a "base" joint index for that table somewhere, could be packed where that 0x200 bit value is changing. Then you might end up having to reskin the verts based on the relative transforms of those joints or something from some bind pose matrix that would be identical for each VIF seg since the bind pose has no mirroring in it. Unfortunately that probably means having to dig skeletal poses out of the motion data as well to transform against, cause there's no non-bind-space transform in the obj files that I saw. That might be further than I'm willing to go, although that motion data looked to be lacking any difficult compression beyond basic quantization. But anyway, yeah, it seems like it isn't as simple as a mirror bit.

I meant global index - you'll notice that each of those tim2 entries has extension data containing GIDX entries. Those global indices are unique across all loaded resources, so you'll rightfully get some pretty big values there. Funny enough they stuck with this same scheme for the next-gen Tekken/Soul Calibur/etc. titles, so I bet it's the same in Tekken 5 as well. You just match the global index of the texture resource with the first 32 bits of the draw struct.

It's possible, though, that because you're dumping Tekken 5 models out of memory, that they remap those indices at runtime so matching them to the offline cooked texture data could prove more problematic. But maybe not, at least in DBD it looks like they generate unique ID's at cook time so no runtime remapping would be necessary.
TGE wrote:All this talk about vif commands urges me to ask a question.
I've been working on a vif style model format for ages (in maxscript) but the way weighted vertices are stored (overlapping several masked vertex arrays) drives me crazy.
So I might just want to learn noesis for this but before I do, what kind of output does the noesis' vif unpack give you?
Noesis has a couple of different unpacking modes, but only the dumb one is exposed in Python at the moment. I neglected it, because no one has been using it. The dumb one is the one that just parses through the VIF data and hands you back raw structures for each unpack detailing the size and type of the source data, so you get to handle actually interpreting it yourself.

It should be easy for me to hook the authentic mode up to Python for the next build too. It does the full-on unpacking according to all of the hardware specs and obeys all of the relevant registers (and allows you to emulate both VIF0 and VIF1 in a single context), so you end up with what you'd really end up with on hardware. All of your writes will be expanded out to 32 bits at 4 elements each in VU memory, and you get back a list of structures telling you where the unpacks took place with the relevant type info and start/end addresses in VU memory. Then you typically just do some rpgBind calls for the vertex buffers right over the emulated VU memory and you're good to go. This would probably instantly put an end to that Dirge of Cerberus thread that's been going on for years here. :) I did write it from my own interpreted spec from the docs (didn't pull it from an emulator or anything), so there could be problems lurking, but... at least it's worked on all of the games I've encountered so far. Having more people using it would be good to discover any bugs or flat-out-broken things that I interpreted wrongly. I still need to get back to trying it on the MGS games too. revelation was kind enough to dump a bunch of info about them on me a long time ago, and... well, life.

User avatar
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 499 times

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by MrAdults » Sun Mar 29, 2015 5:51 am

I'll be putting a build of Noesis up in a little bit that supports this. It also supports the dumped Tekken 5 models by scanning through for the seemingly-reliable initial VIF commands to set the cycle and write out the element count, then using that offset to find the address fixup for every other pointer in the file.

Skeleton, weights, and materials are supported. If you just load something up it'll throw everything at you like this:

Image

That's because it doesn't know which skeleton to use (outside of any models within the file that might have embedded pose data), so I've added the ability to specify a _dbdinfo.txt file that lets you fill that stuff in and end up with something like this instead:

Image

For this case you just make a file next to chr_nina1.obj named chr_nina1_dbdinfo.txt and fill it with this:

Code: Select all

;uncomment if you want to force recalculation of triangle windings instead of relying on ps2 draw kicks with strip order
;FixWindings 1

;create a named skeleton from translation and rotation data
AddDataToNamedSkeleton "nina_main_pose" "chr_common.mop" "01_nin_Mid_INITIAL_TRANS.mot"
AddDataToNamedSkeleton "nina_main_pose" "chr_common.mop" "01_nin_Mid_INITIAL_ROT.mot"

;apply named skeleton to body, head, and hands
SetObjectNamedSkeleton "chr_ni1_b1.obj" "nina_main_pose"
SetObjectNamedSkeleton "chr_ni1_h1.obj" "nina_main_pose"
SetObjectNamedSkeleton "chr_ni1_t1l.obj" "nina_main_pose"
SetObjectNamedSkeleton "chr_ni1_t1r.obj" "nina_main_pose"

;transform hair onto the head (the head bone index is 11)
;this will also transform and reparent any sub-skeletons associated with the object.
;can be used to perform transforms to multiple bones in order.
TransformAndReparentObject "chr_ni1_dk1.obj" "nina_main_pose" 11
TransformAndReparentObject "chr_ni1_dk2.obj" "nina_main_pose" 11
TransformAndReparentObject "chr_ni1_dk3.obj" "nina_main_pose" 11

;skip over shadow mesh
SkipByObjectName "chr_nin_s1.obj" 1
;skip over effect shell by material
SkipByMaterialName "material1000139f" 1

;skip over additional head targets
SkipByObjectName "chr_ni1_ha.obj" 1
SkipByObjectName "chr_ni1_h2.obj" 1
SkipByObjectName "chr_ni1_h3.obj" 1

;skip over additional hand targets
SkipByObjectName "chr_ni1_t2l.obj" 1
SkipByObjectName "chr_ni1_t2r.obj" 1
SkipByObjectName "chr_ni1_t3l.obj" 1
SkipByObjectName "chr_ni1_t3r.obj" 1
SkipByObjectName "chr_ni1_t4l.obj" 1
SkipByObjectName "chr_ni1_t4r.obj" 1
SkipByObjectName "chr_ni1_t5l.obj" 1
SkipByObjectName "chr_ni1_t5r.obj" 1
SkipByObjectName "chr_ni1_t6l.obj" 1
SkipByObjectName "chr_ni1_t6r.obj" 1
SkipByObjectName "chr_ni1_t8r.obj" 1

;skip over alternate hair by material
SkipByMaterialName "material1000139a" 1
SkipByMaterialName "material1000139d" 1
The idea is the same for all of the other models. For figuring out material names and object names, just look at the data viewer in Noesis.

It'll also auto-load paired .nut files for the raw memory-dumped Tekken 5 files and auto-assign materials from the global indices, but you'll have to manage to find the right TIM2 list with global indices intact for that to work. I have no idea if that's easy or not, I haven't looked at Tekken 5 or any dumps from it, I just looked at and tested with the file mario put up in this thread.

I'm sorry, I didn't end up getting to the improved Python VIF support, cause sorting out the skeleton nonsense with this took longer than expected. But it's fully exposed in native plugin land if you're feeling adventurous. Otherwise, it's on the short-order todo list.

IvoryCutter
beginner
Posts: 31
Joined: Sun Jan 15, 2012 9:25 am
Has thanked: 22 times

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by IvoryCutter » Mon Mar 30, 2015 1:19 am

MrAdults wrote:I'll be putting a build of Noesis up in a little bit that supports this. It also supports the dumped Tekken 5 models by scanning through for the seemingly-reliable initial VIF commands to set the cycle and write out the element count, then using that offset to find the address fixup for every other pointer in the file.

Skeleton, weights, and materials are supported. If you just load something up it'll throw everything at you like this:
:o ... 8D
===============
What's New
===============
Version 4.1-4.148:
-4.148 - Added import support for Death by Degrees.

Wow. That's major!
Just downloaded and tried it. Works like a charm.
You just saved me hours/days/weeks. Incredible.
Thank you so much! So glad you got involved in this thread. Also, many thanks for the detailed description/guide in your above post!
Do you by any chance also have a PayPal account that I could donate to? If you do, please PM me the info.

OMG. :dance:

User avatar
porimac
VIP member
VIP member
Posts: 109
Joined: Wed Sep 08, 2010 4:46 pm
Location: Japan,Kanagawa
Has thanked: 63 times
Been thanked: 13 times

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by porimac » Mon Mar 30, 2015 2:29 am

great works
but...obj...?
where would obj come out...?

sorry noob question

User avatar
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 499 times

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by MrAdults » Mon Mar 30, 2015 2:52 am

Sure, by no means expected, but if you still have something to spare after giving mario the 500. :) There's a paypal direct link here: http://www.richwhitehouse.com/index.php ... _about.php
porimac wrote:but...obj...?
You can extract the archives with Noesis as well, just browse to and export them from the list view.

User avatar
porimac
VIP member
VIP member
Posts: 109
Joined: Wed Sep 08, 2010 4:46 pm
Location: Japan,Kanagawa
Has thanked: 63 times
Been thanked: 13 times

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by porimac » Tue Mar 31, 2015 4:42 am

thank you for the information
Tekken 5 is different archive type...perhaps, i think there are same format

User avatar
Casedey
beginner
Posts: 27
Joined: Sat Aug 20, 2011 6:27 am
Has thanked: 23 times
Been thanked: 8 times

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by Casedey » Fri Apr 03, 2015 3:52 am

I tried noesis with TEKKEN 5 and it worked with most of the models, but the program crashes when i tried to open the .nud file of Steve Fox, if you need a sample of the file just tell me. :)

IvoryCutter
beginner
Posts: 31
Joined: Sun Jan 15, 2012 9:25 am
Has thanked: 22 times

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by IvoryCutter » Fri Apr 03, 2015 12:32 pm

MrAdults wrote:Sure, by no means expected, but if you still have something to spare after giving mario the 500. :) There's a paypal direct link here: http://www.richwhitehouse.com/index.php ... _about.php
So it is you! I wasn't sure. I'll use that Paypal link then. Probably not his month, as I will compensate mario for his efforts first, but I'll make sure to show my gratitude to you next month :-)
The worst part in all of this is I currently have friends visiting that I need to entertain, so I have all these incredible tools you guys built and no time to get any work done with them atm First world problems I guess. Considering I'll be working with mario's script and your tools on Death by Degrees for the next couple of months, it's not too bad, though.

User avatar
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 499 times

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by MrAdults » Fri Apr 03, 2015 4:07 pm

Yeah, the unholy trinity of identities can be confusing. I started Noesis to be a silly one-off project and figured I'd drop it after a little while. Then I ended up working on it for years. That's probably why I hate the codebase so much now.
Casedey wrote:I tried noesis with TEKKEN 5 and it worked with most of the models, but the program crashes when i tried to open the .nud file of Steve Fox, if you need a sample of the file just tell me. :)
Sure, send it over. There's probably a false positive for the first VIF segment that's throwing off the address fixup.

User avatar
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 499 times

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by MrAdults » Fri Apr 03, 2015 8:29 pm

I had to add ReparentObjectSkeletonAndRebaseWeights for the cinematic models, cause they reference a bunch of different poses.

Image

I'll put a build up later with that change. Once I do, stuff like this will work (for s2000.obj):

Code: Select all

;uncomment if you want to force recalculation of triangle windings instead of relying on ps2 draw kicks with strip order
;FixWindings 1

;create a named skeleton from translation and rotation data
AddDataToNamedSkeleton "nina_main_pose" "../DATA0_files/chr_common.mop" "01_nin_Mid_INITIAL_TRANS.mot"
AddDataToNamedSkeleton "nina_main_pose" "../DATA0_files/chr_common.mop" "01_nin_Mid_INITIAL_ROT.mot"
AddDataToNamedSkeleton "nina_facial_pose" "../DATA0_files/chr_common.mop" "01_nin_facial_INITIAL_TRANS.mot"
AddDataToNamedSkeleton "nina_facial_pose" "../DATA0_files/chr_common.mop" "01_nin_facial_INITIAL_ROT.mot"
AddDataToNamedSkeleton "nina_lhand_pose" "../DATA0_files/chr_common.mop" "01_nin_Lhand_INITIAL_TRANS.mot"
AddDataToNamedSkeleton "nina_lhand_pose" "../DATA0_files/chr_common.mop" "01_nin_Lhand_INITIAL_ROT.mot"
AddDataToNamedSkeleton "nina_rhand_pose" "../DATA0_files/chr_common.mop" "01_nin_Rhand_INITIAL_TRANS.mot"
AddDataToNamedSkeleton "nina_rhand_pose" "../DATA0_files/chr_common.mop" "01_nin_Rhand_INITIAL_ROT.mot"

;apply named skeletons to body, face, and hands
SetObjectNamedSkeleton "chr_ni3_b1_mid.obj" "nina_main_pose"
SetObjectNamedSkeleton "chr_ni2_hf1_mid.obj" "nina_facial_pose"
SetObjectNamedSkeleton "chr_ni2_tfl_mid.obj" "nina_lhand_pose"
SetObjectNamedSkeleton "chr_ni2_tfr_mid.obj" "nina_rhand_pose"

;transform hair onto the head (the head bone index is 11)
;this will also transform and reparent any sub-skeletons associated with the object.
;can be used to perform transforms to multiple bones in order.
TransformAndReparentObject "chr_ni2_dk1_mid.obj" "nina_main_pose" 11
TransformAndReparentObject "chr_ni2_dk2_mid.obj" "nina_main_pose" 11
TransformAndReparentObject "chr_ni2_dk3_mid.obj" "nina_main_pose" 11
;just reparent the skeletons for the hands and face, geo is already in the right place.
;the last parameter here is the number of bones which influence weights in front of the
;base joint for the object's local skeleton. so 11 3 means reparent to joint 11 (head),
;while bone weight indices 0-2 reference joints 9-11.
ReparentObjectSkeletonAndRebaseWeights "chr_ni2_hf1_mid.obj" "nina_main_pose" 11 3
ReparentObjectSkeletonAndRebaseWeights "chr_ni2_tfl_mid.obj" "nina_main_pose" 15 2
ReparentObjectSkeletonAndRebaseWeights "chr_ni2_tfr_mid.obj" "nina_main_pose" 19 2

;skip over shadow mesh
SkipByObjectName "chr_nin_s1.obj" 1
;skip over alternate hair by material
SkipByMaterialName "material10001719" 1
SkipByMaterialName "material10001717" 1
SkipByMaterialName "material1000171b" 1

User avatar
Casedey
beginner
Posts: 27
Joined: Sat Aug 20, 2011 6:27 am
Has thanked: 23 times
Been thanked: 8 times

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by Casedey » Sat Apr 04, 2015 4:46 pm

MrAdults wrote:Sure, send it over. There's probably a false positive for the first VIF segment that's throwing off the address fixup.
Noesis crashes with these 3 files:

http://www.mediafire.com/download/uyit9 ... rashes.rar

And these 3 files loads incomplete:

http://www.mediafire.com/download/d9m6b ... +Parts.zip

User avatar
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 499 times

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by MrAdults » Sun Apr 05, 2015 10:15 pm

Thanks, they're fixed in 4.149.

IvoryCutter
beginner
Posts: 31
Joined: Sun Jan 15, 2012 9:25 am
Has thanked: 22 times

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by IvoryCutter » Wed Apr 08, 2015 3:10 pm

MrAdults wrote:I had to add ReparentObjectSkeletonAndRebaseWeights for the cinematic models, cause they reference a bunch of different poses.
Bloody Hell. Thank you so much! I noticed that the in-game skeleton was being used for the cutscene models with the older script, but since I'm still sorting stuff and applying different versions of your base script to get different things I just ignored it for now... and then I come back here and see that in the meantime you've already fixed the issue... You're bloody brilliant! :-)

One question; do you think it'd be possible to apply a character model's pose data from the game directly in noesis? Like a specific pose from a certain frame of a cutscene?

User avatar
mariokart64n
ultra-veteran
ultra-veteran
Posts: 529
Joined: Sun Jun 05, 2005 12:00 pm
Location: Ontario, Canada
Has thanked: 23 times
Been thanked: 165 times
Contact:

Re: [PS2] Death by Degrees UV extraction (500$ compensation)

Post by mariokart64n » Thu Apr 09, 2015 12:42 am

Hey just wanted to take a moment to say thankyou to IvoryCutter for coming through on the payment for the work I did.
DBD was very hard for me to figure out but with hard work I was able to get it, and the reward makes it that much sweeter.

Also thanks to Chrrox for the DBD BMS, and of course MrAdult for getting involved and adding support into noesis for DBD and TK5
I'm no where close to the level that MrAdult is at, so I appreciate it very much that I wasn't forgotten about.
Research: [DOA2U] [DOA5U]

Post Reply