Jump to content

[PC] Darkened Skye. Help with reversing a .GRP file of unknown file structure.


fieldnoted
Go to solution Solved by Durik256,

Recommended Posts

I'm a beginner attempting to understand and begin reversing a file format from an old game with extremely little information about its development. As far as I can find the filetype is either unique or masked. I have attempted to form some of the models with modelresearcher and got some of the vertices correct but couldn't get any face information to work properly. I've never attempted this before and have been following some of the guides here and got some help on xentax a long while ago before its closure. Would appreciate if anyone could point me in the right direction or give some insight into the files, I haven't got the strongest idea of what I'm looking for and I'm not exactly sure what to provide here so I will attach various files that I've been attempting to make some progress in.

Zip folder contains:

Armor.GRP, the only one I've gotten a little progress on, I think the file contains the model, textures, and animations as well so could be tricky to work with. I have attached a screenshot of the progress I got on this one
Catapult.GRP, just another model I think also contains textures and animations
FoodMerchant.GRP, another model to compare with the others
Empty.GRP, strange empty model I found. Could maybe be used to determine some structure of the file format by comparing with the others but I'm not sure if that would be helpful
 

armorss.png

files.zip

Edited by fieldnoted
Correction for rule 13
Link to comment
Share on other sites

9 hours ago, fieldnoted said:

Thank you for the quick reply, are you using hex2obj? I tried it but couldn't get the face count correct. Also I'm not sure why the faces problem occurs, has something similar happened before?

Yep, hex2obj. But shouldn't make a difference. I used face index count of 1716*3, so 1716 faces, too. Problem occurred a 100s of times. (On Xentax Bigchillghost usually solved  them;-)

edit: this time it's rather simple. Comment out each 2nd face line like so:

f 8 9 1 
#f 3 2 1 
f 11 9 10 
#f 5 2 4 

...

 

Armor_grp.png

hex2obj_armorGRP.png

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

Here's a little struct to get at least one model. Still not sure how are UV stored. And same for vertices.

If you want output it to object just remove two slashes at all "Printf" functions. Also on last line.

//------------------------------------------------
//--- 010 Editor v14.0 Binary Template
//
//      File: 
//   Authors: 
//   Version: 
//   Purpose: 
//  Category: 
// File Mask: 
//  ID Bytes: 
//   History: 
//------------------------------------------------
LittleEndian();OutputPaneClear();
local string FileName=GetFileName(),FilePath=FileNameGetPath(FileName,true),BaseName=FileNameGetBase(FileName,false);
local uint32 i,j,k,l;
struct MainInfo {
    byte Sign[4];
    uint32 Null;
    uint32 FileSize;
    uint32 TexCount,TextureInfoOffset,MdlCount,VtxInfoOffset,Unknown_4,Unknown_5,Unknown_6,Unknown_7;
};

struct TextureInfo {
    uint32 Flag;
    char TextureName[24];
    uint32 TexWidth,TexHeight,Unk_2,RawDataSize,Unk_4,Unk_5,Unk_6,Unk_7,Unk_8,Unk_9,Unk_10,Unk_11,Unk_12,Unk_13;
    uint16 Unk_14,Unk_15;
};

struct VertexInfo {
    for (i=0; i < mainInfo.MdlCount; i++)
    struct BufferInfo {
        uint32 Null;
        uint16 IdxCount,VtxCount,Unk_2,Unk_3;
        uint32 IdxBufferOffset,UvIdxOffset,VtxBufferOffset,
        Unk_7,Unk_8,Unk_9,Unk_10,Unk_11;
        }bufferInfo;
};

struct Vertices {
    float PosX,PosY,PosZ;
    //Printf("v %f %f %f\n",PosX,PosY,PosZ);
};

struct UnitVector {
    float PosU0,PosV0,PosU1,PosV1;
    //Printf("vt %f %f\n",PosU0,PosV0);
};

struct Indices {
    int16 F0,F1,F2,F3,F4,F5;
    //Printf("f %d/%d/%d %d/%d/%d %d/%d/%d\n",F0+1,F0+1,F0+1,F1+1,F1+1,F1+1,F2+1,F2+1,F2+1);
};

MainInfo mainInfo;

