A few weeks ago I took a couple days to update Bridge Construction Set and provide 64-bit binaries for the Linux version.
First off let me say that I am not Linux expert. I have used Linux here and there and even setup a Linux web server but I often feel like a novice user. However I am a big supporter of multi-platform games, supporting free operating systems and supporting alternatives to Windows. With this in mind I try to bring as many of our games to Linux as possible.
First I had to setup a system to compile the 64-bit versions of Bridge Construction Set. I actually setup two systems, a 64-bit system and a 32-bit system as I discovered it is not easy to build a 32-bit binary on a 64-bit system. I choose to use Ubuntu Linux and was very happy with my choice. It was very very easy to install and everything worked right the first time, at least with the 64-bit system. On the 32-bit system I used the Windows installer for Ubuntu which is fantastic. It actually installs Ubuntu in Windows and uses free space from Windows for the install. This means no partitioning your hard drive, no messing with boot managers and no having to boot off a CD to install. It was great except that I accidentally installed the 64-bit version when I wanted the 32-bit. See the installer download the files for you and it auto-detected the system as being 64-bit and download the 64-bit version of Ubuntu. So I had to uninstall, which was actually extremely easy because it was installed as a Windows program (add/remove programs uninstalled it in a few seconds). Then I run the windows installer again with the correct parameter to install the 32-bit version. This worked and everything was ready except the video drivers did not have hardware support for OpenGL. This makes Bridge Construction Set run very slow. In my experience it is standard for a new install not include the correct drivers. It took a bit of work and research to get this working which is not uncommon. I tried using the built in tools from Ubuntu to activate the latest drivers from Nvidia but that failed to fix to install hardware support for OpenGL. I ended up having to edit a config file with some information I found on a forum. It worked though and everything was setup and working!
It was actually extremely easy to build the binaries for Bridge Construction Set. Using GCC it just took a single command and a couple of second to create the binaries. Had to do this on both systems but I had both the 32 and 64 bit versions done in no time.
One part of Linux distribution that I still am not sure about is what to do about libraries. BCS uses OpenAL for sound and this needs to be on your system or BCS will not run. I understand there are a couple of ways of doing this. With BCS I choose to dynamically link to the libraries. Meaning I do not include the libraries with the game, and people will need to download and install them. The other option is statically link to the libraries. To do this I would include the actual library file with the game and use a script to launch the binary that tells it to load the library from the included file. Which of these ways is better? I think there are some advantages and disadvantages to both. I really don’t know which is the best. Maybe an Linux expert could shed some light on the subject.
To make testing the two versions (64 and 32 bit) easier I decided to get the 32-bit version to run on my 64-bit installation. This is actually not very difficult. The only challenge is that the 32-bit version wants to see 32-bit versions of all the libraries it uses. By using the command “ldd” I was able to see which libraries BCS was not able to find. I then downloaded and installed the 32-bit versions of them. Once I did this I was able to run both versions on my 64-bit instillation. With both versions working I packaged them up and uploaded them for customers to download. I hope everyone enjoys them.
Ubuntu was really nice to install and use. I now have a better understanding of where Ubuntu keeps all the libraries and Bridge Construction Set is now available as a 64-bit binary for Linux. If you are still reading this you must be really bored or really interested in Linux