The rules have been updated, read them now: Rules!

Fahrenheit (Indigo Prophecy) 2005 EU PC - Research

Post questions about game models here, or help out others!
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3251
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 892 times
Been thanked: 1785 times

Re: Fahrenheit (Indigo Prophecy) 2005 EU PC - Research

Post by shakotay2 » Fri Feb 19, 2021 4:22 pm

If you want it "perfect" (complete format analysis) you'd probably use the approach of mariokart64n.

But using the method of Bigchillghost I got a bunch of 10 H2O files very quickly which resulted in:
.
00d_9of10_meshes.png
Bigchillghost wrote:
Fri Feb 19, 2021 1:25 pm
There seems to always be a 0x130-byte header before the vertices block, with the fixed signature 70 01 95 00. So if you must do it by searching for a signature, this should be a good choice.
Yeah, thanks! Best choice - for me at least! :D

Took me 15 minutes of expanding my (obsolete) Make_H2O code (and 10 minutes of debugging :eek: ):
(uvs and normals not handled; (.._8.H2O discarded, see code) )

Code: Select all

void SM_of_Fahrenheit_loop(HWND hwnd, char szPathname[], DWORD dwStart)      //
{                                                                         //
   char * pFBuf, szNo[4], * pTmp ;
   BYTE cnt, cntMax ;
   int nValue[16] ;
   DWORD FIcnt, dwFaceIndCnt[100], vCnt, dwVertsCnt[100] ;
   DWORD addrFI, addrUV, addrV, j=0, offs2 ;  //
   DWORD addr[100] ;        // 
   char lines[6][20]= {"","Vb1","16 99","","021000",""} ;
   bool bStop= false ;

   pFBuf = (char *) lpFBuf ; pTmp= pFBuf ;
   if ((*pFBuf&255)!=0x44) {                             // 
        chMB("This doesn't seem to be a 'Fahrenheit' file!") ; return ;
   }
   SendMessage(GetDlgItem(hwnd, ID_LIST), LB_ADDSTRING, 0, (LPARAM) " creating H2O files:") ;
   cnt= 0 ;
   do {    //
        nValue[0]= 0x70; nValue[1]= 1; nValue[2]= 0x95; nValue[3]= 0;    // assumed signature of magic table
        offs2 = FindBytes(lpFBuf, j, dwFileSize-j, nValue, 4) ;
        if (offs2!=0) {
            pFBuf += offs2 ; j += offs2 ;
            addr[cnt]= j +32 ;  // vertex count und face index count
            fprintf(stream, "70019500...: %x\n", j) ;
            pFBuf += 4 ; j += 4 ;                               // skip signature bytes
        }
        else bStop= true ;
        cnt++ ;                                                 // next submesh
   } while (!bStop&&(j<dwFileSize)) ;
   //fprintf(stream, "\n assumed magic tables: %d\n", cnt-1) ;    //
   cntMax= cnt-1 ; addrUV= 0 ; cnt= 0 ;
        do {
            pFBuf= pTmp ; pFBuf += addr[cnt] ; j = addr[cnt] ;  // vor auf DW vCnt
            GetDW(pFBuf, j, vCnt, false) ;  dwVertsCnt[cnt]= vCnt ;
            addrV= addr[cnt] + 17*16;           // 0x130 bytes header, 32+17*16
            GetDW(pFBuf, j, FIcnt, false) ; dwFaceIndCnt[cnt]= FIcnt ;
            addrFI = addrV + 40* vCnt ;		// always 40? 48 required for .._8.H2O
            pFBuf= pTmp ; pFBuf += addrFI ;
            while (*pFBuf==0x2D) { pFBuf++ ; addrFI++;}     // risky!! skipping the padding
            fprintf(stream, "FI: %d, v: %d\n", FIcnt, dwVertsCnt[cnt]) ;
            //fprintf(stream, "g SM_%d\n#  at 0x%x (FIs at 0x%x)\n", cnt, addrV, addrFI) ;
            _itoa(cnt, szNo, 10) ;
            if (create_H2O(szPathname, cnt, lines, addrFI, dwFaceIndCnt[cnt], addrUV, 255, addrV, dwVertsCnt[cnt], 2) )
                SendMessage(GetDlgItem(hwnd, ID_LIST), LB_ADDSTRING, 0, (LPARAM) szNo) ;
            else SendMessage(GetDlgItem(hwnd, ID_LIST), LB_ADDSTRING, 0, (LPARAM) " failed") ;
            cnt++ ;
        } while (cnt<cntMax) ;
        //fprintf(stream, "\n vertex blocks: %d, vMax: %d\n", cnt, vMax) ;
   if (strlen(szErrMess)>17) MessageBox(NULL, szErrMess, "error", MB_ICONINFORMATION);
}
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."

