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

How do i extract the files from onechanbara kagura

Read or post about compression. And decompression. Or ask questions how to decompress your files.
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: How do i extract the files from onechanbara kagura

Post by howfie »

cool, progress is being made he he he almost there.

current problem i'm having: i found the skeleton, but... the skeleton is scaled and the scaling values are somewhere... can't find them. for the first model the skeleton is scaled by about 60% and rotated around X-axis by 90 degrees after outputting the matrices (with translation values modified to relative coordinates) to a DAE file.

http://www.mediafire.com/?712s3p9dzrami2i

Image
gggrrrhhh2000
n00b
Posts: 11
Joined: Fri Aug 13, 2010 7:34 am
Has thanked: 3 times
Been thanked: 1 time

Re: How do i extract the files from onechanbara kagura

Post by gggrrrhhh2000 »

@howfie : Great job on contructing the bones!
I also have this "Scaling" problem when extracting the UVs (seeing your .obj file, the UV range is still small caused by normalizing the unsigned shorts),
so far I managed to get some decent result in scaling the UV by :

multiplying them by 64 (a magic number :?: )

Hope that can be some hint for you.
PS : I still can't find the Material ID anywhere, might work on this some other time I think..
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: How do i extract the files from onechanbara kagura

Post by howfie »

cool thx, i'll go hunting for the material data too in a couple days. need to take a break ha ha ha.
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: How do i extract the files from onechanbara kagura

Post by chrrox »

if you want to view the xpr files without having to run them through unbundler this will work.
viewtopic.php?f=18&t=8102
gggrrrhhh2000
n00b
Posts: 11
Joined: Fri Aug 13, 2010 7:34 am
Has thanked: 3 times
Been thanked: 1 time

Re: How do i extract the files from onechanbara kagura

Post by gggrrrhhh2000 »

Awesome, the plugin works fine. Thanks chrrox :]
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: How do i extract the files from onechanbara kagura

Post by howfie »

Fixed the bones thing... Max was converting units so I guess instead of having my program generate an OBJ + DAE I guess I will have to just move to DAE only. All that's left is to find the weights and fix a few vertex formats and it will be ready for a release. Animations are store in the mot directories, and it's tempting to start working on it.

Image
gggrrrhhh2000
n00b
Posts: 11
Joined: Fri Aug 13, 2010 7:34 am
Has thanked: 3 times
Been thanked: 1 time

Re: How do i extract the files from onechanbara kagura

Post by gggrrrhhh2000 »

@howfie : great progress!! Where did you find the Material Id to split the UVs?
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: How do i extract the files from onechanbara kagura

Post by howfie »

I didn't. I found material names (all names are 4 characters long) and I found the triangle groups section (how the index buffer is grouped). However, there usually are more groups than there are material names, and I couldn't find out how the groups are linked to the material names. So, in my modeler I just select a group (which I name surface_001, surface_002, and so on) and texture it manually ha ha ha.

For example, in pl00_00_00 http://www.mediafire.com/?q429cxxgfw1cz7o (my program decompresses and unpacks everything so here is my sample file):

Materials start at 0xA0 and each material is 0x38 bytes long. Data looks like this:

Code: Select all

-9.53648
143.086
-10.7851
9.53648
163.921
8.07738
8
6
1
face
0
0
0
0
4294967295
There are 24 materials in this model.

Triangle groups start at 0x26A0 and end at 0x2767. Each group is 8 bytes. First number is number of triangle in group. Second number is triangle offset. But there is no data here that indicates how to texture the triangle groups. You can use this data to split the UVs. Here are the first two entries:

Code: Select all

06A0 0000 00000000
00AC 0000 000006A0
#1 There are 0x6A0 triangles in first group, starting at the 0th triangle.
#2 There are 0x0AC triangles in second groups, starting at the 0x6A0th triangle.
Multiply by 6 (sizeof(uint16)*3 points per triangle) to get the right offset.

There are 25 triangle groups in this model (one more group than materials).

BTW, I was using this formula for the player UV map... it works for every group except for one or two in every model! It's a variation of your multiply by 64 technique he he he. It's still pissing me off!

Code: Select all

v.tu = (v06 % 1024)/1023.0f;
v.tv = 1.0f - (v07 % 1024)/1023.0f;
gggrrrhhh2000
n00b
Posts: 11
Joined: Fri Aug 13, 2010 7:34 am
Has thanked: 3 times
Been thanked: 1 time

