Page 1 of 2

Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (._X3)

Posted: Mon Jul 17, 2017 6:12 am
by uyjulian
I'm not that familiar with 3D formats, so I need help to convert model files (._X3) from Sora the 3rd to .obj or .ply files.
Here's a ingame screenshot a scene that contains the model:
Image
Another tool, called GameViewer, which is available at https://github.com/prefetchnta/gameviewer can view, but not export as 3D model, these model files:
Image

Here's a sample of the file + textures: https://transfer.sh/CG9oD/sora_3rd_sample.zip

Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.

Posted: Mon Jul 17, 2017 8:32 pm
by shakotay2
uyjulian wrote:Another tool, called GameViewer, [...] can view, but not export as 3D model, these model files
a viewer that doesn't have an export option? :D Very funny. :roll:

Anyways, the format appears to be simple, but there's about 721 assumed small submeshes (SMs) in the sample file.
So a script is required to gather them all.
You might try a 3D ripper on a scene loaded by that famous viewer, so that you can rip some meshes, hopefully.

I used hex2obj (view link in my sig) to get one of the bigger SMs displayed:
U7000_X3.jpg

Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.

Posted: Tue Jul 18, 2017 3:24 am
by uyjulian
Thanks!
Image
Image
Image

I think all I need to do is figure out the space between CD3DFile_Mesh and the start of the vertices data.

Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.

Posted: Tue Jul 18, 2017 6:40 pm
by uyjulian
Here's my progress so far:
Image
https://gist.github.com/uyjulian/db43b5 ... 00bc78cfdc

Anybody know how to map textures?

Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.

Posted: Tue Jul 18, 2017 8:05 pm
by shakotay2
well done, see you used python.

I wrote a short C program (not as short as your script :D ), same result:
U7000_X3-all.jpg
texturing, iirc goes like this: select object, create material, apply texture. (Or simply open an image in UV/Image editor.)

Since there's so many submeshes (SMs) it would make sense to create mtl files via code.
But there's 21 .png textures only which are listed at the beginning of the _X3 file. So some grouping of SMs is required, I guess.

I tried to apply U70i1104.png (books) manually but I couldn't find a fitting uv map.

U70i3804.png appears to fit nicely. So that's maybe a way to find the connection between texture and mesh(es) in the _X3 file.

Code: Select all

   cnt= 0 ;
   nValue[0]= 0; nValue[1]= 0; nValue[2]= 1; nValue[3]= 0; nValue[4]= 2; nValue[5]= 0;    // 0000 0100 0200
   do {
        offs2 = FindBytes(lpFBuf, j, dwFileSize-j, nValue, 6) ;       // j is offset here
        if (offs2!=0) {
            pFBuf += offs2 ; j += offs2 ;
            FIaddr_arr[cnt]= j ; pFBuf -= 4 ; j -= 4 ;
            GetDW(pFBuf, j, FIcnt, false) ; FIcnt_arr[cnt]= FIcnt ;
                //fprintf( stream, "# %3d 0x%x: %d\n", cnt, FIaddr_arr[cnt], FIcnt) ;
            if (cnt<1998) cnt++ ; else { chMB("Too many submeshes!\nbreak") ; j= dwFileSize ;}
        }
        { pFBuf += 7 ; j += 7 ; }     // 
   } while ((offs2!=0)&&(j<dwFileSize)) ;
   FIaddr_arr[cnt]= dwFileSize ;        // wichtig für Endabfrage

   cntMax= cnt ; cnt= 0 ;   //
   do {
        log_FIs(stream, FIaddr_arr[cnt], minFaceInd, maxFaceInd, lastFaceInd, FIcnt_arr, cnt) ;
        addrV= FIaddr_arr[cnt] -4 - vCnt_arr[cnt] * 40 ; Vsum += vCnt_arr[cnt] ;
        fprintf( stream, "# vertex addr: 0x%x\n", addrV) ;
        log_Verts(addrV, vCnt_arr[cnt], 40) ; logUVs(addrV+32, vCnt_arr[cnt], 40) ;
        cnt++ ;
   } while (cnt<cntMax);
   fprintf( stream, "# vertex sum: %d\n", Vsum) ;

Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.

Posted: Wed Jul 19, 2017 4:42 am
by uyjulian
There appears to be multiple textures in a set of faces, and I have no idea which face goes with which texture.
Here's my progress so far:
https://gist.github.com/uyjulian/db43b5 ... 00bc78cfdc
Image
Here's some areas of the mesh area that I can't figure out:
Image
Image
Image

Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.

Posted: Wed Jul 19, 2017 4:26 pm
by uyjulian
Okay, so here's another sample:
https://transfer.sh/nu3jC/sora_3rd_2.zip

Image
The new sample was formatted a bit differently so I adjusted my script.
https://gist.github.com/uyjulian/db43b5 ... 00bc78cfdc

Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.

Posted: Thu Jul 27, 2017 5:52 am
by uyjulian
Textures have been mapped!!!!
Image
New script at https://gist.github.com/uyjulian/db43b5 ... 00bc78cfdc

I'll make a blender plugin later

Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.

Posted: Sat Nov 04, 2017 10:34 am
by lionheartuk
Were you ever able to create a blender script at all?

I saw your script above but I'm a little unsure how to use it, it doesn't appear to be a python script, but a .moon script, which is a subset of LUA?

I'm a little out of my depth here though.

Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.

Posted: Sun Nov 05, 2017 3:54 pm
by Karpati
uyjulian,

Can you tell me which script did you use to extract the .dir/.dat files correctly?

I did try the following script on the
The Legend of Heroes Trails in the Sky SC (2015)
The Legend of Heroes Trails in the Sky the 3rd (2017), but did not work correctly.

http://zenhax.com/viewtopic.php?f=9&t=6 ... rails#p119


The ED6Unpacker.exe works fine.

Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.

Posted: Mon Nov 06, 2017 4:03 am
by lionheartuk
Karpati wrote:uyjulian,

Can you tell me which script did you use to extract the .dir/.dat files correctly?

I did try the following script on the
The Legend of Heroes Trails in the Sky SC (2015)
The Legend of Heroes Trails in the Sky the 3rd (2017), but did not work correctly.

http://zenhax.com/viewtopic.php?f=9&t=6 ... rails#p119


The ED6Unpacker.exe works fine.
Use Falconvert from here:

http://www.pokanchan.jp/dokuwiki/softwa ... nvrt/start

It'll also convert the textures, it just doesn't work for the stages unfortunatly.

Note: For stages the PSP and the vita version (especially vita) use .it3 files, there is a converter for those but it doesn't work correctly a lot of the time.

Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.

Posted: Thu Nov 09, 2017 8:03 pm
by Karpati
I got the same result also:

Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.

Posted: Fri Nov 10, 2017 2:42 am
by lionheartuk
Karpati wrote:I got the same result also:
Are you using a special plugin to make that work?

Searching on the website I can't see support for the kiseki formats at all.

Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.

Posted: Fri Nov 10, 2017 6:49 am
by Karpati
lionheartuk wrote:Searching on the website I can't see support for the kiseki formats at all.
The answer is very simple: it is an unreleased v6.521. The latest released version is v6.520.

Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.

Posted: Sat Nov 11, 2017 3:46 am
by lionheartuk
Karpati wrote:
lionheartuk wrote:Searching on the website I can't see support for the kiseki formats at all.
The answer is very simple: it is an unreleased v6.521. The latest released version is v6.520.
I see.

Will the new update support the file formats for environments from Sora no Kiseki FC and SC because those aren't ._x3

The First is .X so perhaps second is ._X2, I haven't checked the second games file format just yet.