Hello,
I have prepared
Compilation instructions fpr Penumbra: Overture on Ubuntu 12.04 32 bit.
Note that game still has issues with graphics on this OS (or may be it's just on my VirtualBox VM): shader settings above "very low" are not usable, zooming in when interacting with objects is broken, but otherwise game is playable (at least a few first levels, I did not play beyond that).
First and foremost, Kudos to:
- JKO for excellent compilation guide for Windows, which was the base of this instructions (link to JKO's guide)
- Commit by jorgeas80 which mentions particular commit of OALWrapper compatible with HPL1
First and foremost, let's create a root folder for our work somewhere in home directory (in this example "OvertureSource"). Inside it we will checkout repositories. Ubuntu 12.04 uses newer compiler than used originally, so some fixes are required to fix compilation errors, so I suggest to pull my forks that already have required fixes.
mkdir OvertureSource
cd OvertureSource
git clone git://github.com/Kristian-Popov/HPL1Engine.git
git clone git://github.com/FrictionalGames/OALWrapper.git
git clone git://github.com/Kristian-Popov/PenumbraOverture.git
Now we have to rewind OALWrapper back:
cd OALWrapper
git checkout ae59c6d7bd476d4d5c7e4a6cd3323a48ed1a6c9c
cd ..
Precompiled versions of Angelscript and Newton can be found in the attached archive. Unlike original dependencies archive, this has dependencies only for Linux, also only two libraries left, for the rest we will be using system libraries. Note that packaged version of Angelscript is not original one, instead this was compiled by
g++ 4.5 (default one on this OS) and with AS_MAX_PORTABILITY option. This option means that code is not so dependent on compiler and good implementation of Angelscript (it was crashing at game start, probably because by default it messes with stack on low level). Instructions on how to compile Angelscript are below.
Download archive and unpack it to "dependencies" folder.
Now copy assets from your Penumbra: Overture folder to "redist" folder. I tried running game using assets from Windows and Linux versions, it worked in both cases, so I don't think it matters. You need to copy not only subfolders, but also files "materials.cfg" and "resources.cfg".
Now it's time to install a lot of packages:
sudo apt-get install libalut-dev libopenal-dev libvorbis-dev libsdl1.2-dev libsdl-image1.2-dev libogg-dev libpng-dev nvidia-cg-toolkit glee-dev libtinyxml-dev mesa-common-dev libglu1-mesa-dev libgl-dev libgl1-mesa-dev libgl-dev libgles1-mesa-dev g++ cmake
This list includes most of used third-party libraries, gcc C++ compiler and CMake.
Let's compile!
mkdir PenumbraOverture-build
cd PenumbraOverture-build
cmake ../PenumbraOverture .
make
Optionally you can compile a few jobs in parallel, although I don't have any particular recommendations for number of jobs run simultaneously. You can try value N = <number of processor cores in system> - 1
If everything went well, let's copy executable go to "redist" folder and run the game.
cp overture.bin ../redist/
cd ../redist/
./overture.bin
Logs and settings are stored at "~/.frictionalgames/Penumbra/Overture". Settings file is quite readable, so don't be too afraid to edit it manually.
Note that list of problems remains, you can check
my other post for details.
Compilation instructions for Angelscript
We will be compiling version 2.7.1b, same as used with original release of Penumbra: Overture.
You can download all releases at
Angelscript download page
After downloading unpack archive and go to "angelscript/projects/gnuc" subfolder, here you will find "makefile". Open it with any text editor and find a line "CXXFLAGS = -g -Wall".
Comment it (in case you want to go back to original compilation flags) and add a new line like this:
# CXXFLAGS = -g -Wall
CXXFLAGS = -g -Wall -DAS_MAX_PORTABILITY
Now start compilation by running "make" in the same folder.
Compiled library ("libangelscript.a") can be found at "<Angelscript root>/angelscript/lib". Copy it to "dependencies" subfolder.
Final file structure of "OvertureSource" folder should look like this:
OvertureSource
dependencies
include
angelscript.h
Newton.h
lib
linux
libangelscript.a
libNewton.a
HPL1Engine (many files and folders inside)
OALWrapper (many files and folders inside)
PenumbraOverture (many files and folders inside)
redist
materials.cfg
resources.cfg
...
PenumbraOverture-build (build folder)
I hope this material was useful.
I may edit this post in future to improve or fix errors.