CloneKeen - the free-software Commander Keen 1-3 clone

How to Install

These instructions document how to download, install, and run CloneKeen 8.4 from source. This covers installation on Linux/BSD, Windows, Haiku, and OS X.

First, you will need a compiler. If you are running anything except Windows you probably already have the gcc C compiler. Some Linux distributions may not come with the SDL devel packages, for example, on Debian, you must type "apt-get install libsdl-dev" to configure SDL to be used for compiling programs.

On Windows, you'll need mingw and msys. If you don't already have them, see elsewhere for how to set that up, then come back. Alternatively, I've compiled CloneKeen before using Microsoft's Visual C++, but you will have to edit the Makefile to use cl.exe etc instead of gcc or create your own project file. If you want to try using MSVC, the files you need to include in the project are listed in, as well as, at the bottom, the commands for a Makefile which uses cl and link. If you don't have some reason to use MSVC, don't try this, just use mingw/msys.

Windows also may not natively support the *.tar.gz archive format the sources are compressed with; just use WinRAR to extract them.

* Download the game from the Downloads page; when decompressed this will give you a "keen" directory containing "bin" and "src" subdirectories.

* Using the command line, navigate into "src" and type "make". CloneKeen should compile and create an executable called "keen". Copy this executable into the "bin" directory.

* If you have not already done so, copy all files from an installation of the shareware episode of Commander Keen, and, optionally, one or both registered episodes, into the "data" directory, which you'll find inside the "bin" directory.

* Navigate to "bin" and run "keen". CloneKeen should start up and begin playing the demo.

I have rarely had any issues compiling the game. It has only one dependency (SDL) so there are generally no errors. If there are, check that you have gcc and g++ installed ok, and that you have the development version of the SDL libraries. If that's not it, click the Contact link and complain to me, and I'll help you get it going. If it compiles but won't start, attach ck.log from the bin directory.

Technical Notes

CloneKeen is written in pure C for maximum portability. There is one module, platform.cpp, which requires a C++ compiler. This file uses a series of #ifdef's to #include in one of the files under "/platform/" depending on your operating system. The file is in C++ because the Haiku operating system requires C++ to make effective use of any system calls. If you're compiling for an embedded platform (like a game console) and can't use C++ it is safe to remove the 'extern "C"' stuff from platform.cpp and compile it as plain C. This could be fixed later with a proper ./configure script so that C++ support is only required on Haiku.

At one point during compile you'll get a LOT of warnings on later versions of gcc, about some fairly abominable implicit casting I did in the menu modules. It's harmless, the code works great anyway, which is probably why I haven't ever gone in yet and refactored it to get rid of them -- why risk adding bugs to something that already works to fix something that isn't visible to the end-user? Hey, I wrote most of this code a long time ago; I was dumber then. That's my excuse.

There should be no endianness issues; CloneKeen uses it's own routines (fgeti/fgetl and fputi/fputl) for loading multi-byte sequences, so savegames, maps etc are interchangeable and will work the same regardless of how your target architecture encodes them.

CloneKeen ©2003-2016 Caitlin Shaw