Jump to content

Recommended Posts

Posted

hi i need help, i dont see any tools or anything for this game and i need help with reverse engeneering this type of file, i am new to this and id like to learn how to do it

 

  • Engineer
Posted
52 minutes ago, gayav27233 said:

hi i need help, i dont see any tools or anything for this game and i need help with reverse engeneering this type of file, i am new to this and id like to learn how to do it

 

at least send samples.

*you can also try my plugin (from another game but with this format) on my github, maybe you'll be lucky fmt_3di.py

Posted

The format is easy enough to read, but it seems as though the vertex data is somehow encrypted.  None of the standard data types such as Float or Short seem to work that I can see.

 

  • Engineer
Posted (edited)

Yeah, strange. When you use floats, it looks like so (may give an idea for further proceeding?):

# 0x6730: verts= 524
v 189.028900 247.378510 250.835541
v 191.511719 48.459816 196.528717
v 124.951561 159.326569 20.908594
v -208.019928 -241.540237 -7.917188
v 0.000000 0.275180 0.500182
v 0.000000 0.100627 0.688449
v 0.000000 0.286596 0.692017
v 0.000000 0.096597 0.511619
v 543.696899 431.323822 473.642975
v 420.461731 288.379303 319.399811
v 303.708893 333.325592 223.977341
v 213.503510 137.268356 156.994919
v 0.000000 0.348053 0.463434
v 0.000000 0.343674 0.590774
v 0.000000 0.374261 0.554919
v 0.000000 0.343260 0.625845

I've commented out the v 0.000 lines. Still no mesh so the data has to be treated other than being floats, I guess.

Edited by shak-otay
Posted

Some progress ...  In the first block of data at 0x680 there are 524 vertices.  This data seems to be made up of blocks of 0x60 bytes each, maybe quads; the first 0x30 bytes of each block seem to be the coordinates for 4 vertices, and the next 0x30 bytes seem to be 4 entries for vertex colour and UVs.  Although the face data seems to be triangles.  So probably some manipulation required.

 

  • Engineer
Posted

Look at 0xE270, it is a smaller mesh(?) There are 2 blocks of 0x30 bytes. I think DKDave is right but I don't see UVs in 2nd block, just vertex colors(FF FF FF 05) and  8 bytes (CD CD CD CD CD CD CD CD) So maybe vertices and UVs are in 1st block, I don't know...

Posted

The vertices are also arranged in a non-standard way - in each block of 4 you have all the X coords first, then all the Y, then Z ... bit of a pain but starting to look like a car ...

 

image.png.812f331b033a598163ce0f8e70308a2a.png

  • Like 1
  • Engineer
Posted (edited)

Since uvs are also available I tried to get the texture, too. But they seem to have an unknown compression (though named DXT1 in resource.bnk).

Getting them from RAM looks a little bit ugly and I found one for a level only, not for the car:

 

BeamBreakers_Level.png

Edited by shak-otay
Posted

Yeah, they're compressed, so I did this script to extract resource.bnk, and then the textures are standard DDS files.

Not all submeshes have UVs, so just need to filter out the ones that have 0xcdcdcdcd instead of float values.

 

beam_bnk.zip

  • Thanks 1
  • 2 weeks later...
  • Engineer
Posted

I don't have a ready-to-use script. Just some code to fiddle around whose vertex output I combine manually with face indices produced by hex2obj.

Excerpt (for getting vertices):

    cnt= 294 ;           // 137 PizzaCar, Tunnellampe: 8; PoliceCar 147; CargoLkw 177; gangsta02: 127? auch für Lvl East? 216
   for (k=0;k < cnt;k++) {             // <<< 0x680, 147 Pizza_Car;  Lampe 2E0, 5C0
        log_Verts_skip16(dwStart, 4, 0);       // 
        dwStart += 48 ;             // logged vertex block
            //fprintf( stream, "# %d skipAddr: %lx\n", k, dwStart) ;
        dwStart += 48 ;             // skip 4 lines uv 0.0 ....
        for (i=0;i < 4;i++) {
            //fprintf( stream, "v 0.0 0.0 0.0\n") ;
        }
   }

So done for each model individually.

If you're a coder I could show you log_Verts_skip16() but if you were you probably wouldn't ask?

Posted
1 hour ago, shak-otay said:

I don't have a ready-to-use script. Just some code to fiddle around whose vertex output I combine manually with face indices produced by hex2obj.

Excerpt (for getting vertices):

 

    cnt= 294 ;           // 137 PizzaCar, Tunnellampe: 8; PoliceCar 147; CargoLkw 177; gangsta02: 127? auch für Lvl East? 216
   for (k=0;k < cnt;k++) {             // <<< 0x680, 147 Pizza_Car;  Lampe 2E0, 5C0
        log_Verts_skip16(dwStart, 4, 0);       // 
        dwStart += 48 ;             // logged vertex block
            //fprintf( stream, "# %d skipAddr: %lx\n", k, dwStart) ;
        dwStart += 48 ;             // skip 4 lines uv 0.0 ....
        for (i=0;i < 4;i++) {
            //fprintf( stream, "v 0.0 0.0 0.0\n") ;
        }
   }

 

So done for each model individually.

If you're a coder I could show you log_Verts_skip16() but if you were you probably wouldn't ask?

oh yeah, i dont know rly anything about the coding, i just wanted to export models of cars and maps for my own animations or 3d printing

 

  • 4 weeks later...
Posted
On 12/23/2023 at 1:21 AM, DKDave said:

And just a quick test with the texture, seems to work ok:

image.png.345316a3a8931be50a443fca4ee292a9.png

i never asked, do you perhaps have the script for the models?

also thank u for ur time

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...