Exploring the GameCube Service Disc gpl models

Preliminary Analysis of gpl files on the Service Disc

After a bit of research on gpl models, I’ve been lead to the Gamecube Service Disc v1.0/03.

Upon analysis of this disc, I’ve found that it contains gpl files created using version 12012000 of the geometry library (same as the Dolphin SDK), as well as version 6012001 (same as A Wonderful Life).

When booting the disc normally, it seems to load the v12012000 gpl files (e.g. disc:/gxDemos/CarDemo/f50.gpl) for the default Car Demo program (disc:/CarDemo/cardemo.dol).

Attempting to Swap Models

However, I can get it to load the 6012001 versions (e.g. disc:/CarDemo/f50.gpl) by replacing the main executable on the disc (disc:/main.dol; naming might vary depending on the tool used) with a special version of the Car Demo program (disc:/ntd/cardemoN.dol).

With this in mind, I should be able to (in theory) replace some of the models in the cardemo with files from AWL.

E.g. If I were to look at bass.arc from AWL, it contains all of the needed files (an act, a gpl, and tpl).

If I were to extract these files and adjust the files on the service disc as follows:

  • rename disc:/CarDemo/f50.act to disc:/CarDemo/f50.act.backup
  • rename disc:/main.dol to disc:/main.dol.backup
  • copy disc:/ntd/cardemoN.dol to disc:/main.dol
  • copy bass.act to disc:/CarDemo/f50.act
  • copy bass.gpl to disc/CarDemo/bass.gpl
  • copy bass.tpl to disc/CarDemo/bass.tpl

It should load the bass model when booting the disc, instead of the default ferrari.

However, it seems that the new model (in this case, bass.gpl) does not load correctly.

The bass model should be above the rectangular shadow in the middle.

I’m not sure why this is currently the case, but I plan on doing some further tests as I can.

Why a lot of AWL models won’t work

A lot of gpl files on the root of the AWL disc (which, it’s worth mentioning, aren’t actually used by the game) don’t seem to be configured correctly.

As an example, let’s look at boy_0.arc.

While this file contains a valid act and gpl, it has 3 seperate texture (tpl) files for the body (b0), eyes (f0_e), and mouth (f0_m).

This is a problem because most gpl files are coded to load one tpl file. In this case, we can open boy_0.gpl in a hex editor and see that it’s supposed to load all of it’s textures from a nonexistent Boy_0.tpl file.

As such, attempting to load the boy_0 model using the above method I tried for bass, will not work. The program will simply give an error “Could not find CarDemo/Boy_0.tpl” and freeze/crash.

Attempting to rename any of the other texture files (e.g. renaming boy_0_b0.tpl to Boy_0.tpl) also doesn’t work, it just causes a crash. This is likely because the elusive Boy_0.tpl file would include all body, eye, and mouth textures in one single tpl file.

More Research Required

I plan on doing more testing with the Service Disc and the CarDemoN program.

There’s also other demos, disc:/ntd/zebraA.dol and disc:/ntd/zebraS.dol, that could be useful for viewing models/animations.

There’s also a program disc:/ntd/preview.dol that might be useful for previewing models.

Hopefully I’ll be able to come up with something over the next few weeks.

Fun with Textures in Dolphin

I’ve recently tried playing with the texture dump and load tools in Dolphin (fan emulator).

I dumped the boy textures from A Wonderful Life and swapped them with the girl textures from Another Wonderful Life.

The results were… interesting.

It’s worth noting that this is just a temporary solution until I can find a way into the game’s CLZ file format to manually replace the texture image files on the disc.

It’ll mainly serve as a way to identify the main character during test playthroughs as a female/male via their face/clothing.

Also, I really need to find a better way of differentiating Dolphin (Gamecube Development Codename) and Dolphin (fan emulator). Maybe I should refer to the former as Nintendo Dolphin and the latter as Dolphin-emu.

GPL Model Trial and Error and Error and Error

I tried running some of the .gpl files from A Wonderful Life through the previewer program on my iBook.

I attempted to load farm.gpl, since it’s texture configuration is one of the simplest (one tpl + one gpl) amongst the AWL gpl models.

