Join also our Discord channel! Click here.

L.A. Noire heads

Post questions about game models here, or help out others!
Post Reply
User avatar
Tosyk
double-veteran
double-veteran
Posts: 947
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 225 times
Been thanked: 120 times
Contact:

L.A. Noire heads

Post by Tosyk » Sun Dec 29, 2013 1:07 pm

trying to explore this meshes with hex2obj without luck. feeling lack of knowledge i assumed that ackerman_head.chunk mesh has several meshes inside and first of them starts from 0x66A4 and ends at 0x725C

but after that tutorial leads me in a totaly mess, where vertices and uvs flew away from logical area of where the data should stored, ex:
v -832981766051521080000000000000000000.000000 -0.000004 -0.002124
v 0.002808 -0.000001 0.000000
v 0.000000 0.000000 -56217600459076175000000000000000000.000000
v -4307986335116815300000000000000000000.000000 -0.000379 -0.000030
v 0.000109 -0.000000 0.000000
v 0.000000 0.000000 -24052315832927675000000000000000000.000000
v -11001165024864064000000000000000000000.000000 -0.000111 -0.000001
can anyone help me with this?
Thank you for all you do here
my blog | my forum

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

Re: L.A. Noire heads

Post by shakotay2 » Sun Dec 29, 2013 2:23 pm

Tosyk wrote:but after that tutorial leads me in a totaly mess, where vertices and uvs flew away from logical area of where the data should stored, ex:
the tutorial is assumed to be used on simple models only as L.A. Noire heads are not.

For more complex models there are further steps to be observed:
  • use TextureFinder to get a clue whether/where texture data might be contained
  • after you got the face indices list (what mostly seems to be the easiest part)
  • scroll carefully through the model file to determine different sections
If you know from the max face index that there should be 1000 vertices for example
you can calculate the size of a continuous vertex section: 0x2EE0 for floats
or 0x1770 for half floats in sequential mode. (For the blocked mode the size is
1000 * VBsize of course.)

For L.A. Noire I found the normals blocks so far; start addresses may be incorrect!
adams_head:
Image
For ackerman_head the H2O file is:
0x66A4 1500
VB1
36 99
0x3B38 309
0202

After knowing the normals section it may be easier to find the vertex positions.
Eiterh in the smae block or in another section.
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
zaramot
double-veteran
double-veteran
Posts: 764
Joined: Wed Jan 05, 2011 12:41 pm
Has thanked: 39 times
Been thanked: 804 times

Re: L.A. Noire heads

Post by zaramot » Sun Dec 29, 2013 3:11 pm

Quickly checked Adam's head, vertices appears to be shorts so the UV's. Vertex start at 0x3150, vertex size 36 bytes.
You do not have the required permissions to view the files attached to this post.
Making model-import scripts, PM

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

Re: L.A. Noire heads

Post by shakotay2 » Sun Dec 29, 2013 3:29 pm

enabling of the "cut" button is required, too.
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
Tosyk
double-veteran
double-veteran
Posts: 947
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 225 times
Been thanked: 120 times
Contact:

Re: L.A. Noire heads

Post by Tosyk » Sun Dec 29, 2013 4:44 pm

Wow, this looks great, will continue research later this evening.
Thank you for all you do here
my blog | my forum

User avatar
Tosyk
double-veteran
double-veteran
Posts: 947
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 225 times
Been thanked: 120 times
Contact:

Re: L.A. Noire heads

Post by Tosyk » Mon Dec 30, 2013 2:07 pm

Image

can u point me where is my error? for adams_head.chunk

can't get any positive result.

also I understand diferent sections in the files:

"garbage"
texture
vertextes
faces
texture dxt1 with mipmaps
normals?
"garbage"
Thank you for all you do here
my blog | my forum

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

Re: L.A. Noire heads

Post by shakotay2 » Mon Dec 30, 2013 3:22 pm

use WordAll

And then switch the cut button from "noCut" to "cut".
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
Tosyk
double-veteran
double-veteran
Posts: 947
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 225 times
Been thanked: 120 times
Contact:

Re: L.A. Noire heads

Post by Tosyk » Tue Dec 31, 2013 12:50 am