Re: How do i extract the files from onechanbara kagura

Post by gggrrrhhh2000 »

@howfie: Awesome :mrgreen: ! I Work on it right away!

EDIT : before the post, I managed to find the material names too, but I can't find how it links with the mesh.
Your explanation about the "triangle groups" really makes everything clear.
Thanks a lot howfie :D !
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: How do i extract the files from onechanbara kagura

Post by howfie »

Forgot to mention, when you display the material data without the bounding box data you get something like this:

Code: Select all

 0 6 1 face 0 0 0 0
 6 4 1 eye  0 0 0 0
10 4 1 eye_ 0 0 0 0
14 4 1 eye_ 0 0 0 0
18 4 0 _mat 0 0 0 0
22 4 1 mout 0 0 0 0
26 4 1 wep_ 0 0 0 0
30 4 1 wep_ 0 0 0 0
34 4 1 body 0 0 0 0
38 4 0 _muf 0 0 0 0
42 4 1 bura 0 0 0 0
46 4 0 _bur 0 0 0 0
50 4 0 _bur 0 0 0 0
54 4 1 pant 0 0 0 0
58 4 1 belt 0 0 0 0
62 4 1 belt 0 0 0 0
66 4 1 leg  0 0 0 0
70 4 0 _leg 0 0 0 0
74 4 0 _bel 0 0 0 0
78 4 0 _bel 0 0 0 0
82 4 1 grab 0 0 0 0
86 4 0 _rib 0 0 0 0
90 4 1 hat  0 0 0 0
94 4 1 hat_ 0 0 0 0
Wonder what that first number means? They all increment by 4 except for face with has a 6. All the ones with _name have a 0, the others have a 1. Hmmm... Ha ha ha fun shit trying to figure this stuff out isn't it?
gggrrrhhh2000
n00b
Posts: 11
Joined: Fri Aug 13, 2010 7:34 am
Has thanked: 3 times
Been thanked: 1 time

Re: How do i extract the files from onechanbara kagura

Post by gggrrrhhh2000 »

Yeah, that's pretty interesting. If all of them are 4s and only the "face" is 6, then it might work like what u wrote above :

24 materials, 25 groups
4 code = 1 group for 1 material
6 code = 2 groups for 1 material

