Join also our Discord channel! Click here.

Extracting simple models

Read or post any tutorial related to file format analysis for modding purposes.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3184
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 869 times
Been thanked: 1750 times

Re: Extracting simple models

Post by shakotay2 » Tue Sep 13, 2016 6:15 am

'sequential' or 'blocked' is not a matter of face indices. My definition of 'sequential' says (in short): there's all vertices followed by all normals then all uvs. 'blocked' mode means, there's a number of FVF blocks which contain one vertex, one normal and one uv in most cases. So the simplest FVF block (with floats) would have a size of 32 bytes (3x4+3x4+2x4). (But it also may contain weights for example.)

It's normally plain to see where these FVF blocks end and where the face indices block starts.
You should show a model sample where you think it is not.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

kbr0n
ultra-n00b
Posts: 3
Joined: Sat Sep 10, 2016 9:34 am
Has thanked: 1 time

Re: Extracting simple models

Post by kbr0n » Wed Sep 14, 2016 1:49 am

I understand, I got things mixed up.

In the tutorial it's not "f"s but v, vn an vt columns

a) "sequential" mode
v x y z
v x y z
v x y z
v x y z

and

b) "blocked" mode
v x y z
vn x y z
vt x y

I got that. The question should be if there's any tip on identifying those 'v, vn an vt', via hex editor or on hex2o?
are v, vn, vt what we see when press GO2 in VB mode?

how to find these v vn vt values when using seq mode?

I believe when you say it must be plain to identify, but I just not sure exactly where to look for
I apologize for my n00bness :oops:

I´m trying to extract a s.k.e.t.ch.fab model, using one of those .bin files

but all I get are these strange spiky balls

teste.jpg
I just pick a random model of a gun -> https://sketchfab.com/models/3RXKSlKHlI ... DqRq3mQheN


but maybe I should start with something less complex...
any suggestions would be greatly appreciated
thank you

[edited] i just read about that varint thing...probably too complicated for me to deal with
You do not have the required permissions to view the files attached to this post.

dibe91
mega-veteran
mega-veteran
Posts: 221
Joined: Tue Jul 29, 2014 9:06 am
Has thanked: 3 times
Been thanked: 13 times

Re: Extracting simple models

Post by dibe91 » Sat Sep 17, 2016 6:10 pm

I have a question. have you ever tried to pick up models of mobile phone games? there is such a game that is called warhammer 40000 freeblade and there are several models of vehicles orks that I would be very interested in getting ...

User avatar
eri619
advanced
Posts: 79
Joined: Wed May 16, 2012 6:36 am
Location: India
Has thanked: 11 times
Been thanked: 1 time
Contact:

Re: Extracting simple models

Post by eri619 » Fri Sep 30, 2016 5:27 am

Could you please check whether these are model files?
https://mega.nz/#!oUgkwCyD!SF0Mz-13QWkL ... s7JcZBpwC0

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3184
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 869 times
Been thanked: 1750 times

Re: Extracting simple models

Post by shakotay2 » Fri Sep 30, 2016 6:58 am

from a first glance into torso file000000.emd I'd say it's no mesh data
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

Kanady
ultra-n00b
Posts: 1
Joined: Fri Oct 28, 2016 9:01 pm

Re: Extracting simple models

Post by Kanady » Fri Oct 28, 2016 9:08 pm

Thank you for the tool! It has been working amazingly for me so far.

The only problem (not really problem...) I'm currently having is that I'm working with model files containing numerous models (in some cases 200+) with the format Index Block 1, Index Block 2, Index Block 3, Vertex Block 1, Vertex Block 2, Vertex Block 3. I've taken apart multiple model files like this just fine by using the 'max face index' reported by Hex2Obj and calculating the size/start of each Vertex block.

Image

However, for large files, I'd like to automate this a little easier. Can I ask the formula for how 'max face index' is calculated by Hex2Obj when go1 is pressed? I can't seem to find anything on this.

Thanks!

Edit: I think I've discovered it using another script I've found on these forums:

Code: Select all

