Page 1 of 4

Atlus's .PB (3D model format)

Posted: Mon Sep 22, 2008 12:56 pm
by cippyboy
The format is used in almost all of Atlus's PS2 games : Nocturne, DDS1&2, Devil Summoner. From Persona3 onwards, there's the .RMD format that doesn't look similar at all although they still use the .TMX format for the textures.

Ok, so first, the games listed above all have the IMG/DDT archive format which is basically an image header (the DDT) and the actual packed data (the IMG). I managed to figure out the DDT format and make up the directory structure but... when reading from the IMG there's these huge gaps between the files and from what I've seen they are irregular (different sizes for each file), and therefore I made up my reader to just ignore zero bytes and then begin the file when there's something different than zero. And the thing is that sometimes this isn't true, and the file doesn't get extracted well, and debugging is even harder considering the 7 000+ files.

On the Nocturne DVD, Atlus forgot an Windows executable that opens up .TMX files and so I've been able to figure out how the TMX header looks like although some parts are very dubious (like a byte with the value 19, that is present in most files, but in other files it's 0).

Now I'm focusing my attention on the .PB model format that contains model data, and it's like a file per model which means it has .TMX textures stacked in it (and possibly animations too). So far I partially figured out how the header looks like and I'm trying to get a hold of the actual polygons/normal/texcoords.

I'll make more posts once I discover more.

EDIT: The new release(v0.3) includes an inf file for configuration. I hope everyone gets what the variables are used for.

January 2012 EDIT : Improved conversion, Win32 GUI and full source code is now available to download.

Re: Atlus's .PB (3D model format)

Posted: Mon Sep 22, 2008 12:58 pm
by cippyboy
Anyways, yesterday I worked a little bit more on .PB models and discovered that some files have wrong headers and direct the texture reading to other places than the real ones which is fuck weird because it screws up my processing. Next I discovered weird arrays of numbers right after the textures, like
1 0 -1 (72 bytes)
1 1 0 (72 bytes)
1 2 1 (72 bytes)
1 3 1 (72 bytes)
.......
1 89 88 (? bytes)
It's really weird because I know where they end, but don't know where the rest of the data begins (there's <=72 bytes, and any of them could start a new array of data). For the weird numbers, I think it's the skeletal bone tree(first number is ignored, second is child, and next it's parent) and right next to them there's 18 floats, which could mean a transformation matrix (since most values are near PI/2, 0 or 1), but some matrices sure look weird (like 1.2e-23) so I'm having some doubts.

EDIT:4 days later I found out that's the scene graph actually, and shows some kind of hierarchy, and in the 72 bytes between there's a position, some kind of rotation+scale and 2 file indexes to where the bounding box is and the start of the index array.

Re: Atlus's .PB (3D model format)

Posted: Mon Sep 22, 2008 10:24 pm
by Darkfox
This should have been put in the 3D models section but I think one of the mods can move it. As for the data given it may be that it is just an odd format that Atlus developed. Though I'll wait for some input from the other 3D people here.

Re: Atlus's .PB (3D model format)

Posted: Thu Sep 25, 2008 10:30 pm
by cippyboy
I finally got the meaning behind a weird number and managed to accurately extract all the files from a DDT\IMG archive. I updated the main post to include the exexcutable you can use.The pack includes an INF file for configuration. Enjoy.

Re: Atlus's .PB (3D model format)

Posted: Mon Sep 29, 2008 10:18 pm
by cippyboy
First look at the some vertex data extracted ! :D

I worked on it some more and found out how to begin reading the index/vertex/normal/texcoord/color data but... there's still missing links like when to stop reading, what kind of data comes next (either one of texcoords/normals/colors) and what kind of render mode to use (triangles/triangle strips/fans/quads/etc).

Here's a look at "kage.PB" from Digital Devil Saga 1, hope you like it :D

Re: Atlus's .PB (3D model format)

Posted: Tue Sep 30, 2008 7:49 pm
by Darkfox
Heh! Well that is progress none the less to see something visual! But which is "kage" from DDS1?

Also, the program keeps saying the side-by-side configuration is incorrect.

I set the right drive path to the Digital Devil Saga DVD.

The error states as follows:

"The application has failed because its side-by-side configuration is incorrect. Please see the application event log for more detail."

Re: Atlus's .PB (3D model format)

Posted: Thu Oct 02, 2008 10:52 am
by cippyboy
Ups! You'll need MSVCR90.DLL to run it :D. I usually compile my projects with dynamic linking because a few dependencies I have. If that doesn't work, check with the (www.)dependencywalker(.com) if you have any missing DLLs.

Re: Atlus's .PB (3D model format)

Posted: Thu Oct 02, 2008 8:22 pm
by Darkfox
Error: The Side-by-Side configuration information for "c:\pcsx2_0.9.4\atlus v0.3\ATLUS HACKINATOR RELEASE.EXE" contains errors. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail (14001).
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
Is what it is saying through that.

Re: Atlus's .PB (3D model format)

Posted: Thu Oct 02, 2008 9:59 pm
by cippyboy
Even after you put that DLL near it ?

Re: Atlus's .PB (3D model format)

Posted: Thu Oct 02, 2008 11:15 pm
by Darkfox
Yeah. O_o SHLWAPI.DLL and IEFRAME.DLL are in the red.

SHLWAPI
The function in red is #467

For IEFrame it is
#159, #141, #160, #165, #167, #142

Re: Atlus's .PB (3D model format)

Posted: Thu Oct 02, 2008 11:59 pm
by cippyboy
Hm... the thing is I had 2 builds, release and release with edit & continue, and they were named the same and I don't know which version I ended up distributing :D. This time I built the executable with static libs so it should work. First post was updated.

Re: Atlus's .PB (3D model format)

Posted: Fri Oct 03, 2008 1:42 am
by Darkfox
Now it crashes... O_o

"Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module." In Dependency Walker. What a weird thing it keeps doing...

IEFRAME:
#160, #159, #141

SHLWAPI:
#467

Well, much was resolved at least.

Re: Atlus's .PB (3D model format)

Posted: Fri Oct 03, 2008 1:55 pm
by cippyboy
Damn...
I double checked and yeah, the past executable shouldn't exactly work because I did it in a hurry and forgot I had a variable that was overriding the current config so I can freely do my PB tests. Test it with the new one. If that doesn't work, hm... don't know what else to try. Are you running Vista by the way ?

Re: Atlus's .PB (3D model format)

Posted: Fri Oct 03, 2008 8:48 pm
by Darkfox
Yes, I use Vista. Is that the problem?

Re: Atlus's .PB (3D model format)

Posted: Sun Oct 05, 2008 3:56 pm
by cippyboy
No idea. I still use XP :D. If the problem persists (you haven't told me if it works or not with the new executable ?) I'll try to test it on Vista. I have it installed, but I never use it.

EDIT: I opened up Vista yesterday, and while the old executables aren't working, the new one at least starts. Haven't tried to extract an image though.