glitchy's

blog

Decompiling Kahootz

2019-09-15 | kahootzreverse engineeringthree.js


One of the first things I noticed after installing Kahootz was that it had all the resource files available in an open file structure, which is uncommon in modern applications. Usually assets are all compiled into blobs and dynamically extracted at runtime, but Kahootz just has everything loose in the /Res folder:

File directory of the Kahootz3 installation folder and the Res subfolder

Inside each of the textures/Sounds/models folders are what you'd expect, but actually getting something usable out of this isn't as easy as you'd think.

Kahootz 3 was developed over 15 years ago, when they had different software standards and development environments, and I'm not familiar with many of the file types. After a bit of research here's what I've deduced:

Filetype Description / possible usage
.cst Director "Cast" file
.cxt Director "Cast" or "Object" file which is edit protected
.dxr Director "Movie" files that are non-editable
.ico Icon file that's still somewhat common today
.ini Common configuration text file
.kb Kahootz background file? Not sure; It's in the "backgrounds" folder
.w3d World 3D? A 3D model file used by Shockwave/Director
.wav Common uncompressed audio format

It's probably clear by now that most of these files are relevant to "Director", aka Macromedia Director, a program obtained by Adobe in 2005 that reached End Of Life in 2012. Finding documentation, support, or even a copy of the software isn't easy.

I honestly spent a while trying to install different versions of Shockwave and Director to open these files, without success. It turns out somebody else has partially solved my problem though, and created a tool to convert Shockwave 3D World Files (w3d) into a more usable format.

To test this, I chose a random environment model 'ENVI_SewerageTunnel.w3d', which corresponds to this sewer level in the game:

Sewer scene open in the kahootz 3 program

And running the 'ENVI_SewerageTunnel.w3d' file through the 3D converter tool got me this collection of very usable files:

File directory of models and images for the sewer scene

Which I can easily enough open in blender.

Sewer model open in blender

I love how they've used a cone for the sky. Also, it's really interesting how there's a separate simpler mesh in the model for collisions, which defines where the camera is allowed to fly in the game.

Here's some cool blender renders of the sewer with different lighting. I haven't modified any of the models/textures at all here.

Light falling through the grate illuminating the sewer Sunrays hitting the floor and illuminating the rest of the sewer chamber Candid shot of a flashlight in the sewer as seen from above ground

I have a lot of work ahead of me extracting all these models. I'm considering making them all openly available and explorable in the browser with Three.js or something, assuming the publishers no longer care about their long-abandoned proprietary software.

Oh, and I'll get around to releasing kahootz club soon, I'm very busy with uni right now :)