FSeek(mainInfo.TextureInfoOffset);
TextureInfo textureInfo[mainInfo.TexCount];

FSeek(mainInfo.VtxInfoOffset);
VertexInfo vertexInfo;

FSeek(vertexInfo.bufferInfo.VtxBufferOffset);
Vertices vertices0[vertexInfo.bufferInfo.VtxCount]<optimize=false>;

FSeek(vertexInfo.bufferInfo.UvIdxOffset);
UnitVector unitVector0[vertexInfo.bufferInfo.VtxCount]<optimize=false>;

FSeek(vertexInfo.bufferInfo.IdxBufferOffset);
Indices indices0[vertexInfo.bufferInfo.IdxCount]<optimize=false>;

//OutputPaneSave(FilePath+BaseName+".obj");

 

Edited by h3x3r
Link to comment
Share on other sites

4 hours ago, h3x3r said:

Here's a little struct to get at least one model. Still not sure how are UV stored. And same for vertices.

If you want output it to object just remove two slashes at all "Printf" functions. Also on last line.

//------------------------------------------------
//--- 010 Editor v14.0 Binary Template
//
//      File: 
//   Authors: 
//   Version: 
//   Purpose: 
//  Category: 
// File Mask: 
//  ID Bytes: 
//   History: 
//------------------------------------------------
LittleEndian();OutputPaneClear();
local string FileName=GetFileName(),FilePath=FileNameGetPath(FileName,true),BaseName=FileNameGetBase(FileName,false);
local uint32 i,j,k,l;
struct MainInfo {
    byte Sign[4];
    uint32 Null;
    uint32 FileSize;
    uint32 TexCount,TextureInfoOffset,MdlCount,VtxInfoOffset,Unknown_4,Unknown_5,Unknown_6,Unknown_7;
};

struct TextureInfo {
    uint32 Flag;
    char TextureName[24];
    uint32 TexWidth,TexHeight,Unk_2,RawDataSize,Unk_4,Unk_5,Unk_6,Unk_7,Unk_8,Unk_9,Unk_10,Unk_11,Unk_12,Unk_13;
    uint16 Unk_14,Unk_15;
};

struct VertexInfo {
    for (i=0; i < mainInfo.MdlCount; i++)
    struct BufferInfo {
        uint32 Null;
        uint16 IdxCount,VtxCount,Unk_2,Unk_3;
        uint32 IdxBufferOffset,UvIdxOffset,VtxBufferOffset,
        Unk_7,Unk_8,Unk_9,Unk_10,Unk_11;
        }bufferInfo;
};

struct Vertices {
    float PosX,PosY,PosZ;
    //Printf("v %f %f %f\n",PosX,PosY,PosZ);
};

struct UnitVector {
    float PosU0,PosV0,PosU1,PosV1;
    //Printf("vt %f %f\n",PosU0,PosV0);
};

struct Indices {
    int16 F0,F1,F2,F3,F4,F5;
    //Printf("f %d/%d/%d %d/%d/%d %d/%d/%d\n",F0+1,F0+1,F0+1,F1+1,F1+1,F1+1,F2+1,F2+1,F2+1);
};

MainInfo mainInfo;

FSeek(mainInfo.TextureInfoOffset);
TextureInfo textureInfo[mainInfo.TexCount];

FSeek(mainInfo.VtxInfoOffset);
VertexInfo vertexInfo;

FSeek(vertexInfo.bufferInfo.VtxBufferOffset);
Vertices vertices0[vertexInfo.bufferInfo.VtxCount]<optimize=false>;

FSeek(vertexInfo.bufferInfo.UvIdxOffset);
UnitVector unitVector0[vertexInfo.bufferInfo.VtxCount]<optimize=false>;

FSeek(vertexInfo.bufferInfo.IdxBufferOffset);
Indices indices0[vertexInfo.bufferInfo.IdxCount]<optimize=false>;

//OutputPaneSave(FilePath+BaseName+".obj");

 

Wow thank you for this. I've not used 010 Editor before so forgive me if this is an issue on my end or a simple fix I can't see. In the Catapult.GRP file I run into the error "ERROR Line 58: Invalid array size in declaration."