Unfortunately, all of the gpl files from AWL caused a version-mismatch error and I’m not well-versed enough to recompile the program for mac at this point.

Error when attempting to load gpl files from AWL.
Occurs on both SheepShaver and iBook.

Fortunately, after examining the gpl files, I was able to find that the version number can actually be changed in a hex editor by setting the view options to display as decimal, group by double words, and use a big endian byte order. In this case, the version of the gpl was 6012001. I changed the version field to what previewerD requires (version 12012000), and reran previewer.

Changing the gpl library version from 6012001 to 12012000.

This allows the file to open, but leads to a new error:

GXSetVtxAttrFmt(): Only valid scale for 8b pos or texcoord data is 0 on HW1 in “GXGeoVert.c” on line 263.
Occurs on both SheepShaver and iBook.

This is likely due to the gpl being initially exported for HW2 (retail Gamecube) which uses an updated graphics driver compared to HW1 (initial dev kits). Since the mac version of previewer appears to be built on the HW1 code, it leads to the error above.

It might be possible to get around this error by running the HW2 version of previewer.elf via Dolphin (fan emulator) or Swiss (Gamecube homebrew loader), but it would take some time to figure out the proper configuration. Further research will be needed.

I also attempted to load a more complex 3d model (boy_0.gpl, extracted from boy_0.arc). This file has multiple textures associated with it (boy_0_b0.tpl, boy_0_f0_e.tpl, and boy_0_f0_m.tpl).

Unfortunately it seems that the gpl is improperly configured. When loaded through previewer on iBook, it looks for a single nonexistent boy_0.tpl texture.

It’s worth noting that the files from this version of boy_0.arc aren’t actually used in-game (the actual models/textures are loaded from one of the clz archives). These are likely leftovers from some point in the games development.

For now, I’ll be sticking to research on the simpler models first (e.g. farm.gpl, grass.gpl, and various fish models) to see if I can get past the HW1/HW2 limitations.

I also attempted to change encoding of farm.gpl from big to little endian (grouped by double-words).

I ran it through my Windows version of previewerD.exe (recompiled with version-check removed). However, I got a new “component count” error.

This is likely due to some sort of error when I attempted to convert the file’s endianness. Further research will be needed.

Exploring File Formats

After scouring the internet for any documentation on the file formats used for the character models (namely the .gpl files) I’ve found the one (and seemingly only) source of information.

The Documentation for the official Nintendo Gamecube SDK / Character Pipeline / Dolphin Emulator

There are some executables included with the sdk that enable previewing of GPL (geometry), ACT (hierarchy), ANM (animation), SKN (skinning information) and TPL (texture) files. However, it seems that these require some sort of PowerPC configuration through either the dolphin development hardware or an old powerpc mac. There is a previewer.exe in the sdk, but I haven’t been able to get it to load a gpl without crashing so far.

Honestly my best chance will probably be emulating an old build of Mac OS X (e.g. 10.5 Leopard) and trying to load the preview scripts on that platform.

I will post back with my results.

HM: A Proud Life – Face Textures

After looking through all of the files that I could find, I’ve been unable to locate the face textures for the main character in AnWL; I’ve only been able to locate the body/outfit textures.

The face texture files are easy enough to find in in AWL:

  • Young Character:  disc:\boy_0.arc (U8 Archive)
    • Eye Textures: boy_0.arc\boy_0_f0_e.tpl
    • Mouth Textures: boy_0.arc\boy_0_f0_m.tpl
  • Adult Character: disc:\boy_1.arc
    • Eye Textures: boy_1.arc\boy_0_f1_e.tpl
    • Mouth Textures: boy_1.arc\boy_0_f1_m.tpl
  • Senior Character:  disc:\boy_2.arc
    • Eye Textures: boy_2.arc\boy_0_f2_e.tpl
    • Mouth Textures: boy_2.arc\boy_0_f2_m.tpl

However, the structure seems to be different for AnWL. I’ve created a diff comparison for the disc filesystems to hopefully help with finding the newly located files.

I’ve run the game through dolphin and can see that the textures do exist somewhere, but I can’t seem to find the source that they’re being loaded from.

If anyone can give any insight, it would be much appreciated.

For now I’ll work on the swapping out the body/outfit textures.