XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Mon Jun 26, 2017 4:59 pm

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 53 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: [PS2] Death by Degrees UV extraction (500$ compensation)
PostPosted: Sat Aug 30, 2014 5:02 am 
Offline
beginner

Joined: Sun Jan 15, 2012 9:25 am
Posts: 31
Has thanked: 22 times
Have thanks: 0 time

Hi,
over at http://ps23dformat.wikispaces.com/share/view/55330192 we've been looking into extracting models from the PS2 game Death by Degrees.
The creator of the wiki has written a quickbms script to extract 3D models from Tekken 5 which also works on Death by Degrees. Both games are Namco games that were released in 2005 for the PlayStation2 and are similar in their model format. (Link to the script: http://ps23dformat.wikispaces.com/Tekken+5)
Here's a screenshot of a look at an extracted model in Noesis.

Image

This is were we hit a wall. Apart from the messy meshes (which can be easily cleaned up manually) we don't know how to extract the meshes with UV's.

I figured I might try and take this here and see if anybody can help and/or share some advice.

Here are 2 in-game PCSX2 savestates.

Image

http://www.mediafire.com/download/2k1izk9b79i3521/DbD_sstate_007.rar

Image

http://www.mediafire.com/download/hr1xi95i4z5g7wn/DbD_sstate_003.rar

You can make the ads go away by registering



Last edited by IvoryCutter on Sat Mar 14, 2015 2:39 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: [PS2] Death by Degrees quickbms script missing UV extrac
PostPosted: Sat Feb 21, 2015 8:32 pm 
Offline
beginner

Joined: Sun Jan 15, 2012 9:25 am
Posts: 31
Has thanked: 22 times
Have thanks: 0 time
Bump, just in hopes someone capable might see this.


Top
 Profile  
 
 Post subject: Re: [PS2] Death by Degrees quickbms script missing UV extrac
PostPosted: Sat Mar 14, 2015 2:37 am 
Offline
beginner

Joined: Sun Jan 15, 2012 9:25 am
Posts: 31
Has thanked: 22 times
Have thanks: 0 time
500$ (PayPal) for anyone who finds a way to extract UV information.
I know this is generally frowned upon, but maybe somebody knowledgeable would like to earn a buck or two (or 500) instead of being asked to look into a game they might not be interested in for free.


Top
 Profile  
 
 Post subject: Re: [PS2] Death by Degrees UV extraction (500$ compensation)
PostPosted: Sun Mar 15, 2015 12:21 am 
Offline
Moderator
User avatar

Joined: Sun May 18, 2008 3:01 pm
Posts: 2401
Has thanked: 56 times
Have thanks: 1137 times
With voice acting like this you can't go wrong.
https://www.sendspace.com/file/mmphbi


Top
 Profile  
 
 Post subject: Re: [PS2] Death by Degrees UV extraction (500$ compensation)
PostPosted: Sun Mar 15, 2015 10:39 am 
Offline
ultra-veteran
ultra-veteran

Joined: Sun Jun 05, 2005 12:00 pm
Posts: 528
Location: Ontario, Canada
Has thanked: 22 times
Have thanks: 154 times
I'm trying to get the faces to read correctly, without it the UV data is useless. :\

so far I've tested the vertex def for bit masking for the termination of the face strip,
but results in game don't lead me to think that there is any bitmasking in the vertex def

after the vertex def however there is a small table which might have a correlation to the face strips
But I haven't figured anything out yet :P

I'm studying this simple hexagon shaped mesh
Image

there are a total of 13 vertices, and some vertices overlap that suggest that there is a new face strip started there
based off these clues I can assemble the below face indices list

Code:
01)   1,2,3
02)   2,3,4
[03]   3,4,5
------------------
04)   6,7,8
[05]   7,8,9
------------------ (polygons on backface)
06)   10,11,12
07)   11,12,[13]


the Mystery Table provides the following data
Code:
0x 70 06 80 01   (112,   06,   128,   01)
0x 70 0b 80 1a   (112,   11,   128,   26)
0x 70 0b 80 2e   (112,   11,   128,   56)


taking the 4th byte and converting it to binary we gets this
Code:
0x01: 00000 00 1   0   0   1
0x1A: 00011 01 0   3   1   0
0x2E: 00101 11 0   5   3   0


Notice that in the first column 3 and 5 appear and there is a correlation to the indexes of the faces I assembled

I haven't implemented it into my code yet, being its 5:00 AM and I'm about to pass out.

_________________
Research: [DOA2U] [DOA5U]


Top
 Profile  
 
 Post subject: Re: [PS2] Death by Degrees UV extraction (500$ compensation)