for i=1 to face_cnt do (
      f1  = (readShort stream #unsigned) + 1
      f2  = (readShort stream #unsigned) + 1
      f3  = (readShort stream #unsigned) + 1
      if (f1>maxcnt) then maxcnt= f1
      if (f2>maxcnt) then maxcnt= f2
      if (f3>maxcnt) then maxcnt= f3
Seems I can't automate it then with just a spreadsheet - will take some more advanced methods.

Thanks again!

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3184
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 869 times
Been thanked: 1750 times

Re: Extracting simple models

Post by shakotay2 » Sat Oct 29, 2016 11:09 am

hex2obj was intended to get model files with a quick approach.

For problems such as yours you're supposed to use a script (maxscript, Noesis or blender python).

If you know 'C' you might also look at:
viewtopic.php?f=29&t=12756

Basically it's used to create multiple H2O files to be used by hex2obj.
May appear to be a little bit awkward but there's some examples to give you the idea.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

Smakkohooves
beginner
Posts: 38
Joined: Fri Jan 15, 2016 7:34 pm
Has thanked: 14 times
Been thanked: 3 times

Re: Extracting simple models

Post by Smakkohooves » Sun Oct 30, 2016 10:46 am

Where i can download hex2obj

User avatar
OriginOfWaves
beginner
Posts: 36
Joined: Wed Jun 08, 2011 1:58 pm
Location: Nish, Serbia
Has thanked: 24 times
Been thanked: 11 times
Contact:

Re: Extracting simple models

Post by OriginOfWaves » Wed Nov 02, 2016 3:30 pm

hey there shakotay2. i have a file here I was hoping you have the time to help me out with. i can find and extract the meshes no problem but they end up with some flipped faces so 3d modeling software has problem rebuilding normals for them. now i can fix the faces in 3d max no problem and rebuild the normals correctly but i would like to know if i'm doing something wrong while extracting the meshes that causes these flipped faces.
example image.
Screenshot (26).png
i uploaded the file and the h2o settings i used. thanks in advance. https://www.dropbox.com/s/d8e1v8azpprzo ... er.7z?dl=0
You do not have the required permissions to view the files attached to this post.

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3184
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 869 times
Been thanked: 1750 times

Re: Extracting simple models

Post by shakotay2 » Wed Nov 02, 2016 9:56 pm

@Smakkohooves: viewtopic.php?f=29&t=10894

@OriginOfWaves: if those flipped faces concerned a whole submesh one could flip it as a whole object.
But the flipped faces appear randomly "checkered" (upper part of the picture). Even worse: the flipped faces don't have a normal at the backside, dunno why.
So I've to confess that I don't have a clue to solve it other than you did.
edit: seems it's a matter of overlapping submeshes (lods?).
Import to blender separated as groups, select dark part of the mesh (lower part of pic, not a whole submesh, sadly) and drag it away.
face_normals_.JPG
(Sometimes there's tables in model files containing flags which tell you when to flip the face winding.
But that's a very special feature that hex2obj will not cover to keep it simple.)
You do not have the required permissions to view the files attached to this post.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

User avatar
OriginOfWaves
beginner
Posts: 36
Joined: Wed Jun 08, 2011 1:58 pm
Location: Nish, Serbia
Has thanked: 24 times
Been thanked: 11 times
Contact:

Re: Extracting simple models

Post by OriginOfWaves » Wed Nov 02, 2016 10:58 pm

figured there was something else going on here. it's not a big issue. takes me 5 minutes to fix the faces in 3dmax. thanks for looking into it man.

cascraft
ultra-n00b
Posts: 6
Joined: Sat Oct 22, 2016 12:33 am

Re: Extracting simple models

Post by cascraft » Thu Nov 03, 2016 10:59 pm

is any german tutorial for that?

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3184
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 869 times
Been thanked: 1750 times

Re: Extracting simple models

Post by shakotay2 » Fri Nov 04, 2016 10:27 am

not to my knowledge
But this is something which can be done very simply by yourself: use a translator.

The following example doesn't give the very best results (some misleading may occur: 'faces' ist 'Dreiecke' instead of "Gesichter", or faces shouldn't be translated, though). Same goes for 'little endian' which is a common know technical term in Germany, too.
This kind of translation should be sufficient (more or less, after some manual corrections ):
hex2obj_tutorial_translation.JPG
Feel uncouraged to translate the whole thing this way.
You do not have the required permissions to view the files attached to this post.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

devmode
beginner
Posts: 27
Joined: Mon Jun 06, 2016 7:51 pm
Has thanked: 6 times
Been thanked: 5 times

Re: Extracting simple models

Post by devmode » Tue Nov 08, 2016 10:54 pm

In more games, especially on consoles, often can see what face indices in models is repeated or looks incorrect like this:
print a2
[0,0,1]
[2,3,4]
[5,6,7]
[8,9,10]
[11,12,13]
[14,15,16]
[17,17,18]
[18,18,19]
[20,21,22]
[23,24,25]
[26,27,28]
[29,29,30]
[30,30,31]
[32,33,17]
[16,16,34]
[34,34,35]

[36,37,38]
[39,40,41]

...

[109,109,110]
[110,110,50]

OK
Yes, it can easy replacing by generated indexes. Me just interesting a specific, how games\engines read these indices? Maybe have some patterns of this indices structures?

User avatar
eri619
advanced
Posts: 79
Joined: Wed May 16, 2012 6:36 am
Location: India
Has thanked: 11 times
Been thanked: 1 time
Contact:

Re: Extracting simple models

Post by eri619 » Tue Nov 29, 2016 11:45 am

Is this format a simple format? its a file from PSP
You do not have the required permissions to view the files attached to this post.

Post Reply