Join also our Discord channel! Click here.

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

Post questions about game models here, or help out others!
IvoryCutter
beginner
Posts: 31
Joined: Sun Jan 15, 2012 9:25 am
Has thanked: 22 times
Been thanked: 1 time

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

Post by IvoryCutter » Sat Aug 30, 2014 5:02 am

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/2k1iz ... te_007.rar

Image

http://www.mediafire.com/download/hr1xi ... te_003.rar
Last edited by IvoryCutter on Sat Mar 14, 2015 2:39 am, edited 1 time in total.

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

Re: [PS2] Death by Degrees quickbms script missing UV extrac

Post by IvoryCutter » Sat Feb 21, 2015 8:32 pm

Bump, just in hopes someone capable might see this.

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

Re: [PS2] Death by Degrees quickbms script missing UV extrac

Post by IvoryCutter » Sat Mar 14, 2015 2:37 am

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.

User avatar
chrrox
Moderator
Posts: 2564
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1308 times

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

Post by chrrox » Sun Mar 15, 2015 12:21 am

With voice acting like this you can't go wrong.
https://www.sendspace.com/file/mmphbi

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

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

Post by mariokart64n » Sun Mar 15, 2015 10:39 am

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: Select all

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: Select all

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: Select all

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]

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

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

Post by IvoryCutter » Sun Mar 15, 2015 3:53 pm

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: Select all

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: Select all

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: Select all

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.

Gh0stBlade
Moderator
Posts: 684
Joined: Mon Jul 05, 2010 8:55 pm
Has thanked: 20 times
Been thanked: 333 times

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

Post by Gh0stBlade » Sun Mar 15, 2015 4:36 pm

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: Select all

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!

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

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

Post by IvoryCutter » Sun Mar 15, 2015 6:26 pm

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!

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

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

Post by mariokart64n » Mon Mar 16, 2015 3:57 am

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.
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: Select all

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: Select all

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: Select all

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]

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

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

Post by IvoryCutter » Mon Mar 16, 2015 10:04 am

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 :-)

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

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

Post by mariokart64n » Tue Mar 17, 2015 6:11 am

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
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:
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]

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

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

Post by IvoryCutter » Tue Mar 17, 2015 8:30 am

:o

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

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

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

Post by mariokart64n » Wed Mar 18, 2015 4:44 am

Image
Research: [DOA2U] [DOA5U]

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

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

Post by IvoryCutter » Wed Mar 18, 2015 7:52 am

8D 8D 8D

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

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

Post by mariokart64n » Wed Mar 18, 2015 8:20 am

Image
Research: [DOA2U] [DOA5U]

Post Reply