Jump to content

[PC] Call Of Cthulhu - Dark Corners Of The Earth


Mehsias

Recommended Posts

Hy everyone!

What this is about:

I am trying to extract the models for the game Call Of Cthulhu - Dark Corners Of The Earth - released for PC and XBOX in 2005.

I have seen some forum posts around ~1 year ago (when I first started to look into this project) on xentax forums. There, a user which I assume is also the very talented developer behind hex2obj, has posted an example of extraction (file 06_REFINERY_PT5-xbd_CHAR.png).

The user posted a file which definitely holds a character, since it is also readable when viewing the ".xbd" file using a hex-editor - I have added the same file (which is a segment from the whole binary) as 06_REFINERY_PT5_CHAR.rar as well as the complete file as 06_REFINERY_PT5.rar. 

These files can be found in the steam folder of the game in \steamapps\common\Call of Cthulhu\Resources\Xbox.

The issue:

I have tried to replicate the extraction with hex2obj as well as ModelResearcherPro and I cannot seem to get the same result. First of, if I enter the same values as displayed in the screenshot in hex2obj, I get a message saying "Vertex count must be set to: max face index". I assume that some modifications were also made in the UI that is not visible in the screenshot, this can only be seen if the window is largened. 

Can anyone look at the files and point me in the direction what to look for in regards to face index start, vertex index start etc?


What I have gathered so far is: 
Each file contains one or more character models, sometimes marked with names, sometimes also having a clear start label "#LOD[x]{y}" (I assume "level of detail"). This is followed by 6 bytes of 0 and then the size of the vertices (max_index?) is represented in two bytes (in the example 06_REFINERY_PT5_CHAR - it is 14 03 which results in 788 (dec) (little Endian). 

From here on out, I cannot replicate how the start index for faces, as well as the count for faces is calculated. 
I am also puzzled if generic models (Environment) are also hidden in these files and how they are found.

I have seen screenshots from multiple models T-posing on imgur, so I assume that the extraction from these files is possible. 

If someone can provide useful tips, point me towards relevant resources, or join me in the quest to extract the models from Call Of Cthulhu DCOTE, I look forward to hearing from you!

Thanks!
 

06_REFINERY_PT5-xbd_CHAR.png

06_REFINERY_PT5_CHAR.rar 06_REFINERY_PT5.rar

Link to comment
Share on other sites

  • Engineer

Hi, the correct parameters for your xbd are like so (see first picture).

find start of face indices: search for scrambled alphabet

find start of vertices: experience required for shorts

Maybe simply search for "LOD" here to find all blocks.

06_REFINERY_PT5_CHAR-xbd.png

xbd - startOfVertices.png

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

Thank you very much @shak-otay!

It works fine with these settings with the file 06_REFINERY_PT5_CHAR in hex2obj, but ModelResearcherPro throws me an error (see screenshot). 

2024-01-11_15-34-17.png.fd28fd33cbaa2b32a41e77c75ad2a36d.png

Using only the vertices resembles the head of the Agent somewhat, but something is off in comparison to hex2obj.

ModelResearchPro_06_REFINERY_PT5_CHAR_vertices.png

So - following the hex2obj tutorial, this games vertices are in "blocked mode" - hence using FVF block size settings. But after a lot of playing around I cannot find what FVF block size would correspond to in ModelResearcherPro. This programm would be the preffered way to use because I can just write python scripts and preview the models before extraction, but that can also be done when using hex2obj to find the definition of the models in the binary files.

Do you by chance know how the suggested vertex count is calculated?

Continuing:

I tried the same approach on the file "01_HOUSE" and looked for another "#LOD[0]{1}" because I strongly assume that the others ( e.g. #LOD[0]{0}) are different. I found one @d5e4aa and added the 32 byte offset to arrive at d5e4cb. Reading into what I learned from the previous file, it seems that the length of the vertices is contained in the header of this model twice - in this case its 605 vertices (5D02 but little endian). 

06_REFINERY_PT5_CHAR compared to 01_HOUSE:

06_REFINERY_PT5_CHAR_analysis.png01_HOUSE_analysis.png

Afterwards, I knew from the previous example that the face definition will be after the vertices, so I looked for the pattern "0100 0200" and sure enough I found one @D62850. The apparent end at D63DA0.

 01_House_Hex_Face_pattern.png 01_house_hex_Face_end.png


With this I calculated the delta (face_end - face_start) and divided by 2 (as per hex2obj tut) and received a result of 2712 faces.

When clicking on go1 - the suggested vertex count is... 605! (this is what I also read from the file header). -> Again how does hex2obj calculate this??

01_House_hex2obj_Calculated_vertices.png

Although I felt confident that I found a model, the endresult is a scrambled mess, but a valid object nonetheless.

01_HOUSE_hex2obj_Test.png

If anyone knows where the mistake lies, I would gladly apprechiate any help!

Thanks again to @shak-otay for the quick help.

01_HOUSE.rar

ModelResearchPro_06_REFINERY_PT5_CHAR_error.png

Edited by Mehsias
Link to comment
Share on other sites

  • Engineer

Model Researcher uses face count, that is face index count /3 (for triangles).

The vertex count that hex2obj shows is the maximum face index, as simple as this.

 

For 01_House, you were quite close:

 

01_House.png

Edited by shak-otay
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...