Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Extracting simple models

Read or post any tutorial related to file format analysis for modding purposes.
gpfan
beginner
Posts: 33
Joined: Fri Apr 01, 2011 7:59 pm
Has thanked: 21 times
Been thanked: 14 times

Re: Extracting simple models

Post by gpfan »

Hi shakotay2 i was able to open some files from RRE but i´m stuck. This is something very interesting to look at..... Only want to ask you if you could look at this files to see if by any chance there is the possibility to find 3d models inside. I dump the files with ravioli and some .DAT showed up, there also is some DDS but somehow they do not open with Photoshop. What is interesting is that this is something Aluigi tested some time ago but no one gave a shit, i use the script and was able to unpack the files. Now it´s only a mater of finding if there is some 3d inside those containers or not..... I would like to ask if by any chance you could take a look inside this files???
https://1drv.ms/u/s!AvtMXnUqCvTviUKs8QjaXwvUvsve
SchnelleMeyer
beginner
Posts: 27
Joined: Sun Feb 26, 2017 10:28 pm
Has thanked: 9 times
Been thanked: 4 times

Re: Extracting simple models

Post by SchnelleMeyer »

AceWell wrote:beretta_magazine :D
beretta_magazine.png
0x4 - 4bytes - number of vertices
0x8 - 4bytes - number of faces
UVs are halffloat not shorts

Thank you so much AceWell!!!
You have no idea how many hours a noob like me have spent trying to figure this out.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4285
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Extracting simple models

Post by shakotay2 »

gpfan wrote:Hi shakotay2
Hi gpfan
I would like to ask if by any chance you could take a look inside this files???
checked the first three dat files only, couldn't detect a full model.
Why don't you look for point clouds in the data?
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
gpfan
beginner
Posts: 33
Joined: Fri Apr 01, 2011 7:59 pm
Has thanked: 21 times
Been thanked: 14 times

Re: Extracting simple models

Post by gpfan »

Why don't you look for point clouds in the data?
Sorry for my ignorance but what do you mean with that?? [roll]
checked the first three dat files only, couldn't detect a full model.
Why don't you look for point clouds in the data?
Maybe on those 3 you won´t but on Unkn0006/7/8.dat (car_template folder) you have some with some info at the bottom, do you think there´s any 3d inside those???
I can see some info saying high detail model, maybe it´s only materials.....



Image
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4285
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Extracting simple models

Post by shakotay2 »

gpfan wrote:
Why don't you look for point clouds in the data?
Sorry for my ignorance but what do you mean with that?? [roll]
it's what its name tells: a cloud of points
Unkn0005-dat.JPG
Maybe on those 3 you won´t but on Unkn0006/7/8.dat (car_template folder) you have some with some info at the bottom, do you think there´s any 3d inside those???
go for the clouds and you'll find the answer
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
gpfan
beginner
Posts: 33
Joined: Fri Apr 01, 2011 7:59 pm
Has thanked: 21 times
Been thanked: 14 times

Re: Extracting simple models

Post by gpfan »

go for the clouds and you'll find the answer
Was just asking to know if i should invest time to learn how to use Hex and hexobj..... but thanks anyway, i know there is some 3d on those files for sure it´s only a question of time until i understand how to use this tools but time is limited.
Acewell
VIP member
VIP member
Posts: 1330
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2710 times
Been thanked: 884 times

Re: Extracting simple models

Post by Acewell »

the only one of your samples in the "car_template folder" i see with model data is Unkn0005.dat :D
first submesh
Unkn0005_dat.png
0xad2b - 4bytes - vertex stride(?)
0xad2f - 4bytes - indices type(?) (dword = 4 bytes)
0xad33 - 4bytes - number of vertices
0xad37 - 4bytes - number of faces


the rest of the samples look like texture data and this one with the model data even has a 256x256 texture at the beginning.
when you are dealing with a lot files without proper naming and you are looking for model files try sorting by file size and you
can usually eliminate anything that has identical sizes, for example if you see 5 files 768 kb they are probably textures.
You do not have the required permissions to view the files attached to this post.
gpfan
beginner
Posts: 33
Joined: Fri Apr 01, 2011 7:59 pm
Has thanked: 21 times
Been thanked: 14 times

Re: Extracting simple models

Post by gpfan »

:!: Thank you for your help AceWell :!: Your priceless :D So following a racional thought Unkn0005.dat should have more model data stored inside or do you think it´s only textures? Wondering if the file to look for is File0017-broken.tga (with 9051KB) to find car model instead of .DAT ones.... For what i see there´s some stuff there but not sure if it´s 3D.

Anyway... the best way to make my research work is starting from the beginning and learn well HEX language but unfortunately time is not in favor, for what i see this will take lots of hours to master, this is not a easy task since lot´s of data are stored together. Thanks for your help guys, appreciated!!!
SchnelleMeyer
beginner
Posts: 27
Joined: Sun Feb 26, 2017 10:28 pm
Has thanked: 9 times
Been thanked: 4 times

Re: Extracting simple models

