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.

We have Zebra!

A while back I tried running a program called previewer for viewing .gpl files (3d models).

There was a version of this program compiled for classic Macintosh computers. Since these computers (notably the PowerMac G3) had similar internal architecture to the Gamecube, they were used as testing environments for some areas of Gamecube development.

I had set up an emulator called SheepShaver so that I could try running the program. Unfortunately, SheepShaver (and all other modern classic Macintosh emulators) lack support for hardware-accelerated graphics. The lack of hardware-acceleration means that the previewer would not render correctly and would just lead to an empty black box.

I emailed around to a few used computer shops and managed to snag an old iBook G3 for $50.

The leaf fell off and the battery’s dead, but it still works just fine (when plugged in).

After setting it up with a copy of Mac OS 9.2.2, I was able to try launching the previewer program once again.

Unfortunately it got hung up a few times when trying to render some gpl files from the SDK.

Fortunately. I was able to open one of the 3DS Max projects included with the SDK. Special thanks to Video James (sonic15783)#6150 on the Discord for helping me get a copy of 3DS Max 3 up and running in my virtual machine!

Zebra.max in 3DS Max R3 3.0 in my Windows XP virtual machine

I was then able to export this from 3DS Max to a .gpl file using the cpexport.dle plugin included with the SDK Character Pipeline.

I tried previewing the gpl on the SheepShaver emulator (just to check if it was the emulator causing issues). Sure enough, I got the notorious black rendered screen.

Black screen render in SheepShaver

I tried viewing it on my iBook and, to my surprise, it rendered!

We have tiny .gpl Zebra!

Unfortunately the program freezes after this point and I have to force it to quit. This could be due to a number of reasons:
– The program might require a controller to function at all when something is rendered
– The laptop might not be powerful enough to do anything else once the model initially renders (doubtful)
– The program might be designed to function minimally in a mac test environment
– Something else

If anyone has a classic mac and would like to try out the Zebra demo, I’ve created a disc image [download]. Just burn the image to a CD and put it in the mac, then copy previewerD.bin to your Desktop and double-click to extract the program. Then, just double-click the newly extracted program to load the demo.

At this point, it’s a lot better than nothing.

I’ll try out some Harvest Moon gpl files over the weekend and see if I can get anywhere, of if I just get more black screens.

Getting Closer to 3D Model Previews

Namely, there was a “previewer” program compiled for old macs (old macs used a PowerPC architecture, similar to the Gamecube and Wii)

I’ve been fiddling around with some of the files from the Dolphin SDK.

I had tried running this before, but got stuck on the program looking for a “prevload.txt” file in a specific directory.

After some digging around in various documentation and script files, I finally figured out what I needed to do.

The program looks for an inserted disc with the volume label “cp”. It then looks for the folder “cp:/cpdata/preview/”. This folder must contain the file to be previewed (in this case, Zebra.gpl) as well as a text file called “prevload.txt” (which just contains the name of the file to be previewed).

With all of these conditions met, the program should display the requested file.

Unfortunately my virtual machine setup seems to freeze (or in some cases crash) at this point. This seems to be an issue with SheepShaver not supporting 3D hardware rendering.

Ultimately, the next (and only) step to get this software running would be to try it out on a real old-school mac. And even if that works, I’m not sure whether I’ll be able to navigate the program (since it seems to use some sort of game controller).

As always, I’ll keep you all updated.

SDK Software

I managed to figure out some of the software from the Gamecube SDK.

It looks like some of the SDK includes binaries built for the legacy mac platform.

Old Macintosh computers used the same PowerPC architecture (as opposed to other computers that used the Intel x86 architecture) as the Gamecube. This means that running software for the Gamecube would require either the actual dev kit hardware (known as HW1 or HW2), or a Mac.

There was also the official Dolphin emulator (not to be confused with the current fan project Dolphin Gamecube/Wii emulator), but that could only emulate certain aspects of the hardware.  You’d still need a mac or dev kit to run most things.

So, after some trial and error, I managed to get an old copy of Mac OS 9 running in a virtual machine known as SheepShaver.

I then got the preview program (an app from the SDK to view the character models/textures) to extract and open.  But when trying to run it, it fails after saying a needed file (prevload.txt) couldn’t be found. Documentation on getting this to run is sketchy at best.

I’ll need to do more digging to figure out the full configuration needed to get the app to run.  I read something about setting “CP_Root environment variables” in the SDK documentation, so that might be my next step.

I also tried getting my hands on a trial copy of 3DS Max (the software used by devs to create models). But then I found out that 3DS Max Plugins are version specific, so I’d need the old 3DS Max v3.1 to use the Gamecube plugins from the SDK to import/export models. And this will likely also require I use a virtual machine with an old version of Windows (e.g. Windows 98) to run it.

One step forward, two steps back.