PostPosted: Sun Mar 15, 2015 3:53 pm 
Offline
beginner

Joined: Sun Jan 15, 2012 9:25 am
Posts: 31
Has thanked: 22 times
Have thanks: 0 time
chrrox wrote:
With voice acting like this you can't go wrong.
https://www.sendspace.com/file/mmphbi



Hahaha, Wow, I have never heard these! I've played through this game too many times for me to be comfortable saying it here, but I've never come across any of these lines. Some of them are hilarious. How did you come across this blooper reel? Is there more?



mariokart64n wrote:
I'm trying to get the faces to read correctly, without it the UV data is useless. :\

so far I've tested the vertex def for bit masking for the termination of the face strip,
but results in game don't lead me to think that there is any bitmasking in the vertex def

after the vertex def however there is a small table which might have a correlation to the face strips
But I haven't figured anything out yet :P

I'm studying this simple hexagon shaped mesh
Image

there are a total of 13 vertices, and some vertices overlap that suggest that there is a new face strip started there
based off these clues I can assemble the below face indices list

Code:
01)   1,2,3
02)   2,3,4
[03]   3,4,5
------------------
04)   6,7,8
[05]   7,8,9
------------------ (polygons on backface)
06)   10,11,12
07)   11,12,[13]


the Mystery Table provides the following data
Code:
0x 70 06 80 01   (112,   06,   128,   01)
0x 70 0b 80 1a   (112,   11,   128,   26)
0x 70 0b 80 2e   (112,   11,   128,   56)


taking the 4th byte and converting it to binary we gets this
Code:
0x01: 00000 00 1   0   0   1
0x1A: 00011 01 0   3   1   0
0x2E: 00101 11 0   5   3   0


Notice that in the first column 3 and 5 appear and there is a correlation to the indexes of the faces I assembled

I haven't implemented it into my code yet, being its 5:00 AM and I'm about to pass out.


Holy....! I don't think anyone has ever looked that deep into this game.
This is so over my head, I almost feel bad for only being able to compensate your effort and time with a meagre 500 for this rocket science. :-)
Would you mind posting/documenting your findings here just like you did in this post? Even though I personally am not yet able to wrap my head around most of it, it's still so very interesting, and it might be of help for anyone else trying to learn or doing some research.

Regarding the UV data being useless without getting the faces to read correctly, I feared as much. :-( So I take it the quickBMS script is of no use to you really, is it?

So looking forward to your future findings.


Top
 Profile  
 
 Post subject: Re: [PS2] Death by Degrees UV extraction (500$ compensation)
PostPosted: Sun Mar 15, 2015 4:36 pm 
Offline
Moderator

Joined: Mon Jul 05, 2010 8:55 pm
Posts: 581
Has thanked: 19 times
Have thanks: 212 times
I took a look at this as well. The meshes seem to be some viftag-like format. Face indices do seem complex and I'm pleased that mariokart64n has looked into it. Hopefully his solution will work, very nice work mariokart64n :wink:

I think the models are stored within the .obj files.

The .obj files look to be a container for multiple nupd mesh files? Possibly at multiple lod levels.

Format:

Code:
struct objHdr
{
unsigned int uiUnk00;
unsigned int uiUnk01;
unsigned int uiNumNupdFiles;
unsigned int uiUnk02;

unsigned int uiOffsetNupdPtrs; //Offset to Nupd Pointers
unsigned int uiNupdStart; //Start offset of first Nupd?
unsigned int uiOffsetNupdNames; //Offset to Nupd Names
unsigned int uiUnk03;
};


The rest of it is pretty simple for the .obj. uiOffsetNupdNames points to an offset which holds more pointers to the name of each nupd file (i think). This is enough info to to begin reading the singular mesh files but yeah, face indices got me on this one 8D so I'll leave it to mariokart64n :)

_________________
Click the thanks button if I helped!


Top
 Profile  
 
 Post subject: Re: [PS2] Death by Degrees UV extraction (500$ compensation)
PostPosted: Sun Mar 15, 2015 6:26 pm 
Offline
beginner

Joined: Sun Jan 15, 2012 9:25 am
Posts: 31
Has thanked: 22 times
Have thanks: 0 time
Thank you so much for your input, Gh0stBlade! I wish it was only the complexity of face indices posing a challenge for me :-/ As I said, the way you guys look at code is rocket science level stuff and then some. Kudos!


Top
 Profile  
 
 Post subject: Re: [PS2] Death by Degrees UV extraction (500$ compensation)
PostPosted: Mon Mar 16, 2015 3:57 am 
Offline
ultra-veteran
ultra-veteran

Joined: Sun Jun 05, 2005 12:00 pm
Posts: 528
Location: Ontario, Canada
Has thanked: 22 times
Have thanks: 154 times
ok another update :eek:

I said last that I had a mystery table and I thought it correlated to the face strips
I wanted to confirm that without a doubt...

So I imported the vertices from her model and isolated the heel of her shoe
Image


I wanted to do some testing in PCSX2, and null the data in the face strip table.

but that resulted in a game crash, so instead I duplicated the first entry in the table
over the rest of the table entries.
Image


The results confirms that when we modify the table in the game we get the same
result as we do in 3dsmax when we generate our strips without knowing the strip terminations.


After I made my confirmation I went to scratching my head for hours.

Since I don't know anything about disassembly or anything like that, I was
basically pissing in the dark. lol I didnt know how to further approach the problem.. :\

So lets look at the table data together and I'll share what I know so far

the stuff here highlighted in red is the face strip info from that object above.
Quote:
00 05 00 01 00 00 00 20 7F FF FF FF 01 80 06 70
29 80 06 70 42 80 0B 70 5B 80 06 70 6F 80 06 70
83 80 06 70
00 00 00 00 01 01 00 01 00 00 00 20
00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00

there also seems to be other command calls here in the block,
but... I don't think thats important at the moment...


It would appear that column 1 and 3 impact where the strip is started from
Code:
1)        01 80   06 70      ->hex2dec:    1  128     6  112
2)        29 80   06 70      ->hex2dec:   41  128     6  112
3)        42 80   0B 70      ->hex2dec:   66  128    11  112
4)        5B 80   06 70      ->hex2dec:   91  128    06  112
5)        6F 80   06 70      ->hex2dec:  111  128    06  112
6)        83 80   06 70      ->hex2dec:  131  128    06  112