Post by SchnelleMeyer »

gpfan wrote::!: Thank you for your help AceWell :!: Your priceless :D So following a racional thought Unkn0005.dat should have more model data stored inside or do you think it´s only textures? Wondering if the file to look for is File0017-broken.tga (with 9051KB) to find car model instead of .DAT ones.... For what i see there´s some stuff there but not sure if it´s 3D.

Anyway... the best way to make my research work is starting from the beginning and learn well HEX language but unfortunately time is not in favor, for what i see this will take lots of hours to master, this is not a easy task since lot´s of data are stored together. Thanks for your help guys, appreciated!!!
Hey man - I understand your position. - I just spent a lot of hours to be able to extract a few models. I found hex and hex2obj process very hard to understand even after reading, seeing examples on the forums and watching videos. Success to break the last barrier of understanding came thanks to AceWells help in the end.
By this I dont mean I have full understanding of anything hex or Hex2obj, but I know enough to extract models from a few games now.

I can give you one tip for Hex2Obj and understanding file structure that I have not seen mentioned much (Not in tutorial either) that helped me a lot when I found it.
first load the file you want to analyse into H2O, In step 1 leave face indices start adr at 0. Then push the "table" button. It will give you data from the file in TEXT format!

Seeing actual numbers in decimal can clear up the fog somewhat.. Hope this helps gpfan and others.
SchnelleMeyer
beginner
Posts: 27
Joined: Sun Feb 26, 2017 10:28 pm
Has thanked: 9 times
Been thanked: 4 times

Re: Extracting simple models

Post by SchnelleMeyer »

The extracted UV-map is an .obj file. Cant get my head around how this can be used for anything else than a UV-template.

Is there a way to use this as UV-mapping on the extracted object(s) without having to UV-Unwrap the main object itself?
I use Blender and Max.
Acewell
VIP member
VIP member
Posts: 1330
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2710 times
Been thanked: 884 times

Re: Extracting simple models

Post by Acewell »

use "File>SaveAs mesh" when you are done, that will save out a working obj file with the settings you have in Hex2obj.
i should note that there is no shortall with Halffloat UV setting, so you have to save out 2 obj files with
both settings and combine the correct UVs (lines that start with "vt") with the correct mesh manually.
PaulBuryCZ
ultra-n00b
Posts: 5
Joined: Sun Aug 16, 2015 11:12 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Extracting simple models

Post by PaulBuryCZ »

Hi shakotay2 and others!

I am trying to convert Spellforce: Order of the Dawn (2003) .msb files to .obj, but since I am a studying noob with little to no time, I beg for your help.
And later I would like to make an importer and an exporter in python, because the game loads it's files from .pak, but if you put a texture or music/sound in the main dir, it loads from the main main dir instead. This could (in a dumb theory) apply to it's 3D mesh files, thus allowing to mod the game's 3D models.

I did your tutorial and tried a few simple models, but it's possible I failed to fully understand some basic stuff.

Image

If I set 40 bytes in a row, it starts to look organized.

I also noticed a few patterns.
Green: Repeats from the beggining of the file (except for the first line).
Blue: Repeats through the entire file (except for the first line again and a few lines at the end of the file).
Yellow/intersected: What I used for finding face indices. (and got a 205 vertex count)

I also have the mesh ripped with NinjaRipper in .obj format.
Imported in Blender, the file has 205 verts, 485 edges and 288 faces/tris.
Can this info be used to find the correct vertex count? As the .obj mesh has 205 verts, should I aim to get 205 vertex count?
(your tutorial .obj mesh had 20 additional verts than your vertex count in hex2obj so I don't know)

I experimented a lot, but the cloud didn't show anything resembling the ripped .obj. I also tried to go along with your tutorial, no luck.
I guess the only clue I have is the face indices.

I provide .zip with the .msb and .dds texture from the game's .pak and also the ripped .obj.

Please, point me at least in the right direction. Thank you all.
Also, respect to you all for supporting this topic for 4 years!
You do not have the required permissions to view the files attached to this post.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4285
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Extracting simple models

Post by shakotay2 »

figure_hero_female_head.JPG
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
PaulBuryCZ
ultra-n00b
Posts: 5
Joined: Sun Aug 16, 2015 11:12 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Extracting simple models

Post by PaulBuryCZ »

A quick, short and all-explaining answer! :D Thank you!
Makes me feel a little dumb haha.

Worked on other models as well.

Last dumb question: But did you get the 864 face indices count by trial & error (That's how I did it on other models) or somehow else?
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4285
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Extracting simple models

Post by shakotay2 »

PaulBuryCZ wrote:Last dumb question: But did you get the 864 face indices count by trial & error (That's how I did it on other models) or somehow else?
In this case it was
(endaddressOfFIs+1-startaddressOfFIs)/2/4*3
iirc. The '2' because it's WORD faceindices, /4*3 because there's a fourth additional 00 00 for each face (3 WORDs).

(Getting the addresses is a matter of experience, more or less.)
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
Post Reply