so i found this for adams_head.chunk:

Image

works perfectly, i found and extract it textures.

also, i assumed that vertex buffer consists of 24 bytes pattern and first float_3 it's CoordXYZ

now, how can i found uvs?
Thank you for all you do here
my blog | my forum

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

Re: L.A. Noire heads

Post by shakotay2 » Fri Apr 22, 2016 4:50 pm

(sry for this abandoned thread - as a known member of RodH club we like to grab it again :D )
yeah, see: Tosyk was right using half floats for the uvs (never could have imagined this ugly square uv map to give a decent head):
Adam_head.jpg
btw. FVF size is 36 here (former "VB size"). Also the "cut" option has been cut (ha-ha) from newer versions of hex2obj.
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
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3155
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 847 times
Been thanked: 1723 times

Re: L.A. Noire heads

Post by shakotay2 » Fri Apr 22, 2016 8:51 pm

here's a short (and ugly) maxscrript to load Adam's head chunk.
As you may know I prefer doing it in 'C' but Tosyk requested a maxscript:
(works for THIS head only!)

Code: Select all

fn readHalfFloat fstream = (
    hf=readshort fstream #unsigned
    sign = bit.get hf 16
    exponent = (bit.shift (bit.and hf (bit.hexasint "7C00")) -10) as integer - 16
    fraction = bit.and hf (bit.hexasint "03FF")
    if sign==true then sign = 1 else sign = 0
    exponentF = exponent + 127
    outputAsFloat = bit.or (bit.or (bit.shift fraction 13) \
    (bit.shift exponentF 23)) (bit.shift sign 31)
    return bit.intasfloat outputasfloat*2
    )


vertArray=#()
faceArray =#()
UVarray=#()

function ReadModelFile fName=
(     
    format "-- START READING MODEL FILE --\n"
    stream = fOpen fname "rb"          -- Open the file for reading
    fSeek stream 0x194 #seek_set
    vertCount = readlong stream       -- vertex count of (first) submesh
    faceCnt     = readlong stream
    vertStride= 36
	
    --print ("@ 0x"+ bit.intAsHex(ftell stream) as string)		

    fSeek stream 0x3150 #seek_set	-- vertex block
    for i=1 to vertCount do (		--
       x  = readShort stream #signed
       y  = readShort stream #signed
       z  = readShort stream #signed
       fSeek stream (26) #seek_cur
       tu  = readHalfFloat stream; tv  = readHalfFloat stream
       append vertArray ([x,y,z]/127.0)	
	   --format "v %\n" vertArray[i]
       append UVarray [tu,tv,0]		       
    )
    print ("@ 0x"+ bit.intAsHex(ftell stream) as string)
	
    for x = 1 to faceCnt do (
        fa= readshort stream #unsigned
        fb= readshort stream #unsigned
        fc= readshort stream #unsigned
            format "f % % %\n" fa fb fc
        append faceArray[fa+1,fb+1,fc+1]	
	)	
    msh = mesh vertices:vertArray faces:faceArray
    msh.numTVerts = vertCount
    buildTVFaces msh
    for j = 1 to vertCount do setTVert msh j UVarray[j]
    for j = 1 to faceCnt do setTVFace msh j faceArray[j]

    fClose stream
)

-- entry point --

ClearListener()
fname = getOpenFileName \
caption:" open L.A. Noire 3D Model" \
types:"3D Model (*.chunk)|*.chunk"
--historyCategory:"3D Model chunk
format "fname: %\n" fname
   
ReadModelFile fname
For other chunk files you'll need to adjust the start address of the vertices block (0x3150 here)
and (possibly) the address of the vertex count: 0x194
Adams_head_MS.jpg
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
Tosyk
double-veteran
double-veteran
Posts: 947
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 225 times
Been thanked: 120 times
Contact:

Re: L.A. Noire heads

Post by Tosyk » Fri Apr 29, 2016 8:30 pm

shakotay2 wrote:here's a short (and ugly) maxscrript to load Adam's head chunk.
I'm greatly appreciate for this, shakotay :]
Thank you for all you do here
my blog | my forum

Post Reply