Resident Evil: Code Veronica X (Nintendo Gamecube) Help Extracting Models

Skeletons, animations, shaders, texturing, converting, fixing and anything else related to read game models
Biohazard4x
Posts: 9
Joined: Fri Jan 01, 2021 12:03 am

Resident Evil: Code Veronica X (Nintendo Gamecube) Help Extracting Models

Post by Biohazard4x »

I've been on a mission to try and rip chris's player model from this game and I have been unsuccessful from extracting. I heard you can extract models using dolphin and 3D ripper DX and I cant seem to get any stable version of Dolphin working with 3D ripper DX it just wont DX wont boot Dolphin. Anyway I have tracked down the models of the Gamecube to

"root/system.AFS/plXX.ald" and "XX" being the players ID, but I'm not sure which one is who.

I found several strings of text that could hint of the players texture names. I have also seen one mention of text on each model saying "MDL" assuming a model block as well. After this i have hit a brick wall and im stumped.

In the case of Pl02.ALD. Starting at 0xCB0
Image
Black Box - "MDL" Mesh Block ID(?)
Red Box - Possibly Textures Names

I have also attached sample in a ZIP below. Let me know, Thanks!
Last edited by Biohazard4x on Mon Nov 22, 2021 4:21 am, edited 1 time in total.
Biohazard4x
Posts: 9
Joined: Fri Jan 01, 2021 12:03 am

Re: Resident Evil: Code Veronica X (Nintendo Gamecube) Help Viewing Models and Textures

Post by Biohazard4x »

Some Awesome Information was shared to me from the user, NiV-L-A.

"
probably requires a script to get the other sub meshes. This is the first "MDL" block:
@0x3FF8 - 0x02FD (vtx/normals count)
@0x3FFC - vertices and normals alternating. padding: 12 (0x0C)
Image
Image
I can't find any indices section that could match the vertices...
The only thing that imo resembles one is the section just before the first mdl block"

Still looking for a way to extract complete models! Let me Know!
mariokart64n
Posts: 12
Joined: Fri Aug 08, 2014 12:59 am

Re: Resident Evil: Code Veronica X (Nintendo Gamecube) Help Extracting Models

Post by mariokart64n »

I applied a UV Texture to show that there is valid mapping data on the mesh
Image

The faces and vertices are defined in a buffer containing multiple encoded streams. you traverse the buffer by reading each stream and decoding it by reading the 32bit uint stream header. This stream header contains flags to inform how decode the stream but I'm not sure if its possible to calculate the stream length

This means that you won't be able to traverse the entire buffer if you encounter a new stream type which is unknown.

I will provide details on the format, refer to the image reference below.
Otherwise the file snippet was taken from address 0xBBCC from the topic poster's provided sample "pl04.ald"

* address 0x00000000 is the start of the MDL block

at 0x00000006 read the count for the next table, which we get 0x0016 from the sample

at 0x0000000C read the pointer and add 0x00000010, thus goto 0x00000320

*lets read the first entry in the table, each entry is 52bytes in length

Code: Select all

Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
00000320   00 00 00 07 00 00 02 F8  00 00 00 00 00 00 00 00
00000330   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
00000340   3F 80 00 00 3F 80 00 00  3F 80 00 00 00 00 03 44
00000350   FF FF FF FF


at 0x00000324 read the pointer and add 0x00000010, thus goto 0x000002F8

Code: Select all

Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
00000300                            00 00 01 3C 00 00 00 1C
00000310   00 00 00 00 3C E2 60 B3  3F 86 1C 15 BF 8D BB 62


at 0x00000308 read the pointer for the vertex stream buffer and add 0x00000010, to get 0x0000014C
at 0x0000030C read the pointer for the face stream buffer and add 0x00000010, to get 0x0000002C

* i wont go over every tiny detail of the streams, but here are a few examples;

in the face stream buffer we are given

Code: Select all

Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F

00000020                                        25 13 00 04
00000030   B2 B2 B2 FF B2 B2 B2 FF

0x25130004 is the stream header for this stream, it is possible that 0x0004 multiplied by 2 plus 4 gives us the stream length?
Regardless this is stream provides RGBA values to describe the face colour for the stream going forward until the next face colour in the stream is reached.

the faces can be stream in as either triangle list or triangle strips and are paired together with texture coordinates, that's why reading them in model researcher won't work

next in the vertex stream buffer we are given

Code: Select all

Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
00000140                                        00 6D 00 29
00000150   00 12 00 00 3E 3A 2C CC  3C B7 A5 06 3F CE D9 40
00000160   3F 79 41 3D BB CB E5 CA  3E 69 6D 1B 3E 36 DB 18


0x006D0029 is the stream header for this stream, it appears to follow a different bitmask layout as the face stream.
following this we get 0x00120000 which seems to be a descriptor for the following float point data.

From my observations 0x0029 will contain three 32bit float points for position, following three 32bit float points for normal.
as 0x0022 will only contain three 32bit float points for position.

* the ALD likely contains other complimentary data such as weight data, it also contains other mdl blocks for level of detail meshes and the hands.

Sample File "pl04.ald" @ 0xBBCC:
Image