Last week we talked about some of the
software packages that make Linux suitable as an office or home
document processing system. I promised that this week we'd look
at the fun side of a Linux-based computer system...games!
Games have always come with Linux. Little
diversions like the text-based hangman or Tetris clones under X
have been UNIX standards for years. Even Solitaire has a home
with Linux. But what if your tastes are a little more
sophisticated? After all, you can play some extremely complex
and graphically stunning games on a Windows computer.
I think that even the most die hard Linux
enthusiasts must admit that there has been a real lack of
"serious" games for this operating system. Most games
for Linux have come as an afterthought, following the
development of a Windows counterpart. But this trend is
changing.
The latest offering for Linux gamers is
Civilization: Call to Power. Although the game was originally
developed with Windows users in mind, a parallel effort involved
two other companies, Loki Entertainment and MacSoft, for their
ports to Linux and Macintosh. The end result was that the game
was released almost simultaneously for all three platforms.
Other popular games that run on Linux
include Doom (and its descendents) and the Quake series.
What does it take to play games on Linux?
The operating system was not designed with the single-user
concept of game playing in mind. Ordinarily, much of the
graphics performance of a Windows-based game is achieved through
proprietary programming API's, such as DirectX. Fortunately,
there is an alternative for Linux users.
Anyone who has used a 3DFX Voodoo card
should be familiar with their Glide drivers. Glide is a subset
of the OpenGL graphics standard for high performance graphics
rendering. While Glide is not freely available for Linux, a
clone is. The Mesa drivers support the 3DFX cards, making first
person action games like Quake and Doom as playable, or even
faster than on a comperable Windows system.
For those games, such as Civilization, that
don't require the kind of graphics horsepower of a reality-based
game, X marks the spot. The graphics drivers for X Windows are
more than sufficient for these kinds of games, and since the
drivers are open source, that is, freely available in source
code form, it is easy for programmers to adapt their games to
operate under Linux.
Another problem in the past has been sound.
Great games offer great sounds, but sound cards could be a
nightmare to configure under Linux, especially with the advent
of plug and play cards. But thanks to aggressive development by
all of the Linux programmers around the world, it's a problem no
more. Most popular sound cards are supported by the Linux kernel
itself, including the latest PCI devices. A simple recompile is
usually all that it takes to enjoy audio from your Linux system.
So how do you become a small-time Linux
game guru? First, you need to know what kind of hardware is in
your computer. Linux is harder to configure for multimedia
applications. You need to be able to tell the computer what
hardware is installed. While this may appear to be an inelegant
way to create a powerful game-playing computer, you may actually
gain more control over your computer's peripherals by using
device-specific drivers and commands to tweak that last little
bit of performance from its components.
My advice to you is this: Make a list of
what is in your computer. Write down names and model numbers.
Include I/O, DMA and interrupt settings if you can. And before
you purchase a new piece of hardware, make sure that it is
compatible with Linux. Check the manufacturer's web site or look
on the packaging...more and more companies are advertising Linux
support than ever before. And because high peformance PC
components are dropping in price, more and more equipment is
finding its way into the Linux world.
Next, look at the games that you want to
play. If you want to play action games like Quake, you should
see if there are OpenGL-type drivers available for your video
system. The latest addition to the OpenGL/Glide/Mesa community
is NVidia. Their TNT, TNT2 and Riva128 chipsets now have drivers
to provide excellent video rendering for action games. These
chipsets are found in newer video cards from Diamond, STB,
Matrox and others.
Make sure that you are using the optimal
display resolution and color depth. With X, your eye is your
best guide for display resolution, and you'll find that most
games are designed with 16 bit color in mind. In fact, at least
one game, Civilization, demands it. If you configure your
computer with 24 or 32 bit color, it will take a tremendous
performance hit as the video subsystem converts the higher color
depth back to 16 bit color on the fly.
Does your system participate on a network?
Remember, Linux, like other UNIX operating systems was designed
for multiple, simultaneous users. That means that if you're not
the only person using that computer, your game's performance may
suffer. Also, look at the background processes that you are
running. If you're trying to be the one to crack the latest RC5
code, or searching for intelligent life in the universe with
setiathome, turn those programs off before you become a space
marine.
These tips should help you on your way to
becoming a hot hand at games with Linux. You can explore further
at these web sites:
Linux Games: http://www.linuxgames.com
Mesa: http://www.mesa3d.org
3DFX HOWTO: http://metalab.unc.edu/LDP/HOWTO/3Dfx-HOWTO.html
Nvidia: http://www.nvidia.com/Products.nsf/htmlmedia/software_
drivers.html
Quake I/II/III: http://www.idsoftware.com
Civilization: http://www.lokisoft.com
The hot tip of the week!
How fast is your hard drive performance
under Linux? Kenn Humborg at TuneLinux.com suggests that you can
see a throughput improvement of up to two times by changing some
settings on your IDE controller system. Depending upon your
system's configuration, you may need to be root.
First, to get an idea of how fast your
drives are performing, try this command:
/sbin/hdparm -t /dev/hda (or hdb, etc.,
depending upon your configuration.)
Once you've got an idea of your drive's
transfer rate, change the controller's configuration to use 32
bit I/O:
/sbin/hdparm -c 1 /dev/hda (or hdb, etc.,
depending upon your configuration.)
Test the drive's performance again.
Next, enable DMA transfers:
/sbin/hdparm -d 1 /dev/hda (or hdb, etc.,
depending upon your configuration.)
Do a final performance test.
On a Pentium 166 system with 96MB of RAM
and a Fujitsu 4.3GB hard drive, my transfer rates zoomed from
about 3.6MB/second to over 10MB/second...and the performance
boost was readily apparent!
That's it for this week. Next week, we'll
spend time talking about Linux and the Internet. Remember, if
you've got a question or a topic that you'd like to see
addressed in the Linux Letter, send it to LinuxLetter@nospin.org.
Happy Computing!
Drew Dunn