I believe the 3rd column is bit masked, I'm going to extract bits 1,2
Code:
info(dec)    Binary               Dec(Extracted)
6              000001 | 10      1 | 2
6              000001 | 10      1 | 2
11             000010 | 11      2 | 3
6              000001 | 10      1 | 2
6              000001 | 10      1 | 2
6              000001 | 10      1 | 2

Great now lets have a look at this incredibly confusing picture that I drew
I reconstructed the faces based on logical observations of how the model should look

and also confirmed by poking in PCSX2 while the game was running

Note that there are 6 strips, I've coloured each stripped surface with a different colour
and labelled it with a face index
Image

Let me break this down:
based on my face list I know that there are 6 elements.
and as it soo happens there are 6 entries in the strip table. :)

we need info for starting and stopping the strip somewhere in here and I've
tried to lay it out visually, and in the text representation its divided into columns.
I try to make a connection with my face list and the info provided to us in the strip table
Code:
1 (  1)  01,02,03              2 ( 41)  09,10,11              3 ( 66)  15,16,17              4 ( 91)  19,20,21              5 (111)  23,24,25              6 (131)  27,28,29
         02,04,03                       10,12,11                       16,18,17                       20,22,21                       24,26,25                       28,30,29
         03,04,05                       11,12,13
         04,06,05
         05,06,07
         06,08,07

         ( 6)=1,2                       ( 6)=1,2                       (11)=2,3                      ( 6)=1,2                       ( 6)=1,2                       ( 6)=1,2


missing ->               7,8                          12,13,14                        17,18                         21,22                          25,26


example face 1
01 80 06 70

lets name these into variables
a = 1 (1st byte)
b = 1 (3rd byte[0x06], bits 3-8)
c = 2 (3rd byte[0x06], bits 1-2)

and I've come up with this formula;
((a-1)/5)+b = face_pos

so lets plugin the numbers
((1-1)/5)+1 = 1

lets do the rest of them
((41-1)/5)+1 = 9
((66-1)/5)+2 = 15
((91-1)/5)+1 = 19
((111-1)/5)+1 = 23
((131-1)/5)+1 = 27

Note these match the starting face index in each element shown above
and the number of missing indices seems to somehow be indicated
in the next strip info ??

I imagine I got this all wrong, when you stare are a number for soo long
your mind will start to imagine logical ways to make it relevant, but in fact could be entirely false

anyway we will have to see when I code this up and test it out, but until then..
I think I'll call it a night and get some rest :P

_________________
Research: [DOA2U] [DOA5U]


Top
 Profile  
 
 Post subject: Re: [PS2] Death by Degrees UV extraction (500$ compensation)
PostPosted: Mon Mar 16, 2015 10:04 am 
Offline
beginner

