Jump to content

[PC] Darkened Skye. Reversing a .skg file of unknown structure containing bones, animations, model, and texture


fieldnoted
Go to solution Solved by Durik256,

Recommended Posts

Video game file format that I know contains bones and animations, but likely also contains the model, uvs, and textures.

Its easy to tell the beginning of the file contains a list of all the animations within the file but I cannot seem to find any sort of pointers to where that information would begin. Tracking down the model and vertice information is my main goal as this file is the only one of its format within the game as it is the only one that uses bone animation instead of vertex animation. Any help would be appreciated, I'm incredibly new to this and cannot seem to apply the same structure that worked for the other file formats to this one.



Zip contains only Skye.skg

Files.zip

Edited by fieldnoted
Forgot rule 13 my bad
Link to comment
Share on other sites

  • fieldnoted changed the title to [PC] Darkened Skye. Reversing a .skg file of unknown structure containing bones, animations, model, and texture

There's 140x 00534B54 (" SKT") animation entries, probably. So you might divide the file up into 140 parts?

At 0x40B0 a table starts with 57 entries, 16 bytes long each.

Looks like frames when you log from 0x33d5e4 in steps of 36 bytes it looks like so (first float in a line is a time value, probably):

0.000000 -0.036212 -0.047769 ...
1.000000 -0.033746 -0.049542 ...
2.000000 -0.030633 -0.051525
3.000000 -0.027360 -0.053335
4.000000 -0.024485 -0.054714
5.000000 -0.022615 -0.055513
6.000000 -0.021710 -0.056447
7.000000 -0.021293 -0.057738
8.000000 -0.021332 -0.058569
9.000000 -0.021793 -0.058125
10.000000 -0.022615 -0.055513
11.000000 -0.023942 -0.049111
12.000000 -0.025659 -0.038801
13.000000 -0.027266 -0.025972
14.000000 -0.028332 -0.012252
15.000000 -0.028577 0.000560
16.000000 -0.027924 0.010704
17.000000 -0.025007 0.018879
18.000000 -0.018449 0.024773
19.000000 0.010973 -0.027819
20.000000 0.002611 -0.029791
21.000000 -0.007212 -0.029022
22.000000 -0.014257 -0.026288
24.000000 -0.022721 -0.019443
25.000000 -0.025597 -0.015463
26.000000 -0.027314 -0.012176
27.000000 -0.028368 -0.008801
28.000000 -0.029078 -0.004711
29.000000 -0.029441 -0.001049
30.000000 -0.029626 0.001046
31.000000 -0.029901 0.000508
32.000000 -0.030473 -0.003022
33.000000 -0.031313 -0.008736
34.000000 -0.032309 -0.015890
35.000000 -0.033348 -0.023742
36.000000 -0.034328 -0.031560
37.000000 -0.035168 -0.038626
38.000000 -0.035809 -0.044250
39.000000 -0.036212 -0.047769
40.000000 -0.036426 -0.049543
41.000000 -0.036538 -0.050485
42.000000 -0.036571 -0.050762
43.000000 -0.036545 -0.050541
44.000000 -0.036479 -0.049987
46.000000 -0.036306 -0.048545
47.000000 -0.036239 -0.047990
48.000000 -0.036212 -0.047769
57.000000 -0.036212 -0.047769
0.000000 -0.499999 -0.500000
1.000000 -0.491481 -0.491482
3.000000 -0.470056 -0.470057
4.000000 -0.460616 -0.460616
5.000000 -0.454519 -0.454519
6.000000 -0.451542 -0.451542
7.000000 -0.450131 -0.450132
8.000000 -0.450214 -0.450215
9.000000 -0.451707 -0.451708
10.000000 -0.454519 -0.454519
11.000000 -0.460381 -0.460381
12.000000 -0.469646 -0.469647
14.000000 -0.490000 -0.490001
15.000000 -0.497200 -0.497201
16.000000 -0.499999 -0.500000
17.000000 -0.499443 -0.499444
19.000000 -0.495441 -0.495442
22.000000 -0.484407 -0.484408
26.000000 -0.466657 -0.466657
28.000000 -0.459416 -0.459417
29.000000 -0.456812 -0.456812
30.000000 -0.455121 -0.455121
31.000000 -0.454519 -0.454519
32.000000 -0.456304 -0.456305
33.000000 -0.461037 -0.461038
34.000000 -0.467771 -0.467772
37.000000 -0.490789 -0.490789
38.000000 -0.496541 -0.496541
39.000000 -0.499999 -0.500000
41.000000 -0.502477 -0.502478
57.000000 -0.499999 -0.500000
0.000000 0.151277 0.035894
1.000000 0.132962 0.010110
2.000000 0.110975 -0.021344
3.000000 0.089027 -0.053303
4.000000 0.070623 -0.080546
5.000000 0.059043 -0.097900
6.000000 0.052408 -0.105388
7.000000 0.047653 -0.107523
8.000000 0.046204 -0.105916
9.000000 0.049513 -0.102174
10.000000 0.059043 -0.097900
11.000000 0.079893 -0.090736
12.000000 0.112327 -0.079089
13.000000 0.150468 -0.065759
14.000000 0.188343 -0.053561
15.000000 0.220018 -0.045215
16.000000 0.239707 -0.043289
17.000000 0.248516 -0.046469
18.000000 0.252157 -0.051295
19.000000 0.251826 -0.057066
20.000000 0.248709 -0.063082
21.000000 0.243988 -0.068644
22.000000 0.238850 -0.073048
23.000000 0.232267 -0.075228
24.000000 0.222959 -0.074929
25.000000 0.211723 -0.072643
26.000000 0.199357 -0.068855
27.000000 0.186660 -0.064038
28.000000 0.174429 -0.058663
29.000000 0.163467 -0.053197
30.000000 0.154574 -0.048107
31.000000 0.148561 -0.043862
32.000000 0.145258 -0.038035
33.000000 0.143737 -0.028666
34.000000 0.143683 -0.016931
35.000000 0.144756 -0.004015
36.000000 0.146557 0.008897
37.000000 0.148610 0.020629
38.000000 0.150377 0.030013
39.000000 0.151277 0.035894
40.000000 0.151496 0.038852
41.000000 0.151615 0.040423
42.000000 0.151651 0.040885
43.000000 0.151622 0.040515
44.000000 0.151552 0.039591
46.000000 0.151372 0.037188
47.000000 0.151304 0.036264
48.000000 0.151277 0.035894
57.000000 0.151277 0.035894
0.000000 -0.089072 0.009545
1.000000 -0.105812 0.000492
2.000000 -0.126097 -0.010506
3.000000 -0.146589 -0.021649
4.000000 -0.163991 -0.031136
5.000000 -0.175055 -0.037181
6.000000 -0.182396 -0.039920
7.000000 -0.188891 -0.040921
8.000000 -0.191718 -0.040553
9.000000 -0.188055 -0.039186
10.000000 -0.175055 -0.037181
11.000000 -0.145433 -0.033669
12.000000 -0.099216 -0.028158
13.000000 -0.044669 -0.021603
14.000000 0.009698 -0.015011
15.000000 0.055330 -0.009432
16.000000 0.083846 -0.005922
17.000000 0.097066 -0.004532
18.000000 0.103213 -0.004305
19.000000 0.103634 -0.004787
20.000000 0.099662 -0.005521
21.000000 0.092623 -0.006052
22.000000 0.083846 -0.005922
23.000000 0.071447 -0.005117
24.000000 0.053686 -0.003981
25.000000 0.032114 -0.002606
26.000000 0.008292 -0.001079
27.000000 -0.016204 0.000508
28.000000 -0.039793 0.002064
29.000000 -0.060899 0.003495
30.000000 -0.077954 0.004713
31.000000 -0.089404 0.005624
32.000000 -0.095618 0.006331
33.000000 -0.098513 0.006988
34.000000 -0.098854 0.007590
35.000000 -0.097405 0.008131
36.000000 -0.094932 0.008602
37.000000 -0.092205 0.008999
38.000000 -0.089994 0.009315
39.000000 -0.089072 0.009545
40.000000 -0.089057 0.009690
41.000000 -0.089048 0.009768
42.000000 -0.089046 0.009790
43.000000 -0.089048 0.009772
44.000000 -0.089053 0.009727
46.000000 -0.089066 0.009608
47.000000 -0.089070 0.009563
48.000000 -0.089072 0.009545
57.000000 -0.089072 0.009545

