Welcome to selectparks

Mail Form
Artist Ts

art mods
art games
location based games
political games
open source games
mobile games
browser games
sex games
performance instruments
digital imaging

standalone games
mods HL Q3A UT03 UTO4
mobile Games J2ME

free engine database
tech books
tutorials and support

email lists

delicious RSS


tech: Game development on Linux: A Primer.
Posted on Friday, March 25 @ 00:30:00 CET by julian

I'm regularly asked about game development on the Linux platform, so here I'm taking the time to give both a light outline and a starting point for those interested. This isn't geared toward hardened developers already working on the Linux platform, but more for new users of Linux - or even those just curious. Some may find this article to be biased, and they'd be right.

The last few years have seen Linux grow exponentially as a complete desktop replacement for proprietary platforms like those sold by Microsoft and Apple. Once a platform for hackers and computer scientists, servers and mainframes, Linux is now widely adopted as a powerful multimedia workstation and consumer desktop; considered to be the fastest growing desktop operating system in circulation today.

While the benefits of running Linux are usually along the lines of portability (it runs on just about anything), security and performance, little is said about it's unique offerings as a game development platform.

Here's an inexhaustive, laymans outline of the things that will matter to a game developer..

Linux and Games:

One of the myths about Linux is that it's rubbish for games, a story inherited from it's adolescence as a rare and esoteric OS. There are however many proprietary games made natively for the Linux platform today, usual AAA suspects such as Doom3, UT2004, Neverwinter Nights, Quake3, RTCW and hundreds of interesting free and open-source games.

It's true, there are much fewer games made natively for Linux than Windows, though nearly any Windows game natively unavailable for Linux can be played using an emulation layer like Wine or Cedega (with varying degrees of performance).

These emulators are typically concerned with providing a means of playing games that are dependent on DirectX, Microsoft's proprietary game development API. Those addicted to a particular game not available on Linux using emulation sometimes keep a Windows or OSX partition, making their system 'dual boot'.


Linux game list
Linux Games

Along side Win32 emulation there are a vast variety of emulators for consoles and other platforms, like the Gameboy, Atari, Amiga, Super Nintendo etc. If you're into the arcade classics and developing/playing games of this kind here's a good place to start.

The predominant graphics library for 3D games on a Linux system is not Microsoft's DirectX, but SGI's powerful, flexible and extensible OpenGL. As with any OS, if you want to get the best out of OpenGL dependent software you need a card that supports it. The two most common used by gamers being ATI and NVIDIA.

I often get asked about the driver support for these cards in Linux. Here's the lowdown.

Both ATI and NVIDIA ship proprietary drivers for Linux, the latter a little more consistently than the former.

Disney, Weta and many other feature-film production companies rely heavily on Linux heavily for 3D animation/SFX work and for whatever reason NVIDIA has their contracts. For this reason NVIDIA pour alot of work into ensuring their drivers work extremely well on the platform. While ATI drivers perform very well (as of recently at least), the regularity of releases lags a bit behind that of NVIDIA because of the companies obligation with the film industry. The open-source alternatives for both the NVIDIA and ATI cards are shipped with any popular distribution of Linux and can be used if desired.

While both cards heavily exploit the feature set of the OpenGL specification, it is only with the proprietary drivers that these features are fully available to the user. A typical example of something not available to those using the open-source implementation of these drivers are 'shaders', or advanced texture processing heavily reliant on the Graphical Processing Unit. For most purposes however, these open-source drivers are perfectly suitable for game play and development.

PC as Game Console:

An exciting recent development in the world of Linux is that of the 'LiveCD' phenomenon. A LiveCD Linux distribution is a kind of Linux that runs entirely from a CD or DVD, meaning that everything runs in memory and is not installed to disk. LiveCD's are relatively easy to reconfigure for special purposes - a great deal of tools are available to to help the user bundle their software so that it can be distributed to users regardless of host operating system.

LiveCD Linux versions now exist for PowerPC, AMD(64) and Intel architectures. This offers the game developer an interesting opportunity; they can make a game and ship it as a CD or DVD, allowing players to boot up into the game without needing to download or install a single file. Joystick, mouse and keyboard support can be preconfigured, all unrelated software removed, and a fully GUI, animated, menu-system can be built so that the player interfaces exclusively with the game as opposed to a desktop menu. Two projects that recently emerged target this functionality directly: Game Knoppix and LLG

