Chocolate Keen is a reverse engineering of Commander Keen in C and SDL. The goal is to be super accurate versus the original
- You can play directly in the browser! Click here
- If you want to download and play offline, see the Releases section below
- Arrows - Move Keen around
- Ctrl - Jump
- Alt/Option - Use Pogo/Stop Pogo (if you have one)
- Ctrl AND Alt/Option - Fire raygun (if it has charges)
If you’re having issues with the controls (e.g. on a Mac keyboard), you can change the key bindings with F3.
Downloadable game packages available in Releases. All versions come packaged as zip files with game data. Just extract and run. On Linux, you'll need the SDL 2.0 runtime installed. Other versions come pre-packaged with SDL
- Releases/Linux - Linux version. Run
./chocolate-keen
- Releases/WebAssembly - WebAssembly version. Run
chocolate-keen.html
- Releases/Windows-x86 - for 32-bit Windows. Run
chocolate-keen.exe
- Releases/Windows-x64 - for 64-bit Windows. Run
chocolate-keen.exe
The downloadable releases above come packaged with Commander Keen "Invasion of the Vorticons" Episode One: Marooned on Mars. But the engine supports the entire Vorticons trilogy. If you have Episode Two or Three, drop the level/data files into the GAMEDATA folder as follows:
.
├── chocolate-keen.exe
└── GAMEDATA
├── KEEN1
| └── ... Episode One level data (pre-packaged)
├── KEEN2
| └── ... Episode Two level data
└── KEEN3
└── ... Episode Three level data
You can then start each episode via chocolate-keen.exe -startkeen1
, chocolate-keen.exe -startkeen2
and chocolate-keen.exe -startkeen3
respectively
You can clone or download the chocolatekeen repo and build it yourself
For Linux builds you'll need a C compiler (e.g. gcc) and toolchain. The setup varies between distros. For Ubuntu you can install the build-essential package via sudo apt-get install build-essential
. Once you have that setup:
- Install the SDL 2.0 development libraries. This varies between Linux distros. For Ubuntu it's
sudo apt-get install libsdl2-dev
. More info here - Launch a shell
- Navigate to
/build/linux
- Run
./build_linux.sh
To build for WebAssembly, you'll need the Emscripten SDK. Find setup instructions here
- Launch a shell with emscripten build tools (emsdk) in the PATH
- Navigate to
/build/emscripten
- Run
./build_emscripten.sh
This is a Makefile project. To build for Windows you'll need something like MSYS2 and a gcc toolchain. Find setup instructions here
- Download and unzip SDL 2.0 development libraries: https://www.libsdl.org/download-2.0.php
- Launch a UNIX shell
- Navigate to
/build/MingGW
- Run build script that corresponds to your platform:
- Windows x86:
./build_mingw32.sh /path/to/SDL2
- e.g.
./build_mingw32.sh /d/Development/SDL2-2.0.9/i686-w64-mingw32/
- Window x64:
./build_mingw-w64.sh /path/to/SDL2
- e.g.
./build_mingw-w64.sh /d/Development/SDL2-2.0.9/x86_64-w64-mingw32/
Build and Debug with Microsoft Visual Studio / Visual C++
- Navigate to
/build/Visual C++
- Open Solution file (
ChocolateKeen.sln
) in Visual Studio - Restore NuGet dependencies (Project -> Manage NuGet Dependencies > Restore)
- Build (Build > Build Solution)
- Run (Debug > Start Without Debugging) or Debug (Debug > Start Debugging)
Game data is automatically copied to the Target Directory as part of build - so everything should "just run"
The original authors of Chocolate Keen are NY00123, QuantumG and Lemm. The project started with a reverse engineering of the original Keen code, and the goal is complete authenticity to the original - bugs and all. For more info see https://pckf.com/viewtopic.php?f=4&t=2536
Since bringing this to GitHub, I've ported to WebAssembly and I intend to support other platforms too
The WebAssembly build of Chocolate Keen relies on Emterpreter. This hinders performance significantly vs using Emscripten loops. If you don't have a sufficiently fast machine you may notice audio stutters or frame skips
Although the original game supports both EGA and VGA graphics modes, the WebAssembly build is hardcoded to VGA. The original game resolution is 320x200, which is internally scan-doubled to 320x400. The x-axis is then doubled also to preserve the aspect ratio, yielding 640x400. Once overscan borders are added, the internal game resolution jumps to 672x414. This is rendered into the HTML canvas to provide a pixel perfect image, and then aspect-ratio corrected to 4:3 via CSS
Some parts of the game (initial load and exit screen) use VGA text mode. Internally this renders at 720x400 (or 736x414 with overscan) and is nearest-neighbour downsampled to the game resolution of 672x414. It looks ugly, but we have to live with this for now to preserve crisp game visuals