in detail:

0.000000 -0.036212 -0.047769 -0.152302 0.986515 -0.036212 -0.047769 -0.152302 0.986515

1.000000 -0.033746 -0.049542 -0.202086 0.977532 -0.033746 -0.049542 -0.202086 0.977532
...

Not full 3x4 or 4x4 matrices but 8 floats after the time value so you may guess what they mean.

As remembrance: smd format usually uses 6 floats after the time value

At 0x89024 an animation starts which ends like so:

...

v 118.000000 -0.129907 0.024899...
v 119.000000 -0.159413 0.030596...
v 120.000000 -0.183499 0.034957...
v 121.000000 -0.201436 0.038528...
v 150.000000 -0.201436 0.038528...

 

How to find the first frame of an animation:

FirstFrameOfAnimation.png

Edited by shak-otay
Link to comment
Share on other sites

I made a test plugin for Noesis fmt_skg.py . (point cloud and texture)

(not finished, but I left comments with information so that you can finish it).
the vertices are divided according to the number of weights.

EDIT: add skeleton

-1.png.50452d02440fb2037b3c5191d4347380.png

skeleton with SkelFinder:

-1.png.6d7d0bfa360c5b554e100dfea633172f.png

 

Edited by Durik256
  • Thanks 1
Link to comment
Share on other sites