To make a LiveCD Linux distribution of your game that booted straight into a game menu, you might create a startup scripts in '/etc/init.d/' and remove others that invoke unwanted processes.



Desktop Environments:

Every desktop Linux system also has a default GUI, but two are by far the most predominant: KDE (K Desktop Environment) and Gnome. Both are what's called 'integrated desktop environments', meaning they have a whole array of typical services like wireless network switching, word-processing, language and keyboard layout configuration etc. KDE and Gnome are 'point-and-click' interfaces; meaning for everyday use there is no need to use a command line interface (though learning to use the CLI will add to your productivity) . While being very intuitive to use, KDE and Gnome are also highly configurable.

A themed Gnome desktop.

A themed KDE desktop.

Both KDE and Gnome are very mature and accomplished projects, largely different only in look and feel. There are a great deal of other desktop environments available to the Linux user, some of which can be chosen for the few resources they demand from the system. I for instance use WMI as I work in the terminal alot - I have it set up like this.

Both Windows and OSX can be demanding on the graphics card even during day to day use; sometimes when you really want the most from your system, a light 'window manager' like WMI or Fluxbox will help squeeze out more frames per second from your system.

Installing software.

Every Linux distribution uses what's called 'package management' to install, track, source and uninstall software. While it's possible to compile software from source-code, this is no longer necessary in the day-to-day use of a modern Linux system.

However any game developer will either want to compile code at some point or even distribute their own work so it can be compiled by others.

Every Linux system comes with the free compiler 'gcc' (Gnu C Compiler), the tool needed to turn clear-text C(++) code into an executable binary file. gcc can be evoked from from the command line, a script, or using free, powerful Integrated Development Environments like KDevelop, Vim or Emacs.

VisualC users especially will find KDevelop to be a highly intuitive replacement for VC6/7 while those that prefer a more customiseable tool will be highly productive in Vim or Emacs (I for instance prefer VIM as my primary IDE).

KDevelop in action

There are many excellent build systems for Linux, namely 'automake' and 'scons'. Because gcc can be evoked from the command line, there is often no need to use a heavy IDE like KDevelop to compile a project. The user can often simply:

./configure; make; make install

Which will configure, compile and install the project in question.

For everyday use however software is downloaded as a convenient 'package'. Software is most commonly packaged by the distribution maintainers, like Novell Suse Linux, Redhat's Fedora, Mandrake, Debian (to cite the most popular) and is hosted on their servers (and mirrors) so that the user doesn't need to hunt down software from websites or ftp repositories to install it. There are two predominant package types, '*.deb' and '*.rpm' for the Debian and Redhat based distributions respectively.

All modern distributions of Linux have both GUI and CLI front-ends for installing these packages: like KPackage, Synaptic, apt and rpm.

A screenshot of kpackage on a Redhat Linux machine.

Games (and software) made for Linux will sometimes also come on a CD, or will be distributed as a 'shell script' (a script that when executed from the console resources UNIX applications in the completion of it's task). Sometimes this shell script resources data from the install CD of a Windows game to install the game in Linux. This method is used to install NeverWinterNights and Doom3 for instance. A shell script is executed with ./script (if it's executable) or sh script

Why I use Debian:

I've spent alot of time surveying and using Linux distributions and from experience the Debian way of managing packages (using apt, with or without a front-end) is by far the most convenient. Installation of software (and their dependent software libraries) is transparently handled yet without the need for too much user input.

Managing and upgrading a Debian system takes very little time in comparison to that of operating systems like OSX or Windows where new software must be individually acquired when a new version is released. Conflicts between software packages are practically non-existent on a Debian system due to it's advanced version management system.

From the command line a query for software relating to a keyword can be given with apt-cache search keyword, summarised with apt-cache show packagename and installed from a nearby server with apt-get install packagename. All this can also be done from either Synaptic or KPackage, meaning the user doesn't need to search websites, install from CD's or find alternative means of acquiring software they can't or don't want to pay for. Package management on a Debian system is a beautiful thing..

