bookmark_borderCompiling Stratagus on Mac OS X (10.8.2)

I loved playing Warcraft 2. I played it on DOSBox recently, but the fact that 640×480 is just plain ugly on my MPB these days made me look for alternatives.

And so I found Stratagus and Wargus.

With Stratagus as engine, Wargus as “MOD” and with the original Warcraft 2 CD you can re-live Warcraft 2 again on your machine.

On Windows you should be able to install this without any problems, installers are provided and these work just fine. However, on a Mac you might be in some hassle to get this working. In fact, there is no official support as none of the authors run a Mac. Basically this means people with Macs had to figure out how to do this. After some time of googling I got Stratagus compiling and working with a Wargus game I already created on Windows.

Fortunately someone at github already made a version that should work on Mac OS X. Combined with a tutorial I found elsewhere I got it to compile. I can play Wargus now on my Mac!

For completeness sake I have combined the steps I have taken (and also forked Stratagus) so you can use that version. Don’t credit me for making Stratagus compile on the Mac though, as I did not make the nescesary changes in the makefile or code.

Install Xcode (from App store) & Install command line tools from Xcode

in Xcode, go to preferences, tab "Downloads" -> " Components" -> Command Line Tools
  • – The command line tools should have installed git and svn for you, try them out:
hit "svn --version", and "git --version" in your terminal.
If they are not installed, you could install them via homebrew (brew install git && brew install svn) (after you installed Homebrew of course)

Install homebrew

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go

Installing required dependencies

I have installed the following dependencies with homebrew like this:

brew install cmake libogg libvorbis theora libpng zlib libmikmod sqlite3 doxygen

Compile and build tolua

Go to your projects dir

git clone https://github.com/LuaDist/toluapp.git

cd toluapp

cmake -G "Unix Makefiles"

make && sudo make install

Git clone stratagus

Determine where you want to checkout stratagus, ie in your ~/projects, then:

git clone https://github.com/stefanhendriks/stratagus

Compile it

cd stratagus
mkdir build
cd build
cmake -G "Unix Makefiles" ..
make

Now you should be able to run a stratagus game. Since I already created Wargus by using Windows, I copied this over to my mac (and put it in ~/projects/Wargus). Then I ran stratagus as:

./stratagus -d ~/projects/wargus/

A known issue I have is that on startup the screen looks as if it is drawing with a weird offset (ie too much out of screen at the upper left). By simply changing resolution this goes away. Don’t know why yet, but since we have the code now and we can compile, we might as well try to fix it some day! 🙂

Personally I’d like to see a better AI for wargus, especially since I like to play Skirmish games.

I hope this guide helped you get it to work on your mac. Please share your experiences in the comments section.