Ha, Durik!😎

Just got the mesh/point cloud , too, but didn't know what the 03000000 should mean.

Here's my code which cares for the points only (lpFBuf is a pointer to the file buffer):

	bool get_skye_mesh(DWORD dwStart)
{
    char * pFBuf ;
    int cnt=0 ;
    DWORD j ;
    bool bStop= false ;
	    pFBuf = (char *) lpFBuf ; pFBuf += dwStart ; j= dwStart ;
    do {
        if (*pFBuf==1) {
            pFBuf += 4 ; j += 4 ; fprintf( stream, "v ") ;
            Show_nFloats(stream, pFBuf, j, 3, false) ; fprintf( stream, "\n") ;
            pFBuf += 8 ; j += 8 ;
        }
        else if (*pFBuf==2) {
            pFBuf += 4 ; j += 4 ; fprintf( stream, "v ") ;
            Show_nFloats(stream, pFBuf, j, 3, false) ; fprintf( stream, "\n") ; pFBuf += 8 ; j += 8 ;
            fprintf( stream, "# ") ;
            Show_nFloats(stream, pFBuf, j, 3, false) ; fprintf( stream, "\n") ; pFBuf += 8 ; j += 8 ;
        }
        else if (*pFBuf==3) {
            pFBuf += 4 ; j += 4 ; fprintf( stream, "v ") ;
            Show_nFloats(stream, pFBuf, j, 3, false) ; fprintf( stream, "\n# ") ; pFBuf += 4 ; j += 4 ;
            Show_nFloats(stream, pFBuf, j, 4, false) ; fprintf( stream, "\n# ") ; pFBuf += 4 ; j += 4 ;
            Show_nFloats(stream, pFBuf, j, 4, false) ; fprintf( stream, "\n") ; pFBuf += 8 ; j += 8 ;   // last is a float
        }
        else bStop= true ;
        cnt++ ;
    }
    while (!bStop);
    fprintf( stream, "# 0x%lx %d blocks\n", j, cnt) ;
}
	

Edited by shak-otay
  • Like 1
Link to comment
Share on other sites

  • Solution
Posted (edited)

I added a skeleton and performed a vertex transformation. now he looks like a human

*(I don’t like such large screenshots, I’ll edit my messages later xD)

EDIT: So, the mesh is built. (mesh, uvs, weight, bones, textures)

EDIT2:  add animations

-1.png.f9d16748922e21c781b87e86ff1e87a8.pngbandicam2024-01-0201-55-23-271(online-video-cutter.com)(1).gif.be91c310810b2f93e31c191c5730957e.gif

Edited by Durik256
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Wow, that was impressively quick. How did you get from the point cloud to organized vertices? Also will you be pushing that to the github you linked earlier?

6 hours ago, Durik256 said:

I added a skeleton and performed a vertex transformation. now he looks like a human

*(I don’t like such large screenshots, I’ll edit my messages later xD)

EDIT: So, the mesh is built. (mesh, uvs, weight, bones, textures)

EDIT2:  add animations

-1.png.f9d16748922e21c781b87e86ff1e87a8.pngbandicam2024-01-0201-55-23-271(online-video-cutter.com)(1).gif.be91c310810b2f93e31c191c5730957e.gif

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...