And in the Armor.GRP file i run into the error "ERROR Line 24: Template passed end of file at variable 'Flag'."

 

EDIT: Just realised my mistake, I used Import hex instead of open file. Sorry for the bother.

Edited by fieldnoted
Link to comment
Share on other sites

4 hours ago, h3x3r said:

Here's a little struct to get at least one model. Still not sure how are UV stored. And same for vertices.

If you want output it to object just remove two slashes at all "Printf" functions. Also on last line.

//------------------------------------------------
//--- 010 Editor v14.0 Binary Template
//
//      File: 
//   Authors: 
//   Version: 
//   Purpose: 
//  Category: 
// File Mask: 
//  ID Bytes: 
//   History: 
//------------------------------------------------
LittleEndian();OutputPaneClear();
local string FileName=GetFileName(),FilePath=FileNameGetPath(FileName,true),BaseName=FileNameGetBase(FileName,false);
local uint32 i,j,k,l;
struct MainInfo {
    byte Sign[4];
    uint32 Null;
    uint32 FileSize;
    uint32 TexCount,TextureInfoOffset,MdlCount,VtxInfoOffset,Unknown_4,Unknown_5,Unknown_6,Unknown_7;
};

struct TextureInfo {
    uint32 Flag;
    char TextureName[24];
    uint32 TexWidth,TexHeight,Unk_2,RawDataSize,Unk_4,Unk_5,Unk_6,Unk_7,Unk_8,Unk_9,Unk_10,Unk_11,Unk_12,Unk_13;
    uint16 Unk_14,Unk_15;
};

struct VertexInfo {
    for (i=0; i < mainInfo.MdlCount; i++)
    struct BufferInfo {
        uint32 Null;
        uint16 IdxCount,VtxCount,Unk_2,Unk_3;
        uint32 IdxBufferOffset,UvIdxOffset,VtxBufferOffset,
        Unk_7,Unk_8,Unk_9,Unk_10,Unk_11;
        }bufferInfo;
};

struct Vertices {
    float PosX,PosY,PosZ;
    //Printf("v %f %f %f\n",PosX,PosY,PosZ);
};

struct UnitVector {
    float PosU0,PosV0,PosU1,PosV1;
    //Printf("vt %f %f\n",PosU0,PosV0);
};

struct Indices {
    int16 F0,F1,F2,F3,F4,F5;
    //Printf("f %d/%d/%d %d/%d/%d %d/%d/%d\n",F0+1,F0+1,F0+1,F1+1,F1+1,F1+1,F2+1,F2+1,F2+1);
};

MainInfo mainInfo;

FSeek(mainInfo.TextureInfoOffset);
TextureInfo textureInfo[mainInfo.TexCount];

FSeek(mainInfo.VtxInfoOffset);
VertexInfo vertexInfo;

FSeek(vertexInfo.bufferInfo.VtxBufferOffset);
Vertices vertices0[vertexInfo.bufferInfo.VtxCount]<optimize=false>;

FSeek(vertexInfo.bufferInfo.UvIdxOffset);
UnitVector unitVector0[vertexInfo.bufferInfo.VtxCount]<optimize=false>;

FSeek(vertexInfo.bufferInfo.IdxBufferOffset);
Indices indices0[vertexInfo.bufferInfo.IdxCount]<optimize=false>;

//OutputPaneSave(FilePath+BaseName+".obj");

 

Wow this works amazingly for a lot of the models. Although some models still have completely messed up faces such as image.png.80c29e2cc2ec1f2690297ee0376a0f16.png

 

I have no idea what separates these models from the others so not a clue why the issue occurs. I'll attempt to just look for the face values myself in the hex and see if I can find any differences.

files.zip

Link to comment
Share on other sites

3 hours ago, Durik256 said:

I made a plugin for Noesis, but I think you made it before me..

Also, for the test I looked at the animation, here the vertices are animated

bandicam 2023-12-15 13-43-15-998.gif

bandicam 2023-12-15 13-46-45-659.gif

Hey this looks amazing. Might I ask where to fetch the noesis plugin? I've never used the software before.

Link to comment
Share on other sites

  • fieldnoted changed the title to [PC] Darkened Skye. Help with reversing a .GRP file of unknown file structure.
  • 5 months later...

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...