Linux Gaming


A number of games come as part of the Ubuntu distribution, and they are divided into three distinct camps: KDE games, GNOME games, and X games. Our favorites are Planet Penguin Racer and Torc (see Figure 13.1), but there are a few others for you to choose from. The best part, of course, is trying each one and seeing what you think. Many other free games are available across the Web, so go to Google and see what you come up with.

Figure 13.1. Sliding around corners in the high-speed Torc.


However, games for Linux do not stop therea few versions of popular Windows-based games are being ported across to the Linux platform, including DOOM 3, Unreal Tournament 2004, and Quake 4. These three popular games have native Linux support and in some cases can run at similar, if not better, speeds than their Windows counterparts. There's even an emulator available that enables you to play classic adventure games natively under Linux.

Finally, an implementation of the Wine code, formerly called WineX but now called Cedega, is optimized especially for games. This uses application interfaces to make Windows games believe they are running on a Windows platform and not a Linux platform. Bear in mind that Wine stands for wine is not an emulator, so do not start thinking of it as suchthe community can get quite touchy about it!

A major gripe of Linux users has been the difficulty involved in getting modern 3D graphics cards to work. Thankfully, both ATI and Nvidia support Linux, albeit by using closed-source drivers. This means that Ubuntu does not ship with native 3D drivers for either graphics card. It is fairly easy to get a hold of these drivers and install them using either synaptic or apt.

Installing Proprietary Video Drivers

Ubuntu does not provide the official Nvidia or ATI display drivers because they are closed source and Ubuntu is committed to delivering a totally free (as in speech) distribution. The latest official drivers can be downloaded from http://www.nvidia.com/object/linux.html or from http://www.ati.com/. If you encounter problems with the Nvidia drivers in particular, check out http://www.nvnews.net/vbulletin/forumdisplay.php?f=14 for more help. The Nvidia staff do contribute to that forum, so you should be able to find expert help when you need it.

Bear in mind that if you go down the "official" route, there will be certain steps that you have to take.

A much easier way to is to install either the Nvidia or ATI driver using synaptic or apt. Whichever way you choose, you need to have the Multiverse repositories available because both of these are proprietary extensions. For Nvidia, you need to look for the nvidia-glx package; ATI uses the xorg-driver-fglrx package.

If you have installed the nvidia-glx package, you need to run the nvidia-xconfig to activate the driver in your xorg.conf file, as follows:

$ sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf-backup $ sudo nvidia-xconfig 


After you have done this, log out of your session and back in again, which forces X to use the new xorg.conf and gives you a fully 3D enabled desktop.

If you went down the ATI route, you have a couple of extra steps to get through. The driver supplied with Ubuntu was developed by X.org, not ATI themselves. Although this driver should work in the majority of cases, you may need to download the official ATI drivers and do a bit of compiling to get them working.

First run these commands:

$ sudo apt-get update $ sudo apt-get install build-essential module-assistant\ fakeroor dh-make debconf libstdc++5 gcc-3.3-base 


These commands download the files that you will need to extract the correct packages from the official driver. Retrieve the driver from ATI and then execute the following commands to generate the package files ready for installation:

$ sudo chmod +x ati-driver-installer*.run $ ./ati-driver-installer-*.run --buildpkg Ubuntu/dapper 


After about a minute or so, the process should complete, and you should have a number of deb packages in your current directory. Install them using these commands:

$ sudo dpkg -i xorg-driver-fglrx_8*.deb $ sudo dpkg -i fglrx-kernel-source_8*.deb $ sudo dpkg -i fglrx-control_8*.deb 


Almost there! The next step is to build the kernel module to make everything work. Run the following commands:

$ sudo module-assistant prepare,update $ sudo module-assistant build,install fglrx $ sudo depmod -a 


The final step is to change a line in the xorg.conf file. First copy it to a safe place using the command cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup. Open the original as root in your favorite editor and look for the line in the Device section that starts with Driver. Change ati (the default entry) to fglrx and save it.

The last thing to do is to restart X by logging out and back in again, at which point you should now have the ATI drivers installed. You can check this by using the fglrxinfo command at a command line. You should see output similar to this:

$ fglrxinfo display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: RADEON 9600 XT Generic OpenGL version string: 2.0.5814 (8.25.18) 


Installing DOOM 3

The follow-up to the infamous DOOM and DOOM II was released in the second half of 2004 (see Figure 13.2), and it provides a way to run it under Linux. You still have to purchase the Windows version because you need some of the files that are on the CDs. The rest of the files are available from id Software at http://zerowing.idsoftware.com/linux/doom. You can find other information about graphics cards there, too.

Figure 13.2. Descending into the pits of hell. DOOM 3 is one of the most graphic computer games available.


You can download the file doom3-linux-*.run from the id Software FTP server or by using BitTorrent. When that's finished, open a terminal and change to the directory in which you saved the file. Type the following command:

# sh doom3-linux-*.run 


This begins the installation of the demo. As with other commercial games, you must agree to an EULA before you can install. Follow the installation procedure. When it finishes, you need to get the Windows CDs ready.

The files you need to copy across are the following:

  • pak000.pk4

  • pak001.pk4

  • pak002.pk4

  • pak003.pk4

  • pak004.pk4

