Skip to content

OpenCrystalCaves/OpenCrystalCaves

Repository files navigation

C/C++ CI #CrystalCaves on Mastodon Download at itch.io

OpenCrystalCaves

OCC is an unofficial open source engine reimplementation of the game trilogy Crystal Caves.

Download binaries and project info at itch.io

This repository includes the shareware version of Crystal Caves. To play the full, retail version, you can copy over the data files or purchase them at Steam or GoG.

Current state of OCC:

Animation

Level 4

Main Level

Currently the engine can:

  • Load sprite, item and level data.
  • Play through a few levels.
  • Some enemies, hazards and items.

Features that are missing:

  • Loading and saving games.
  • Some items.
  • Some enemies.
  • (and much more).

Differences with Crystal Caves

OCC aims to be a better, modern remake of Crystal Caves while preserving the same gameplay experience. Therefore there are some changes and improvements made where they make sense. Below is a list of differences:

Feature Crystal Caves OpenCrystalCaves
BBS menu item Image "Call our BBS" menu item which shows BBS phone numbers Image "Visit our Website" which opens the browser to the OCC game page
Earth and moon orbits Image Earth and Moon move at constant speed Image Earth and Moon move in a circular arc
Enemy and hazard detection Image Detection can go through walls Image Detection is blocked by walls
Head bump momentum Image Horizontal momentum is lost when player bumps their head Image Horizontal momentum is preserved when player bumps their head
Instructions Image Sequential, text-only instructions Image Added inline icons showing what game objects look like
Laser position Image Laser is fired slightly below the muzzle Image Laser is aligned with the muzzle
Moving platform animation Image Animation is the same regardless of direction Image Animation reverses so that monitor follows background
Question mark spin animation Image Animation repeats and skips some frames Image Animation shows fully rotating question mark
Quit To OS menu label Image Quit to DOS Image Quit to OS depending on build
Restarting levels Menu > Quit Current Game > Main Level, re-enter level Menu > Restart
Transitions Image Fade by palette color Image Fade to black
Hammer crush Image Getting hurt normally by hammers Image Getting crushed by hammers
Candle pickup sound No sound Same sound as other similar pickups (shovel, pickaxe)
Snoozer roll animation Image Third frame has slight Y offset Image No irregular Y offsets
Flame on/off animation Image Transition in but not out Image Transition both in and out
Lights off Image EGA palette swapped Image Option to use blue monochrome dark palette
Level complete indicator Image Green overscan (invisible in dosbox) Image Flashing green screen border
Red mushroom Image Timer in status bar Image Player pulses red
Stopped enemies Image Stopped bar Image Stopped and blinking red
Falling rocks Image Can spawn outside danger area Image Only spawns in danger area
Stopped platforms Image Animated Image Not animated
Slime and egg positions Image Strictly aligned with tile grid Image Dynamic position based on parent
Enemy destructible shots Image Stops shooting if shot goes off screen Image Keeps shooting

Compiling OCC

OCC is built using C++20 and requires external libraries: SDL 2.0, and SDL_mixer. SDL2 must be installed and available in /usr/include/SDL2. Additionally the build system cmake must be installed.

Steps to compile (Linux, macOS):

git clone --recursive https://github.com/gurka/OpenCrystalCaves.git
cd OpenCrystalCaves
mkdir -p debug
cmake -Bdebug -DCMAKE_BUILD_TYPE=debug occ
cd debug
make

The binary will be available at OpenCrystalCaves/debug/build/occ

Or in Windows (with vcpkg):

# In vcpkg dir
./vcpkg install --triplet x64-windows sdl2 sdl2-mixer --recurse
# In your projects dir
git clone --recursive https://github.com/gurka/OpenCrystalCaves.git
cd OpenCrystalCaves
cmake -Bbuild -DCMAKE_TOOLCHAIN_FILE=C:/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake occ -A x64

The Visual Studio project will be available at OpenCrystalCaves/build

Running OCC

OCC includes the shareware episode for convenience, but for the other episodes requires data files from the original Crystal Caves (any episode). Either install it via Steam or GoG, or copy the game data to the media folder in the occ package (such as CC1.GFX).