Join also our Discord channel! Click here.

Tokyo Mirage Sessions / Genei Ibun Roku .apak

Post questions about game models here, or help out others!
Post Reply
Cerophono
ultra-n00b
Posts: 7
Joined: Fri Dec 19, 2014 12:42 am
Has thanked: 4 times
Been thanked: 2 times

Tokyo Mirage Sessions / Genei Ibun Roku .apak

Post by Cerophono » Wed Jul 06, 2016 3:40 pm

The .apak file is the file yielded after extracting it from the .cpk. I've been told it's a container for a model and its textures.
Each file has distinct sections, and some sections are more or less aligned when viewed under an at-glance, to my understanding meaning they aren't compressed.

TextureFinder doesn't reveal any raw textures, neither bitmap or DTX.

For my needs, a repackable QuickBMS script and a Noesis script (if the extracted work is not viewable in Maya or etc.) would be nice.

Sample: http://www64.zippyshare.com/v/VXiULdtV/file.html

User avatar
Acewell
VIP member
VIP member
Posts: 1329
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2683 times
Been thanked: 831 times

Re: Tokyo Mirage Sessions / Genei Ibun Roku .apak

Post by Acewell » Thu Jul 07, 2016 4:41 am

i made a bms script to extract the files from your apak archive samples :D
it works on the extracted pspk archive too

Code: Select all

endian big
idstring "APAK"
get DUMMY long
get FILES long
get DUMMY longlong
get DUMMY longlong
for i = 0 < FILES
    get OFFSET long
    get DUMMY long
    get SIZE long
    get DUMMY longlong
    get DUMMY longlong
    getdstring NAME 0x20
    get DUMMY long
    log NAME OFFSET SIZE
next i
the bfres file extracted from model.apak looks like it could be a model
i think i see vertex blocks and face indices in there

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3184
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 871 times
Been thanked: 1751 times

Re: Tokyo Mirage Sessions / Genei Ibun Roku .apak

Post by shakotay2 » Thu Jul 07, 2016 6:12 am

model-apak-pc000_00-bfres.jpg
first submesh:

0x6B40 1392
Vb1
32 99
0x1AC40 288
120000
0x0 255

uvs possibly at 1D044, size 8, WordUV
You do not have the required permissions to view the files attached to this post.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

Cerophono
ultra-n00b
Posts: 7
Joined: Fri Dec 19, 2014 12:42 am
Has thanked: 4 times
Been thanked: 2 times

Re: Tokyo Mirage Sessions / Genei Ibun Roku .apak

Post by Cerophono » Thu Jul 07, 2016 1:10 pm

AceWell wrote: the bfres file extracted from model.apak looks like it could be a model
i think i see vertex blocks and face indices in there
The .bfres format is itself a container for graphics. It's documented for its use in Mario Kart 8, but I don't think a full map of the format has been done yet.
Typical tools to extract .bfres files don't seem to work properly for these .bfres, however.

http://mk8.tockdom.com/wiki/BFRES_(File_Format)

Szkaradek123
mega-veteran
mega-veteran
Posts: 292
Joined: Wed May 05, 2010 8:21 pm
Location: Poland Głogów
Has thanked: 21 times
Been thanked: 612 times

Re: Tokyo Mirage Sessions / Genei Ibun Roku .apak

Post by Szkaradek123 » Thu Jul 07, 2016 6:27 pm

Hi
Can someone send female samples with textures ?
You do not have the required permissions to view the files attached to this post.

Cerophono
ultra-n00b
Posts: 7
Joined: Fri Dec 19, 2014 12:42 am
Has thanked: 4 times
Been thanked: 2 times

Re: Tokyo Mirage Sessions / Genei Ibun Roku .apak

Post by Cerophono » Thu Jul 07, 2016 7:49 pm

Szkaradek123 wrote:Hi
Can someone send female samples with textures ?
Sure. This time, I'll give the 00 outfit of pc001, and the 01 outfit of pc001. Be sure to take pics :)

The difference is the 01 outfit model.apak is 8 MB, while the 00 outfit was only 768 KB.
I'm assuming the 01 outfit actually has usable clothing meshes.

I'm pretty sure the textures are in the .apaks, just they are probably compressed by some nintendo algorithm or something.

Download: http://www79.zippyshare.com/v/k6mgNDi1/file.html

Also, does model_common.apak contain any useful data?
Edit: It seems to contain lua script and animation files for the characters.
Last edited by Cerophono on Sat Jul 09, 2016 9:36 pm, edited 1 time in total.

Szkaradek123
mega-veteran
mega-veteran
Posts: 292
Joined: Wed May 05, 2010 8:21 pm
Location: Poland Głogów
Has thanked: 21 times
Been thanked: 612 times

Re: Tokyo Mirage Sessions / Genei Ibun Roku .apak

Post by Szkaradek123 » Sat Jul 09, 2016 9:39 am

Hi

Here is a blend file for importing rigged models from samples in this topic and samples from http://zenhax.com/viewtopic.php?t=1225.
How use:
1. install Blender version 249b and Python version 26
2. doubleclick file "Blender249.blend"
3. press alt+p in Blender Text Window and select *.bfres files to import meshes or *.apak files to unpack archive

Fot textures use BFRESExtractor.exe (google) and "Wii U ripping tools pack" (google too)
You do not have the required permissions to view the files attached to this post.

Cerophono
ultra-n00b
Posts: 7
Joined: Fri Dec 19, 2014 12:42 am
Has thanked: 4 times
Been thanked: 2 times

Re: Tokyo Mirage Sessions / Genei Ibun Roku .apak

Post by Cerophono » Sat Jul 09, 2016 9:22 pm

Szkaradek123 wrote:
Fot textures use BFRESExtractor.exe (google) and "Wii U ripping tools pack" (google too)
Are you sure these work? They yield files named _dummy and when converted from .gtx to .dds, yield a black 256x256 texture.

It's only a hunch, but I don't think these follow typical BFRES usage.
Edit: Hold on, it might because 00 is totally just the dummy file.

Edit: Just me being dumb. Thanks for your work!

Szkaradek123
mega-veteran
mega-veteran
Posts: 292
Joined: Wed May 05, 2010 8:21 pm
Location: Poland Głogów
Has thanked: 21 times
Been thanked: 612 times

Re: Tokyo Mirage Sessions / Genei Ibun Roku .apak

Post by Szkaradek123 » Sat Jul 09, 2016 9:45 pm

get bfres with size > 1 MB, drag and drop on BFRESExtractor.exe
move all new files (with ext gtx and without ext) to folder "Convert" from Wii U ripping tools pack and run convertGTX.bat

MarioSonicU
advanced
Posts: 70
Joined: Thu Jun 25, 2015 11:26 pm
Has thanked: 7 times

Re: Tokyo Mirage Sessions / Genei Ibun Roku .apak

Post by MarioSonicU » Sun Jul 10, 2016 8:47 pm

will it be possible to import .anm files

ssringo
veteran
Posts: 98
Joined: Sat Apr 19, 2014 8:02 am
Has thanked: 46 times
Been thanked: 10 times

Re: Tokyo Mirage Sessions / Genei Ibun Roku .apak

Post by ssringo » Wed Aug 10, 2016 6:54 am

How were you guys able to extract the .cpk files to get the apak files? Can't find working tools or scripts for it.

Edit: I did find some tools on zenhax that could extract the cpk files but none of the apak files work with Szkaradek123's tools.

Post Reply