Joined: Sun Jan 15, 2012 9:25 am
Posts: 31
Has thanked: 22 times
Have thanks: 0 time
Whatever Namco were cooking up back in 2004, you're totally on to it! Your conclusion even makes sense to me (just how you got there is still a blur) :-D
Incredible work, mariokart!
Thanks for the insightful documentation! You certainly left on a cliff hanger :-)


Top
 Profile  
 
 Post subject: Re: [PS2] Death by Degrees UV extraction (500$ compensation)
PostPosted: Tue Mar 17, 2015 6:11 am 
Offline
ultra-veteran
ultra-veteran

Joined: Sun Jun 05, 2005 12:00 pm
Posts: 528
Location: Ontario, Canada
Has thanked: 22 times
Have thanks: 154 times
coded it up and it failed on the first strip lol

there are different values in the table and I can adapt the formula but
more study is needed to understand how this works... its annoying cause the numbers fit but shift

strip info
01 80 04 70
1F 80 04 70
2E 80 07 70
40 80 07 70
4F 80 04 70
5B 80 04 70
64 80 07 70

hex > dec
[1,128,4,112] :: 0 / 3 = 0 + 1 = 1
[31,128,4,112] :: 30 / 3 = 10 + 1 = 11
[46,128,7,112] :: 45 / 3 = 15 + 2 = 17
[64,128,7,112] :: 64 / 3 = 21 + 2 = 23
[79,128,4,112] :: 78 / 3 = 26 + 1 = 27
[91,128,4,112] :: 90 / 3 = 30 + 1 = 31
[100,128,7,112] :: 99 / 3 = 33 + 2 = 35

dec > bin
4 = 10 0 (2|0)
7 = 11 1 (3|1)

required face list
Quote:
1,2,3
2,3,4
3,4,5
4,5,6
5,6,7
6,8,7
7,8,9
8,10,9
----------------------> 2 (9,10)
11,12,13
12,14,13
13,14,15
----------------------> 3 (14,15,16)
17,18,19
18,20,19
19,20,21
----------------------> 3 (20,21,22)
23,24,25
24,26,25
----------------------> 2 (25,26)
27,28,29
28,30,29
----------------------> 2 (29,20)
31,32,33
----------------------> 3 (32,33,34)
35,36,37



EDIT

doh` ! >_<
mariokart64n wrote:
Quote:
00 05 00 01 00 00 00 20 7F FF FF FF 01 80 06 70
29 80 06 70 42 80 0B 70 5B 80 06 70 6F 80 06 70
83 80 06 70
00 00 00 00 01 01 00 01 00 00 00 20
00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00

there also seems to be other command calls here in the block,
but... I don't think thats important at the moment...

I'm an idiot that divisor is supplied before the table
00 05 00 01 00
5 is the divisor, in the example above 00 03 00 01 was included

.. that explains that magical 5 I had before, and why I needed to use 3 this time..


EDIT2
:)

Image

_________________
Research: [DOA2U] [DOA5U]


Top
 Profile  
 
 Post subject: Re: [PS2] Death by Degrees UV extraction (500$ compensation)
PostPosted: Tue Mar 17, 2015 8:30 am 
Offline
beginner

Joined: Sun Jan 15, 2012 9:25 am
Posts: 31
Has thanked: 22 times
Have thanks: 0 time
:o

You've done it! Impressive work!
What's the next step?


Top
 Profile  
 
 Post subject: Re: [PS2] Death by Degrees UV extraction (500$ compensation)
PostPosted: Wed Mar 18, 2015 4:44 am 
Offline
ultra-veteran
ultra-veteran

Joined: Sun Jun 05, 2005 12:00 pm
Posts: 528
Location: Ontario, Canada
Has thanked: 22 times
Have thanks: 154 times
Image

_________________
Research: [DOA2U] [DOA5U]


Top
 Profile  
 
 Post subject: Re: [PS2] Death by Degrees UV extraction (500$ compensation)
PostPosted: Wed Mar 18, 2015 7:52 am 
Offline
beginner

Joined: Sun Jan 15, 2012 9:25 am
Posts: 31
Has thanked: 22 times
Have thanks: 0 time
8D 8D 8D


Top
 Profile  
 
 Post subject: Re: [PS2] Death by Degrees UV extraction (500$ compensation)
PostPosted: Wed Mar 18, 2015 8:20 am 
Offline
ultra-veteran
ultra-veteran

Joined: Sun Jun 05, 2005 12:00 pm
Posts: 528
Location: Ontario, Canada
Has thanked: 22 times
Have thanks: 154 times
Image


_________________
Research: [DOA2U] [DOA5U]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 53 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: Beyond69, Google [Bot], koreago, redtank, RosaWeyland, streetracer23 and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group