Now that I’m able to access the contents of the previously inaccessible CLZ files, It’s time to experiment with model files.
My first test was to decompress the mainchapter archives (e.g. mainchapter0.arc.clz), then extract the boy archives from there (e.g. boy_0.arc).
Then, I went about swapping the GPL files (e.g. boy_0.gpl). Based on my previous research, these should contain all of the 3D model data needed.
My first test at importing the girl model into AWL was… less than successful.
But at least the game didn’t crash, so that’s a start.
After some further tests, I found that I needed to swap all of the girl/boy-associated model files (act, gpl, skn, tpl, and tam) with their boy/girl counterparts.
After replacing the model files, replacing boy_0.arc and girl_0.arc in the corresponding mainchapter0.arc files with their updated versions, and repacking those into their corresponding mainchapter0.arc.clz formats, it was time to test them out.
To my surprise, the models worked with little to no issue.
We now have the female model in AWL and male character in AnWL!
The animations seem to rig fairly well to each character, with a few exceptions (e.g. standing still while holding an animal such as a dog or chicken as the girl in AWL will cause the ponytail to do weird things).
I’ll be doing some more testing regarding the animations, with the hopes of fixing any discrepancies (e.g. the above animal holding glitch, the wider/narrower stance difference between the characters, etc). I know James in the Discord has been very active in experimenting with the character animations lately.
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.
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.
I haven’t tried out any of the AWL files yet, but that will be the next step.
Overall, I’m leaps and bounds beyond where I was just a couple months ago.
I’ve tried using the above method to preview some gpl files from A Wonderful Life. Unfortunately, the program freezes on a black screen immediately after the Gamecube logo.
I’m not sure what the error is since the retail method of loading doesn’t provide any output. To get that, I’d need to be using a development system (e.g. GDEV, TDEV) that could be hooked up to a PC for console output.
The alternative would be to try using an entirely different piece of software, dspin.
This software (I have version 0.94) allegedly has experimental gpl import support.
I’ll do some tests with this software tomorrow to see if I can get anywhere.
If dspin doesn’t work, I’ll just have to shift focus back to dialogue editing until a workaround can be found, such as a more updated previewer for Mac (i.e. newer than the version included with the April 2001 Character Pipeline).
dspin didn’t seem to work. I renamed the file and put it in the dvdroot folder, but the program didn’t seem to do anything with it.
I’m not sure what I’m doing wrong. Further research needed.
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.
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.
This allows the file to open, but leads to a new error:
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).
After setting up a full software development environment in a Windows XP Virtual Machine using a combination of Visual Studio 6.0 and software from a recent AssemblerGames dump, I was able to make some progress with the SDK files.
I managed to delete the version-check code from C:\pcemu\build\charPipeline\geoPalette\src\geoPalette.c (a module used when previewing gpl geometry files).
I was then able to recompile geopalette.obj and charpipeline.lib (using the newly modified geopalette.c code) by opening C:\pcemu\build\charPipeline\win32\makeall.bat.
Once those were created, I could finally rebuild Previewer.exe and PreviewerD.exe (debug) by running the makefile located at C:\pcemu\build\demos\charPipeline\pcmakefile.
However, the program still will not actually load the model, and will crash shortly after displaying the “Loading” message.
After looking at the documentation that came with the SDK files, it seems that this issue is because the Windows version of Previewer needs gpl files exported specifically using little-endian, as opposed to big-endian (typical format for exporting for Gamecube/Mac test systems).
My best bet at this point would to continue my search for an OS 9 mac that I can run further tests on, or to find a way to convert the big-endian gpl files to little-endian for viewing on PC.