Upcoming Events
Southwest Gaming Expo
11/20 - 11/22 @ Dallas, TX

Workshop on Network and Systems Support for Games (NetGames 2009)
11/23 - 11/25 @ Paris, France

ICIDS 2009 Interactive Storytelling
12/9 - 12/11 @ Guimarães, Portugal

Global Game Jam
1/29 - 1/31  

More events...


Quick Stats
6682 people currently visiting GDNet.
2341 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!



Link to us

Link to us

  Intel sponsors gamedev.net search:   

Linux Game Development Part 1
Introduction


Getting Started with Linux

The first thing you need to do is find a Linux distribution that you can start working with. There are literally hundreds of Linux distributions available to choose from, so I would recommend starting with one of these:

Ubuntu and Kubuntu are freely available and can be easily downloaded online, if you have a high-speed Internet connection. Both are easy to learn and use, have excellent online documentation, and are arguably the most popular Linux distributions currently available. Ubuntu uses GNOME for its desktop environment, but I prefer KDE so I use Kubuntu.

The advantage of selecting SUSE is that you can find a boxed version of it in some computer stores, complete with install disks and documentation. This is great for beginners, and also for people with dialup connections who don’t have the option of downloading large CD images from the Internet. Incidentally, there is also a free version you can download online called OpenSUSE, which is also easy to learn and use.

Developer Tools

So let’s assume you have selected a Linux distribution, downloaded and installed it, and spent some time learning how to use it. You’ve got it configured the way you want, you’ve installed the applications you need, and you’ve had a chance to get comfortable with it. Now you’re ready to start porting your game to Linux. What development tools are available?

Before I answer that question, I need to caveat my answer. I am a C/C++ programmer, so I can only list the development tools I know about. I know there are other tools available for Java developers, but you won’t find those listed here because I don’t know anything about them. But I’m sure you can find them yourself with Google.

With that said, here are some of the Linux development tools that I recommend.

Code::Blocks
This is a decent open source, cross-platform C/C++ IDE. As a long-time user of Visual Studio, I found Code::Blocks to be very intuitive. I was able to start using it almost immediately. I highly recommend this over KDevelop or any of the other common IDEs available in Linux.

Mono
Mono, sponsored by Novell, provides the necessary software to run .NET client and server applications on Linux and other non-Windows operating systems. If you are a .NET or C# game programmer, then this is the site for you. You’ll find everything you need to get started, including compilers, debuggers, an IDE, runtime libraries, and plenty of documentation.

Valgrind
Valgrind provides an excellent set of tools for debugging and profiling Linux programs. It’s great for detecting memory errors and leaks, threading issues, performance bottlenecks, and so on.

NEdit
Until I found Code::Blocks, I did not use an IDE on Linux because all the ones I tried were horrible. Instead I used this handy little code editor. It’s a powerful tool that’s perfect for those developers who don’t like using an IDE.

Kate
This is another good code editor. This one is KDE-based.

Make
For those developers who don’t use an IDE, you should use the make utility to build your program. You can find an excellent tutorial on how to write a Makefile at http://www.eng.hawaii.edu/Tutor/Make. Until I found Code::Blocks, this is how I compiled and linked my programs on Linux.

Data Display Debugger (DDD)
For those developers who don’t use an IDE, you’ll need a good debugger. DDD is the debugger I have used in the past. It’s fairly easy to use, and it gets the job done.

The GIMP
GIMP is the GNU Image Manipulation Program. It is a powerful program that’s great for doing game artwork.

SoniK
SoniK is a powerful KDE-based audio editor, similar to Creative Wave Studio by Creative Labs. You can record, edit, and process audio files with it. It is, of course, KDE-based. For some bizarre reason, every KDE application seems to have a K in its name…

Crossover Linux
Formerly known as Crossover Office, this affordable commercial package allows you to run a lot of Windows programs on Linux, including MS Office, MS Project, Visio, Quicken, iTunes, and more. I’ve also been able to successfully run a number of officially unsupported applications, including Corel PhotoPaint 8 and FeedForAll. In my opinion, this is a must-have program for anyone who wants to use Linux but can’t leave behind their business-critical Windows software.

Enterprise Architect
I know most game developers don’t do object-oriented software designs using the Unified Modeling Language (UML), but I do. I’ve used UML for many years, first in my full-time software development jobs and now for game design. UML is a great tool for designing user interaction, data models, and reusable game classes. Enterprise Architect is a powerful yet affordable UML modeling package that runs on Windows or Linux (via Crossover Linux).

Umbrello
Umbrello is a pretty good open source UML modeling tool that I’ve used in the past. It’s not as powerful as Enterprise Architect, but for a free tool, it does a good job.

There are also a ton of other useful applications: web browsers like Firefox and Opera, e-mail clients like Thunderbird and Kmail, PDF viewers, screen capture utilities, Palm Pilot tools, FTP clients, BitTorrent clients, instant messengers, and so many others that I can’t list them all here. They’re all good applications, and the best part is they’re all free!

Cross-platform Game Libraries

If you’re going to develop a game that will run on multiple platforms (not just Windows), then you’ll need to use a set of cross-platform libraries. You cannot use the Win32 API, MFC, DirectX, or any other Windows-specific code; if you do, you must completely rewrite your game to run on other platforms. So here are the more common cross-platform libraries that you can use.

Boost
Boost is a set of general-purpose, cross-platform libraries for file system access, memory management, data structures, mathematical operations, and more. The main boost library I use is the file system library for creating, querying, and manipulating files and directories.

FreeImage
The FreeImage library provides loading and saving of popular image formats in a cross-platform way.

Ogg Vorbis
Ogg Vorbis provides a completely open, patent-free, audio encoding and streaming library, and is a great alternative to MP3. It is a great compressed file format for professional game music.

OpenAL
OpenAL is a 3D audio API. It models sound sources moving in 3D space that are heard by a single listener in that space. It can also be used for simple 2D games.

OpenGL
OpenGL is, of course, the 3D graphics API of choice for cross-platform games. Both NVidia and ATI provide hardware-accelerated Linux drivers for their cards, and Intel has recently open sourced the graphics drivers for some of their onboard chipsets, so there is excellent support for 3D graphics on Linux.

SDL
SDL is an easy-to-use game library that provides low-level access to audio, keyboard, mouse, joystick, and video (using a built-in 2D graphics API or 3D graphics via OpenGL). There are also a number of open source libraries built on top of SDL that provide audio mixing, threading, font rendering, GUI toolkits, and more. SDL is primarily a C library, but has bindings to C#, Java, and others.

For those who would rather use an existing game engine, there are plenty of cross-platform game engines available, including Torque, Irrlicht, OGRE 3D, Crystal Space, and others.

Summary

Hopefully, the information I’ve presented here along with all of the URLs will be enough to get you started with Linux. There’s a lot of information here for you to look through, so I’ll leave you to explore for now.

Next time, we’ll look at how to build a distributable binary that will run on almost any Linux distribution. Until then!


Contents
  Introduction
  Getting Started with Linux

  Printable version
  Discuss this article

The Series
  Part 1: Introduction
  Part 2: Distributable Binaries
  Part 3: Installers
  Part 4: Testing
  Part 5: Marketing and Distribution