| Linux Game Development Part 1 | |
|
Linux Game Development Part 1
Finding information about how to develop and publish games for Linux is difficult. There aren’t many articles or tutorials written about it, and there is no centralized web site you can go to find all the answers. It took me a long time to find all the information I needed to finish the Linux version of Dirk Dashing: Secret Agent and publish it. So I’ve decided to write a series of articles to capture everything I have learned. I hope these articles will be useful to other developers who want to port their games to Linux. By the way, the information in these articles can apply to other commercial applications besides games, so if you’re not a game developer, that’s ok. You’ll still be able to use a lot of the information that is here. Here is the outline for this series, so that you can see where we’re going.
Before I begin, I would just like to acknowledge several key individuals who helped me find all of this information: Ilya Olevsky, Gianfranco Berardi, and Gerry Jo Jellestad. You guys rock! What is Linux?For those of you who may not know, Linux is a free operating system originally created by Linus Torvalds and developed with the assistance of programmers around the world. It is an alternative to other operating systems like Windows. It is tremendously stable, very reliable, and much more secure than Windows. Linux also offers several different file systems, like ReiserFS and XFS, which are noticeably faster than FAT32 or NTFS on Windows. You can find a set of free, introductory tutorials about Linux at http://www.linux.org/lessons. If you’re new to Linux, I recommend starting here. Why Develop for Linux?Linux usage has been steadily growing over the past few years, according to several independent research firms, including IDC and eMarketer. Many Windows users are getting tired of adware, spyware, viruses, unsecure software, and security patches that break their computers. A growing number of users are slowly starting to look for alternative operating systems. In addition, I think Windows Vista will drive even more users to alternative operating systems, due to its high cost, massive hardware requirements, and invasive anti-piracy features. The two leading alternative operating systems are Mac OS and Linux. Mac OS has several advantages over Linux: it is better known, there is Mac software readily available in some computer stores, and Mac OS comes preinstalled (on Mac hardware). The problem with Mac, however, is two-fold: first, Mac computers are generally more expensive than PCs, and second, they are not easy to purchase. For example, the computer store near me had a wide selection of Mac computers on the floor, but none in stock - they had to special order it, which meant I had to wait for it. From the testimonials I’ve read online, my experience was not an isolated one. Issues like this won’t help Mac become a more mainstream OS. Linux, on the other hand, is freely available and can be installed on the user’s existing computer hardware. As a traditional Windows user who has recently looked at both Linux and Mac for the first time, I personally found Linux much easier to learn than Mac. The K Desktop Environment (KDE) that many distributions use is similar to the Windows desktop, which makes it fairly easy to transition to Linux. There are plenty of applications available for Linux, with more applications being released each year. The only kind of software that isn’t widely available for Linux are games, and many analysts I’ve read feel that the lack of games is what is preventing a wider adoption of Linux among home users. If more home users do indeed migrate to alternative operating systems, then game developers are going to need to know how to write games for Mac and Linux. There are plenty of resources available for Mac development, but hardly any for Linux. That’s why I’m writing these articles. Getting Started with LinuxThe 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 ToolsSo 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 Mono Valgrind NEdit Kate Make Data Display Debugger (DDD) The GIMP SoniK Crossover Linux Enterprise Architect Umbrello 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 LibrariesIf 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 FreeImage Ogg Vorbis OpenAL OpenGL SDL 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. SummaryHopefully, 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! Part 2: Distributable Binaries Discuss this article in the forums
See Also: © 1999-2008 Gamedev.net. All rights reserved. Terms of Use Privacy Policy
|