There are about 8500 packages maintained in the Debian project, many of which relate to game development. Most countries in the world have a local Debian mirror, from where software can be automatically resourced.

Most importantly however, Debian based Linux systems can be completely upgraded with an apt-get update (retrieve the latest package list) and apt-get dist-upgrade. Similarly this can be evoked from a GUI like KPackage. This in itself is rare for operating systems, all software on board is upgraded where necessary (not just the base system itself as with a Service Pack or similar).

Debian itself however is not built primarily as a Desktop distribution of Linux; it powers robots, embedded devices, submarines and webservers and so requires some experience to install for Desktop/Workstation use.

The best Linux distribution for game development?

Recently several desktop-focussed Debian-based distributions have become extremely popular, one of which is very suited to game development.

Simply Mepis

Mepis can be run from a LiveCD, a kind of try-before-you-buy arrangement, and then installed to disk if it suits. The LiveCD loads drivers for all the devices it can (everything on my test machines) and then starts up the Desktop Environment. From here installation of Mepis is done entirely from the running LiveCD and from a GUI. It takes about 15 minutes depending on the speed of the machine generally. Mepis uses KDE as it's default desktop environment.

You have about 10 important questions to answer (username, administrator (or 'root') password, install partition) and an HTML manual to assist if required. The questions asked are no more complex than that of a WinXP install; in fact it's arguably easier.

Anyway, all this still doesn't answer why Mepis is great for game development..

Mepis is focussed on getting the best out of the user's existing system for multimedia use. The Advanced Linux Sound Architecture system is used by default, meaning sound can be 'jacked' into and out of supporting applications using the Jack Connection Kit.

The Adobe Photoshop competitor Gimp is already onboard, a powerful texture editor with many fancy scripts and image processing tools. The excellent sound-editor Audacity is also in the multimedia menu ready for use to develop sound effects and mix down compositions. Digital cameras interface with the system using Digikam and digital video is captured from a DV device using Kino.

For more KDE applications see KDE Apps.

Arguably parts of Mepis are 'non free': things like proprietary drivers and codecs that are shipped with the operating system. 'Non-free' translates as, "It doesn't cost but because the source isn't available, the software isn't 'Free'". The Windows emulation software that allows people to install Microsoft software (Dreamweaver, Word, Photoshop etc) is on board also - though rarely do people find a need to use this with replacements like Quanta, Open Office, Gimp being available already.

Mozilla-firefox is already on board, equipped with the flash-plugin ready for viewing flash sites. Also extremely useful in game development is Python, a powerful object oriented scripting language widely deployed in games. Just pull up a terminal (like Konsole) and type 'python' to access the interpreter.

One annoyance with some distributions of Linux for the new user is video playback - largely due to distributions not wishing to ship non-free video codecs. Mepis however, in it's prioritisation of the end-user's experience, ships these codecs ready to use; there is no video format I can't play out-of-the-box with Mepis and on the four unique machines I've tested on, there is no driver that wasn't already installed and setup.

For the game developer/gamer wanting to get the best out of their system Mepis will automagically install the ATI or NVIDIA drivers if you have such cards, complete with their respective configuration tools allowing access to features like 'clone mode'. Every other graphics card will work - if a driver isn't found the default Linux graphics driver 'vesa' will be used. Regardless, unlike a Windows system, the user doesn't need to hunt down drivers for these cards, but can simply get down to business immediately after install.

Mepis Linux has an interesting collaborative tool onboard called Desktop Sharing. Desktop Sharing allows a Mepis user to 'share' his/her desktop with another KDE user, for remote collaboration. As Mepis uses the KDE system it's already setup to install KDevelop so that it benefits from full desktop KDE integration. If you choose to install code libraries and tools make sure you also install the documentation which will then be available via your browser in the '/usr/share/doc' directory.

A screenshot of the standard Mepis desktop.

And here are a few screenshots of Mepis during first boot.

To try out Mepis (without installing anything) simply download an ISO image from this page. burn it as a ISO disk image, and reboot into it.

Mepis community/support:

Mepis Lovers.org

