This project is my attempt to remake Betrayal at Krondor using OpenGL. It started out as a fun project to learn about graphics programming, but to be honest, I've spent the vast majority of the time reverse engineering and reimplementing the game mechanics instead! The game is mostly playable (with many rough edges), excluding combat. Improving the graphics will probably land at the end of the roadmap at this point as matching as close as possible the original game behaviour is much more addictive.
This project would not have been possible without Guido De Jong's original work on xbak (http://xbak.sourceforge.net/).
I have used the late Eysteinn Björnsson's wonderful BaK Help Web extensively as a reference. This website is currently hosted at https://dimwood.net/krondor.html by vga256.
You will need a copy of Betrayal at Krondor for the game data files. These can be found on the web pretty easily.
Requires CMake, SDL2, SDL_MixerX, OpenGL, GLFW, and glm. Most of these dependencies will be downloaded and built automatically.
I use some features of C++23, so a more recent gcc or clang will be required to compile the code. You can check the CI to see what versions I am currently using.
This project uses cmake. It can be built easily with
mkdir build; cd build;
cmake ..
make
The relevant binaries will be placed in your build directory.
Alternatively you can build on Windows by opening the project in Visual Studio.
You may need to manually download some of the dependencies (freeglut, glew, and SDL2) and modify the CMakeLists.txt to point to them.
Due to Apple's deprecation of OpenGL Mac is not currently supported. It may work on earlier versions, I've had some success using brew to install dependencies.
BaKGL needs to find a number of different files in order to run with the games original data. These are searched for in the bak main directory.
On UNIX systems this will be $HOME/bak
, under Windows it will be %APPDATA%\bak
. I will hereafter refer to this directory as $BAK_MAIN_DIR
for both platforms.
In order to play around with the project you will need the original game data files.
You will specifically need the following files from your game:
krondor.001
krondor.rmf
frp.sx
startup.gam
BaKGL will look in either the current directory from which you ran the executable, or $BAK_MAIN_DIR/data
for the game data files, so please copy them to the appropriate folder.
Make sure you check the case of the filenames in the folder where you installed BaK, if they are capitalised you will need to rename or copy them to lowercase.
Save files will be searched for in the $BAK_MAIN_DIR/saves/GAMES
directory, you can copy your old saves directory to this location.
OpenGL shaders are searched for in a specific set of directories
$HOME/shaders
$HOME/.shaders
$BAK_MAIN_DIR/shaders
Either copy the shaders to this directory, or (better) create a symbolic link to point to the shaders directory of the repo.
ln -sf BakGL/shaders $BAK_MAIN_DIR/shaders
The main application is "main3d". You can run this in the terminal in linux, or select it as the target in Visual Studio.
$ main3d
Start a new game from the main menu as normal, and enjoy :)