They must be saved in the /usr/local/games/doom3/base/ directory. After you copy the files, you can start the game by typing doom3 or start the dedicated server for multiplayer games by typing doom3-dedicated.

Installing Unreal Tournament 2004

Unreal Tournament 2004 (or UT2004, as it is affectionately known) from Epic natively supports Linux in both its 32-bit and 64-bit incarnations (see Figure 13.3). Be aware that if you run the 64-bit version, you need to ensure that your graphics drivers are supported under 64-bit mode.

Figure 13.3. Unreal Tournament 2004 builds on the classic deathmatch scenario with more enemies and more combatants!


Installation is easy, and there are two ways to do it. You can insert the DVD and mount it, or you can open the DVD in GNOME and double-click the linux-installer.sh icon. When you are asked whether you want to run it or display its contents, click Run in Terminal to launch the graphical installer. As with DOOM 3, you must read and accept the terms of the EULA before you are allowed to install UT2004. You are given the option of where you want to install the software; the default is in your home directory. After you select the destination directory, click Begin Install; UT2004 does the rest.

The alternative way to access the graphical installer is via the command line. Change directory to /media/cdrom/ and type the following:

$ sh linux-install.sh 


This brings up the graphical installer. Continue through this and, when finished, you should find Unreal Tournament 2004 in /home/username/ut2004.

If you want to uninstall UT2004, you can use the uninstall script in the ut2004 directory. Type this:

$ sh uninstall.sh 


After confirmation, Unreal Tournament removes itself from your system.

Installing Quake 4

Being based on the DOOM 3 engine, you could almost expect Quake 4 (seen in Figure 13.4) to ship with a good deal of support for Linux. To get started, you must have the Windows version of the software because you need several files as well as the CD key to be able to play the game. First things first, though. Head on over to http://zerowing.idsoftware.com/linux/quake4/ to download the required Linux installer (quake4-linux-1.0*.run) by either direct FTP or the more bandwidth-friendly BitTorrent.

Figure 13.4. Based on the popular DOOM 3 engine, Quake 4 pits you against the evil Strogg. Get out there and frag 'em!


After you download the file, drop down to a command line and type the following:

$ sudo sh quake4-linux-1.0*.run 


Then press Enter. The installer starts up and asks you a couple questions. After you answer these, the installer creates the necessary files and folders. All you need to do is to copy several files from the /quake4/qbase directory on the DVD to /usr/local/bin/quake4/qbase. You can start the game by typing quake4 at a command prompt.

Installing Wolfenstein: Enemy Territory

Whereas the earlier Return to Castle Wolfenstein was both single- and multiplayer, the freely available Wolfenstein: Enemy Territory is multiplayer only (see Figure 13.5). Available in Win32 and Linux native versions, you can download it from http://www.SplashDamage.com/. After you download the 260MB file named et-linux-2.55.x86.run, install the game by typing the following:

# sh et-linux-2.55.x86.run 


Figure 13.5. Teamwork is the key to victory in this lush but hostile graphical environment.


Then accept the defaults. A symlink exists in /usr/local/bin to the script that loads the game.

Installing Battle for Wesnoth

Of course, there is more to Linux gaming than just first-person shooters. One of the most popular games currently available for Linux is Battle for Wesnoth (see Figure 13.6), a strategy game much in the vein of Age of Empires. Based in a fantasy land, you are responsible for building armies to wage war against your foes.

Figure 13.6. Flex your strategic brain by playing Battle for Wesnotha rich and full land of fantasy of adventure


Battle for Wesnoth is easy to install with Ubuntu. You need to select the wesnoth package using either synaptic or apt-get. When installed, you launch it from the command line by entering the following:

$ wesnoth 


Playing Windows Games with Cedega

As mentioned earlier, the key to mass-market appeal of an operating system is in the applications available for it. A group of developers saw that the vast majority of the computing world was using Windows-based productivity and gaming software and decided to develop a way to run this software on Linux, thereby giving Linux users access to this large application base. The developers came up with a program called Wine, which has been updated regularly and forms the basis of the gaming variant called Cedega. This is a commercial product available from developers TransGaming Technologies (http://www.transgaming.com/), so you cannot retrieve it using yum.

However, Cedega is a popular and up-to-date product with support for recent releases such as Half-Life 2, Sid Meier's Pirates!, and World of Warcraft. Because the state of Cedega is constantly changing, TransGaming Technologies has a subscription service, which means that you get updates for the code when they are releasedensuring that you are able to enjoy not only the games of today, but also those of tomorrow.

So, if you cannot wait for Linux to become more popular with game developers, use Cedega as a stop-gap until they can be persuaded to support Linux directly.

Tip

The keys to successful gaming in Linux are to always read the documentation thoroughly, always investigate the Internet resources thoroughly, and always understand your system. Installing games is a great way to learn about your system because the reward of success is so much fun.




Ubuntu Unleashed
Ubuntu Unleashed 2011 Edition: Covering 10.10 and 11.04 (6th Edition)
ISBN: 0672333449
EAN: 2147483647
Year: 2006
Pages: 318

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net