JakeMiles
advanced
Posts: 47
Joined: Wed Aug 12, 2015 11:59 pm
Has thanked: 21 times
Been thanked: 3 times

Re: Fahrenheit (Indigo Prophecy) 2005 EU PC - Research

Post by JakeMiles » Fri Feb 19, 2021 6:23 pm

@shakotay2 Here a my code, it may look not right but - "it just works" and faces on obj looks okay.
listFaces i've temporary store face data look like:

Code: Select all

 listFaces[0]: 1
 listFaces[1]: 2
 listFaces[2]: 3
... etc
before add it to listFaces i've just increase by +1 when read face data wich look like 0,1,2.
Then i just do this, with you edited code:

Code: Select all

        List<Int32> listFaces = new List<Int32>();
        private void MakeTriStipesFromListFormated(int FacesCount)
        {
            int FaceDir;
            int startDir = -1;
            int cnt = 0, f1, f2, f3;
            int fl = 0;
            
            FaceDir = startDir;
            do
            {
                cnt++;
                f1 = listFaces[fl];
                f2 = listFaces[fl + 1];
                f3 = listFaces[fl + 2];
                FaceDir *= -1;
                if ((f1 != f2) && (f2 != f3) && (f3 != f1))
                {
                    
                    
                        if (FaceDir > 0) log.AppendText(string.Format("f  {0}/{0}/{0} {1}/{1}/{1} {2}/{2}/{2}\n", f1, f2, f3));
                        else log.AppendText(string.Format("f  {0}/{0}/{0} {1}/{1}/{1} {2}/{2}/{2}\n", f1, f3, f2));
                    

                }
                f1 = f2;
                f2 = f3;
                fl++;

                
            } while (cnt < FacesCount);
            
        }
And get faces for obj, f 1/1/1 2/2/2 3/3/3 etc.
I understand maybe i do someting wrong because i don't understand how code works fully, but result is fine.

@Bigchillghost Thanks for that, ive look at it.

@mariokart64n Good sample, it export face without eyeballs it is OKAY? And i look at your code and find tip for me how to rotate UV, :)

@shakotay2 wow, H2O this is Hex 2 Obj your application? i think i need look at it(your SM_of_Fahrenheit_loop() code) for better understand where and how get possition, thanks for helping guys!

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

Re: Fahrenheit (Indigo Prophecy) 2005 EU PC - Research

Post by shakotay2 » Fri Feb 19, 2021 8:11 pm

JakeMiles wrote:
Fri Feb 19, 2021 6:23 pm
before add it to listFaces i've just increase by +1 when read face data wich look like 0,1,2.
yeah, the '+1' is required for wavefront obj format
@shakotay2 wow, H2O this is Hex 2 Obj your application? i think i need look at it(your SM_of_Fahrenheit_loop() code) for better understand where and how get possition, thanks for helping guys!
Yes, but SM_of_Fahrenheit_loop() is for my obsolete Make_H2O project (now replaced by: Make_obj) which I revived to get the quick results from my previous post.