then it would be the reason why there are 25 groups while there are only 24 materials.
But this is just a hypothesis.
Might look at this later (I'm still working on your "triangle groups" concept on my program now :P )
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: How do i extract the files from onechanbara kagura

Post by howfie »

You're genius ha ha ha! Gave me a good idea where to look. There was a part that I ignored that originally I thought was crap data. Not so! Right after the material section for pl_000_00, there is this data starting at 0x5E0, a sequence of unsigned short values. If you think of all data as shorts and each one of those 4s and 6s is the number of shorts you get this. Notice the ones that start with 0x3000 and that each group ends with 0x1000.

Code: Select all

 0 6 face: 2000 4000 3000 2001 3001 1000
 6 4 eye : 2002 4001 3002 1000
10 4 eye_: 2003 4002 3003 1000
14 4 eye_: 2004 4003 3004 1000
18 4 _mat: 2005 4004 3005 1000
22 4 mout: 2006 4005 3006 1000
26 4 wep_: 2007 4006 3007 1000
30 4 wep_: 2008 4007 3008 1000
34 4 body: 2009 4008 3009 1000
38 4 _muf: 200A 4009 300A 1000
42 4 bura: 200B 400A 300B 1000
46 4 _bur: 200C 400B 300C 1000
50 4 _bur: 200D 400C 300D 1000
54 4 pant: 200E 400D 300E 1000
58 4 belt: 200F 400E 300F 1000
62 4 belt: 2010 400F 3010 1000
66 4 leg : 2011 4010 3011 1000
70 4 _leg: 2012 4011 3012 1000
74 4 _bel: 2013 4012 3013 1000
78 4 _bel: 2014 4013 3014 1000
82 4 grab: 2015 4014 3015 1000
86 4 _rib: 2016 4015 3016 1000
90 4 hat : 2017 4016 3017 1000
94 4 hat_: 2018 4017 3018 1000
The face, which has two groups, has two 0x3000 values in it. It also has 2 0x2000 groups in it but if you look at another model, pl_003_00 (Saki), you will see that it's actually the 0x3000 values that associate a triangle group with a material!

Code: Select all

 0 4 - 2000 4000 3000 1000 (mouth, only 1 0x3000 value)
 4 4 - 2001 4001 3001 1000 (eyeball, only 1 0x3000 value)
 8 6 - 2002 4002 3002 2003 3003 1000 (lips + face, 2 0x3000 values)
14 4 - 2004 4003 3004 1000 (upper small eyelashes, 1 0x3000 value)
18 4 - 2005 4004 3005 1000 (lower small eyelashes, 1 0x3000 value)
22 4 - 2006 4005 3006 1000 (upper large eyelashes, 1 0x3000 value)
26 4 - 2007 4006 3007 1000 (arms, 1 0x3000 value)
30 4 - 2008 4007 3008 1000 (sword, 1 0x3000 value)
34 5 - 2009 4008 3009 200A 300A 1000 (weapon holster + strap, 2 0x3000 values)
40 4 - 200B 4009 300B 1000 (weapon handle, 1 0x3000 value)
44 9 - 200C 400A 300C 200D 400B 300D 400C 300E 1000 (fingertips + hands + gloves, 3 0x3000 values)
53 4 - 200E 400D 300F 1000 (blouse, 1 0x3000 value)
57 6 - 200F 400E 3010 2010 3011 1000  (blouse ribbons + blouse trimmings, 2 0x3000 values)
63 7 - 2011 400F 3012 2012 4010 3013 1000 (upper body straps, upper body stap locks, 2 0x2000 values)
70 6 - 2013 4011 3014 2014 3015 1000 (pants + shoes, 2 0x2000 values)
76 4 - 2015 4012 3016 1000 (pant trimmings, 1 0x2000 value)
80 4 - 2016 4013 3017 1000 (blouse trimming, 1 0x2000 value)
84 4 - 2017 4014 3018 1000 (stomach, 1 0x2000 value)
88 4 - 2018 4015 3019 1000 (part of blouse, 1 0x2000 value)
The last 0x3000 value is 0x3019, and the 0x19 part is an index into the triangle group. 0x19 = index 25 and there are 26 triangle groups in model pl_003_00! Got it! Now we know how to name the triangle groups!

However, one triangle group for most models (but not all of them have a messed up UV). Below is pl_003_00 (Saki). Can you spot the bad UV map, it's on the leg he he he stop looking at the panties man ha ha ha.

Image
gggrrrhhh2000
n00b
Posts: 11
Joined: Fri Aug 13, 2010 7:34 am
Has thanked: 3 times
Been thanked: 1 time

Re: How do i extract the files from onechanbara kagura

Post by gggrrrhhh2000 »

@howfie : Wow, I'm glad that can be a hint for you :mrgreen: !

Yes, I noticed some error in the UVs.
Also, if you check pl_02_00(Aya), some groups' uvs are separated too far away up (y + 1.0).
Our original "UV rescaling calculation" may cause this, and we need to start looking for the real UV scaling value I guess.
Last edited by gggrrrhhh2000 on Fri Jan 27, 2012 1:44 am, edited 1 time in total.
gggrrrhhh2000
n00b
Posts: 11
Joined: Fri Aug 13, 2010 7:34 am
Has thanked: 3 times
Been thanked: 1 time

Re: How do i extract the files from onechanbara kagura

Post by gggrrrhhh2000 »

After extracting the XPR textures in pl00_00(kagura) , I got these files (in .png, .tga or .dds):
- body00 (diffuse, normal, specular)
- face00 (diffuse, normal, specular)
- wear00 (diffuse, normal, specular)
- wear01 (diffuse, normal, specular)
4 Main Textures * 3 (diff, norm , spec), Total : 12 files

So far, we have reduced :

A.Triangle Groups (25 pcs)" --> B.Material Groups (24 pcs)"

So the idea next would be to convert :

B.Material Groups (24 pcs)" --> C.Texture Groups (4 pcs, based on the XPR above)"

If we can find these "B->C" links, we can have a correct group of UV coordinates.
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: How do i extract the files from onechanbara kagura

Post by howfie »

yep yep yep, looks like the UVs are being wrapped around a little bit. It's funny though because it doesn't happen to all UVs in the same triangle group. For example, here is group #24 from Aya. For her bra, the bra is fine, but the straps are messed up! All I had to do to fix it so it looks like in game is move the ones close to zero to one.

Before:
Image

After:
Image
Post Reply