Some extra software I find very useful:


B.CompSci in a box:

Linux itself offers a veritable education in computer science, as such it could be regarded as a platform for learning about computers and computing itself. Because Linux is built on open-standards and a licensing model that encourages sharing, all source code for every component of a Linux system is transparent to the user or developer. If at any point the user of a Linux system wishes to better understand any given software (from an IRC client, desktop menu bar to 3D graphics software), they can browse the source, read documentation and even manipulate the code. In the worst case, this can lead to an insatiable compulsion for tweaking and refinement; in any case, the curious will learn a huge amount about how software works in general.

Game Engines for use in Linux :

There are a great number of engines available for the Linux user, many of which can be installed using the package manager. A cursory list of good engines to look at is here.

The modification of existing engines (like Doom3 or UT2004) is a good start for those new to game development generally, though just because a Mod can be built from an Software Development Kit and freely distributed, doesn't mean it's somehow open-source however (a common mistake).

Why Linux is good for Indie Game Development:

Linux is by nature and by politic built on an open development model. Open source software is a symptom, not a cause of this; documented, transparent code is widely distributed toward the ends of increasing interoperability with other operating systems and architectures. If you want to know how something works you can read about it. If you want to make something work better/differently, you're legally allowed to do so.

For this reason work made using tools native to the Linux platform is predisposed toward portability; any component (like a code library for instance) will be licensed for distribution and ready to port to another platform; in many cases they will be already. Work made in Linux can then be taken to another platform and compiled much more easily that it can when using proprietary API's and toolkits; ie without reverse engineering and extensive re-writing. Examples of open source software used widely in game development are DevIL, PNG, OpenGL, OpenAL, SDL, Python, TCP/IP, SVG, Cal3D. Best of all, these quality materials for game development are free.

The open-standards, open-source development model is opposed to Windows API's like DirectX which seek to corner game development on Windows by encouraging dependence on their OS specific tools. If you make a game using DirectX you'll have a hard time getting it to run on a Mac. If you make a game using OpenGL/OpenAL for instance, it will be much much easier to port. Companies like idSoftware recognise the benefits of using open standards in their development roadmaps, and so have been able to release for several platforms simultaneously.

Because of a commitment to open standards Linux runs on just about anything: phones, PDA's, satellites, robots, Apple Powerbooks and iPods. However the vast predominance of x86 (or Intel) processors means that Linux on this architecture of processor is extremely well tested and thus performs very well. Any common desktop computer can be easily transformed into a pro-portability, game development workstation - code libraries, development tools and documentation all freely and legally available.

Independent game development can benefit greatly from a commitment to using open-source tools and code; when work is predisposed toward being shared and critiqued, the knowledge capital of independent game development is nourished independent of monopolies over the means of production. By this I mean things like IP licenses, patents, rarefied and expensive proprietary tools, closed source API's and platform dependent projects - all things that ultimately position the small development team at the whim of vendor lock-in, forced upgrade cycles and the insuing fragmentation of IP and development rights across restrictive third-party licenses.

For this reason, one of the real comforts of developing on a free Linux system is that the software you're using is licensed in such a way as to encourage the sharing of information, for the ultimate and positively selfish benefit of improving the quality of the software itself.

Most software shipping in a Linux distribution falls under the copyright license The General Public License or GPL. This license states that you're welcome to use, manipulate and dsitribute the software as long as the copyright is kept intact, the source code is kept open and the GPL license is shipped with that source-code.

While you're always welcome to install non-GPL or proprietary software (like Maya , or Main Actor ), you can be sure that the software already on board is legally safe to use in your own project as long as you stick to the rules outlined in the GPL. Many commercial game development studios already use open source libraries in their projects (Valve, Id, Atari, Blizzard), and the more that do improve the quality, extensibility and interoperability of the software when it's re-distributed under obligation to the terms of the GPL.

Related Links
· More about Geek
· News by julian

Most read story about Geek:
Game development on Linux: A Primer.

Associated Topics


Sorry, Comments are not available for this article.

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all posts themselves belong to their respective owners.

You can syndicate our news using the file Photoshop CS6 keygen or SEO Blog
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.08 Seconds