Here's the output for 0d1.dat (no uvs so far), contains 3 lods, afaics:
.
0d1-dat.png
uv's address is easy to calculate: vert_addr + 32 * vertex_count for v16 block, n16 block, t8 block
(For v16, n16, uva8, uvb8 you might try 40* vertex_count, didn't check this neither sure about uva, uvb.)
To not confuse: it's always all vertices of a sub mesh then all normals etc.

'C' source to be found here:
shakotay2 wrote:
Fri Feb 19, 2021 9:27 pm
(The handling of the created H2O files is a little bit unhandy (: - the idea was to do quick checks with the .dat files.)

contents of log file:

Code: Select all

...
 assumed magic tables: 30
FI: 90, v: 28
g SM_0
#  at 0x12af20 (FIs at 0x12b380)
FI: 88, v: 28
g SM_1
#  at 0x12bba0 (FIs at 0x12c000)
FI: 2314, v: 917
g SM_2
#  at 0x12c810 (FIs at 0x135760)
FI: 132, v: 88
g SM_3
#  at 0x136af0 (FIs at 0x1378b0)
FI: 597, v: 204
g SM_4
#  at 0x138120 (FIs at 0x13a100)
FI: 585, v: 201
g SM_5
#  at 0x13ad10 (FIs at 0x13cc80)
FI: 1900, v: 682
g SM_6
#  at 0x13d890 (FIs at 0x144320)
FI: 90, v: 28
g SM_7
#  at 0x156660 (FIs at 0x156ac0)
FI: 88, v: 28
g SM_8
#  at 0x1572e0 (FIs at 0x157740)
FI: 2504, v: 1005
g SM_9
#  at 0x157f50 (FIs at 0x161c60)
FI: 593, v: 204
g SM_10
#  at 0x163750 (FIs at 0x165730)
FI: 577, v: 201
g SM_11
#  at 0x166340 (FIs at 0x1682b0)
FI: 1878, v: 687
g SM_12
#  at 0x168ea0 (FIs at 0x16fa00)
FI: 567, v: 280
g SM_13
#  at 0x17b920 (FIs at 0x17e4e0)
FI: 1174, v: 489
g SM_14
#  at 0x1c6cb0 (FIs at 0x1cc880)
FI: 19, v: 12
g SM_15
#  at 0x1cd320 (FIs at 0x1cd560)
FI: 175, v: 85
g SM_16
#  at 0x1d1570 (FIs at 0x1d2580)
FI: 165, v: 85
g SM_17
#  at 0x1d3500 (FIs at 0x1d4510)
FI: 335, v: 170
g SM_18
#  at 0x1d5480 (FIs at 0x1d7470)
FI: 5, v: 4
g SM_19
#  at 0x1d8c40 (FIs at 0x1d8d00)
FI: 167, v: 89
g SM_20
#  at 0x1dbae0 (FIs at 0x1dcbb0)
FI: 167, v: 89
g SM_21
#  at 0x1ddac0 (FIs at 0x1deb90)
FI: 337, v: 178
g SM_22
#  at 0x1dfa80 (FIs at 0x1e1bf0)
FI: 917, v: 392
g SM_23
#  at 0x1e32d0 (FIs at 0x1e7c50)
FI: 5, v: 4
g SM_24
#  at 0x1e84f0 (FIs at 0x1e85b0)
FI: 169, v: 89
g SM_25
#  at 0x1ec670 (FIs at 0x1ed740)
FI: 167, v: 89
g SM_26
#  at 0x1ee660 (FIs at 0x1ef730)
FI: 335, v: 178
g SM_27
#  at 0x1f0620 (FIs at 0x1f2790)
FI: 1029, v: 431
g SM_28
#  at 0x1f3e60 (FIs at 0x1f8f40)
FI: 5, v: 4
g SM_29
#  at 0x1fe1d0 (FIs at 0x1fe290)
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."

JakeMiles
advanced
Posts: 47
Joined: Wed Aug 12, 2015 11:59 pm
Has thanked: 21 times
Been thanked: 3 times

Re: Fahrenheit (Indigo Prophecy) 2005 EU PC - Research

Post by JakeMiles » Fri Mar 05, 2021 12:05 pm

I think ive found bones, in sample file, 02f2.databank somewhere here hex 2C18, wich start a way up, maybe here 25C0, i don't know how to detect bones, it 80 3F by next 80 3F diagonal? somewhere need to be a weight paint, bones a 4 byte float? where to start i need to check, wich are bones and wich weight paint? i try watch some tutorials and it hard for me currently, link me a help, if know good knowbledge about how find/read bones, for start if i can solve it, then next matrix and transforms after.

here a sample. if need more i attach more.
https://dropmefiles.com/4Ceqf

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

Re: Fahrenheit (Indigo Prophecy) 2005 EU PC - Research

Post by shakotay2 » Fri Mar 05, 2021 1:34 pm

There's dozens of different skeleton formats - you'll confuse yourself just jumping into your example.
Do you know what a matrix is and how it's organized? columns, rows?

And NEVER start with an unknown example as a beginner. Better try to understand a "working example" first.

I'd strongly recommend to get some basic knowledge on skeletons as can be found here:
viewtopic.php?f=29&t=19429

Bigchillghost linked to the basic here:
viewtopic.php?f=29&t=19428
for good reasons. :)

btw: the list of (possibly) bones in your example is not very promising, too (you'll end up with wild guessing :D ):

F_CVA_EXT1_MAING
F_CVA_EXT1_KF_waist
F_CVA_EXT1_EX_eye_D
F_CVA_EXT1_KF_wrist_D
F_CVA_EXT1_EX_majeur_2_D
F_CVA_EXT1_EX_index_1_G
F_CVA_EXT1_EX_EL_roll_G
F_CVA_EXT1_KF_hip_G
F_CVA_EXT1_MAING_s_Shape
F_CVA_EXT1_KF_sternum

(broken?)
F_CVA_EX oulder_D

T1_EX_index_2_D
F_CVA_EX

F_CVA_EXT1_KF_collar_G
F_CVA_EXT1_EX_pouce_1_G
F_CVA_EXT1_KF_hip_D

F_CVA_EXT1_KF_ankle_G
F_CVA_EXT1_F_CVA_E1_TIF_
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."

JakeMiles
advanced
Posts: 47
Joined: Wed Aug 12, 2015 11:59 pm
Has thanked: 21 times
Been thanked: 3 times

Re: Fahrenheit (Indigo Prophecy) 2005 EU PC - Research

Post by JakeMiles » Fri Mar 05, 2021 5:23 pm

shakotay2 wrote:
Fri Mar 05, 2021 1:34 pm
There's dozens of different skeleton formats - you'll confuse yourself just jumping into your example.
Do you know what a matrix is and how it's organized? columns, rows?

And NEVER start with an unknown example as a beginner. Better try to understand a "working example" first.

I'd strongly recommend to get some basic knowledge on skeletons as can be found here:
viewtopic.php?f=29&t=19429

Bigchillghost linked to the basic here:
viewtopic.php?f=29&t=19428
for good reasons. :)

btw: the list of (possibly) bones in your example is not very promising, too (you'll end up with wild guessing :D ):
Thanks a tip, i try samples and Noesis can't load skel, maybe i do something wrong, i just paste scripts code in .py drop it to .plugins\python
try load model from script sample and noesis just don't show anything, no errors.

That right bones not all present names, but ive found table? after 44 41 54 41 42 41 4E 4B (Databank header) just take a bit lower and take 2 byte from 484 offset(hex) it is F4 0B if search it give 3 positions two in begin and end table, and one in middle, give another example, offset 134 give two bytes 6F 84, if search it, again 3 pos, in start\end table, and one before bone name. But maybe im newbie and this is just a coincidence. I don't know what 4 or 2 bytes before 6F 84 (in start table) maybe marker for something, and what is first 2 bytes in the last 4 bytes from this line, about table in the end offset example 3B220, first 2 bytes match EE 0B with start table, somewhere else (403C), before bone(?) name (424C).

P.S. I don't know for what i write it, but maybe it have a little right position, to do, i wish :D But something in my mind say me, this is wrong way :?
Maybe this is not good file example, ive attach more bigger file.

https://dropmefiles.com/MFmSW
https://dropmefiles.com/roquP
You do not have the required permissions to view the files attached to this post.

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

Re: Fahrenheit (Indigo Prophecy) 2005 EU PC - Research

Post by shakotay2 » Fri Mar 05, 2021 6:51 pm

JakeMiles wrote:
Fri Mar 05, 2021 5:23 pm
Thanks a tip, i try samples and Noesis can't load skel, maybe i do something wrong, i just paste scripts code in .py drop it to .plugins\python
try load model from script sample and noesis just don't show anything, no errors.
Which sample, which script exactly?
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."

JakeMiles
advanced
Posts: 47
Joined: Wed Aug 12, 2015 11:59 pm
Has thanked: 21 times
Been thanked: 3 times

Re: Fahrenheit (Indigo Prophecy) 2005 EU PC - Research

Post by JakeMiles » Fri Mar 05, 2021 7:45 pm

Found vertex shape for morph face.
Image
You do not have the required permissions to view the files attached to this post.
Last edited by JakeMiles on Fri Mar 05, 2021 7:52 pm, edited 1 time in total.

JakeMiles
advanced
Posts: 47
Joined: Wed Aug 12, 2015 11:59 pm
Has thanked: 21 times
Been thanked: 3 times

Re: Fahrenheit (Indigo Prophecy) 2005 EU PC - Research

Post by JakeMiles » Fri Mar 05, 2021 7:50 pm

shakotay2 wrote:
Fri Mar 05, 2021 6:51 pm
Which sample, which script exactly?
This:
viewtopic.php?p=148524#p148524
Rath.zip and Noesis script below.

Noesis give error, "File could not be previewed"

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

Re: Fahrenheit (Indigo Prophecy) 2005 EU PC - Research

Post by shakotay2 » Fri Mar 05, 2021 8:23 pm

JakeMiles wrote:
Fri Mar 05, 2021 7:50 pm
Noesis give error, "File could not be previewed"
You need to add the "startup code" before the Noesis code snippet (#load the model...), then it works:

Code: Select all

from inc_noesis import *
import noesis
import rapi

def registerNoesisTypes():
    handle = noesis.register("bonestest-skel", ".rn")
    noesis.setHandlerTypeCheck(handle, noepyCheckType)
    noesis.setHandlerLoadModel(handle, noepyLoadModel)
    return 1

def noepyCheckType(data):
    return 1
    
    #load the model
    #...
.
Raz_skel.png
You do not have the required permissions to view the files attached to this post.
Last edited by shakotay2 on Fri Mar 05, 2021 8:26 pm, edited 1 time in total.
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."

JakeMiles
advanced
Posts: 47
Joined: Wed Aug 12, 2015 11:59 pm
Has thanked: 21 times
Been thanked: 3 times

Re: Fahrenheit (Indigo Prophecy) 2005 EU PC - Research

Post by JakeMiles » Fri Mar 05, 2021 8:26 pm

shakotay2 wrote:
Fri Mar 05, 2021 8:23 pm
Didn't know about it, thanks!

Post Reply