Differences between revisions 6 and 7
Revision 6 as of 2009-04-23 07:19:58
Size: 19648
Editor: jdd
Comment:
Revision 7 as of 2009-04-23 07:20:27
Size: 23095
Editor: jdd
Comment:
Deletions are marked like this. Additions are marked like this.
Line 193: Line 193:
A program can only use the special hardware accelerated features of these cards by using the Glide2 library in one of two ways:

  * directly written using Glide2 (Myth II, Descent III)
  * indirectly using Mesa built with a Glide2 backend to simulate OpenGL (Rune, Unreal Tournament)

3dfx opened up the specifications and source code to the open source community. This allowed Daryll Strauss to port Glide2 to Linux which enabled XFree86 3.x users to use Voodoo I, II and III cards under Linux.

Since Glide2 accesses the video card directly, Glide2 applications will either need to be run by root or be setuid root. A way around this was to create the kernel 3dfx module. This module (and its device file `/dev/3dfx`) allows Glide2 graphical hardware acceleration for non-root users of non-setuid applications.

Unfortunately, Glide2 is also a dead issue. It's only used for Voodoo I, II, III boards (which are becoming outdated), under XFree86 3.x (most people use XFree86 4.x). And since 3dfx is now a defunct company, it's a sure bet that no more work will be done on Glide2 and no more games will be written using Glide2.

----

== 3.2. What is Glide3? ==

Unlike Glide2, Glide3 is not an API used for game programming. It exists only to support DRI on Voodoo III, IV and V boards under XFree86 4.x. None of the games which use Glide2 will work with Glide3. This shouldn't be a surprise since Glide2 and Glide3 support different video cards and different versions of XFree86. The only video card that can use both Glide2 (under XFree86 3.x) and Glide3 (under XFree86 4.x) is the Voodoo III. It's reported that a Voodoo III using Glide2 will outperform a Voodoo III using Glide3.

When you use a Voodoo III, IV or V under XFree86 4.x, you want to use a version of Mesa (see [[#MESA|Section 3.4]]) which was compiled to use Glide3 as a backend to ensure hardware accelerated OpenGL on your system.

----

== 3.3. What is OpenGL? ==

OpenGL is a high level graphics programming API originally developed by SGI, and it became an industry standard for 2D and 3D graphics programming. It's defined and maintained by the Architectural Revision Board (ARB), an organization which include representatives from SGI, IBM, DEC, and Microsoft. OpenGL provides a powerful, complete and generic feature set for 2D and 3D graphics operations.

There are 3 canonical parts to OpenGL:

  * GL: The OpenGL core calls
  * GLU: The utility calls
  * GLUT: OS independent window event (mouse, keyboard, etc.) handler.

OpenGL is not only an API, it's also an implementation, written by SGI. The implementation tries to use hardware acceleration for various graphics operations whenever available, which depends on what videocard you have in you computer. If hardware acceleration is not possible for a specific task, OpenGL falls back on software rendering. This means that when you get OpenGL from SGI, if you want any kind of hardware acceleration at all, it must be OpenGL written and compiled specifically for some graphics card. Otherwise, all you'll get is software rendering. The same thing is true for OpenGL clones, like Mesa.

OpenGL is the open source equivalent to Direct3D, a component of DirectX ([[#DIRECTX|Section 3.14]]). The important difference being that since OpenGL is open (and DirectX is closed), games written in OpenGL are much easier to port to and co-develop on Linux than games written using Direct

Stable version to be found:

And other formats as well (may be) on the Stable HOWTOs page

If necessary use the Discussion page to give comments.

Discussion Page Content if any

The Linux Gamers' HOWTO

Peter Jay Salzman

Frédéric Delanoy

Copyright © 2001, 2002 Peter Jay Salzman

Copyright © 2003, 2004 Peter Jay Salzman, Frédéric Delanoy

2004-11-13 v.1.0.6

Abstract

The same questions get asked repeatedly on Linux related mailing lists and news groups. Many of them arise because people don't know as much as they should about how things "work" on Linux, at least, as far as games go. Gaming can be a tough pursuit; it requires knowledge from an incredibly vast range of topics from compilers to libraries to system administration to networking to XFree86 administration ... you get the picture. Every aspect of your computer plays a role in gaming. It's a demanding topic, but this fact is shadowed by the primary goal of gaming: to have fun and blow off some steam.

This document is a stepping stone to get the most common problems resolved and to give people the knowledge to begin thinking intelligently about what is going on with their games. Just as with anything else on Linux, you need to know a little more about what's going on behind the scenes with your system to be able to keep your games healthy or to diagnose and fix them when they're not.

<[[mailto:p(at)dirac(dot)org|p(at)dirac(dot)org]]> / http://www.dirac.org/p.

Distributed subject to the Open Software License, ver 1.1


Table of Contents:: 1. Administra:: 1.1. Authorship and Copyright:: 1.2. Acknowledgements:: 1.3. Latest Versions and Translations::2. Definitions: Types Of Games:: 2.1. Arcade style:: 2.2. Card, logic and board games:: 2.3. Text Adventure (aka Interactive Fiction):: 2.4. Graphical Adventures:: 2.5. Simulation (aka Sims):: 2.6. Strategy (aka Strats):: 2.7. First Person Shooter (aka FPS):: 2.8. Side Scrollers:: 2.9. Third Person Shooters:: 2.10. Role Playing Game (aka RPG)::3. Libraries:: 3.1. What is Glide2?:: 3.2. What is Glide3?:: 3.3. What is OpenGL?:: 3.4. What is Mesa?:: 3.5. What is DRI?:: 3.6. What is GLX?:: 3.7. What is Utah GLX?:: 3.8. What is xlib?:: 3.9. What is a widget set?:: 3.10. What is SDL (Simple DirectMedia Layer)?:: 3.11. What is GGI?:: 3.12. What is SVGAlib? Frame buffer? Console?:: 3.13. What is OpenAL?:: 3.14. What is DirectX?:: 3.15. Clanlib::4. XFree86 and You:: 4.1. Getting information about your X system:: 4.2. Playing Games In X Without a Window Manager::5. Various Topics:: 5.1. Memory Type Range Registers:: 5.2. Milking performance from your system for all it's worth:: 5.3. About libraries on Linux::6. When Bad Things Happen To Good People:: 6.1. RTFM!:: 6.2. Look For Updates and Patches:: 6.3. Newsgroups:: 6.4. Google Group Search:: 6.5. Debugging: call traces and core files:: 6.6. Saved Games:: 6.7. What to do when a file or library isn't being found (better living through strace):: 6.8. Hosed consoles:: 6.9. Locked System::7. Video Cards:: 7.1. History:: 7.2. Current Status (1 March 2004):: 7.3. Which Video Card Should I Buy? (1 March 2004):: 7.4. Definitions: Video Card and 3D Terminology::8. Sound:: 8.1. Which sound card is best?:: 8.2. Why isn't my sound working?::9. Miscellaneous Problems:: 9.1. Hardware Acceleration Problems:: 9.2. Hardware acceleration works only for the root user::10. Emulation and Virtual Machines:: 10.1. What is a virtual machine?:: 10.2. Apple 8-bit:: 10.3. DOS:: 10.4. Win16:: 10.5. Win32::11. Interpreters:: 11.1. SCUMM Engine (LucasArts):: 11.2. AGI: Adventure Gaming Interface (Sierra):: 11.3. SCI: SCript Interpreter or Sierra Creative Interpreter (Sierra):: 11.4. Infocom Adventures (Infocom, Activision):: 11.5. Scott Adams Adventures (Adventure International):: 11.6. Ultima Underworld: The Stygian Abyss (Origin, Blue Sky Productions):: 11.7. Ultima 7 (Origin, Electronic Arts):: 11.8. System Shock (Electronic Arts, Origin)::12. Websites And Resources:: 12.1. Meta gaming websites:: 12.2. Commercial Linux Game Resources:: 12.3. Other Resources::

1. Administra

If you have ideas, corrections or questions relating to this HOWTO, please email me. By receiving feedback on this howto (even if I don't have the time to answer), you make me feel like I'm doing something useful. In turn, it motivates me to write more and add to this document. You can reach me at <[[mailto:p(at)dirac(dot)org|p(at)dirac(dot)org]]>. My web page is http://www.dirac.org/p and my Linux pages are at http://www.dirac.org/linux. Please do send comments and suggestions for this howto. Even if I don't take your suggestions, your input is graciously received.

I assume a working knowledge of Linux, so I use some topics like runlevels and modules without defining them. If there are enough questions (or even protests) I'll add more basic information to this document.


This document is copyright (c) 2001-2002 Peter Jay Salzman, <[[mailto:p(at)dirac(dot)org|p(at)dirac(dot)org]]>; 2003-2004 Peter Jay Salzman and Frédéric Delanoy. Permission is granted to copy, distribute and/or modify this document under the terms of the Open Software License, Version 1.1, except for the provisions I list in the next paragraph. I hate HOWTO's that include the license; it's a tree killer. You can read the OSL at http://opensource.org/licenses/osl-1.1.txt.

If you want to create a derivative work or publish this HOWTO for commercial purposes, I would appreciate it if you contact me first. This will give me a chance to give you the most recent version. I'd also appreciate either a copy of whatever it is you're doing or a spinach, garlic, mushroom, feta cheese and artichoke heart pizza.


1.2. Acknowledgements

Thanks goes out to these people for extensive comments, corrections, and diffs. Their effort is above and beyond the call of duty:

Frédéric Delanoy, Moritz Muehlenhoff <[[mailto:jmm(at)Informatik(dot)uni-bremen(dot)de|jmm(at)Informatik(dot)uni-bremen(dot)de]]>, Mike Phillips, Ioan Rogers <[[mailto:buck(at)aiur(dot)co(dot)uk|buck(at)aiur(dot)co(dot)uk]]>

I would also like to thank the following people for sending in comments and corrections. Without their help, there would be more typos and mistakes than you could shake a stick at:

Michael McDonnell


1.3. Latest Versions and Translations

The latest version can be found at http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/lgh/LG-HOWTO or http://www.dirac.org/linux/writing, but this is my own personal working copy. The version at my personal web site might be broken if I'm working on the HOWTO. The version at sourceforge is bleeding edge but guaranteed to be not broken, however it may have glitches, like unfinished paragraphs. :)

The most recent stable version can be found at http://www.tldp.org.


1.3.1. Russian

Dmitry Samoyloff <[[mailto:dsamoyloff(at)yandex(dot)ru|dsamoyloff(at)yandex(dot)ru]]> is the maintainer of the Russian translation. The most recent version can be found at http://www.dirac.org/linux/writing.


1.3.2. Hungarian

László Daczi <[[mailto:dacas(at)korhaz(dot)rethy(dot)hu|dacas(at)korhaz(dot)rethy(dot)hu]]>, the Hungarian LDP coordinator, announced that a Hungarian translation was produced by Szilard Ivan, and is available at http://tldp.fsf.hu/HOWTO/Linux-Gamers-HOWTO-hu.

- ---

2. Definitions: Types Of Games

Not everyone knows the different types of games that are out there, so in an effort to form a common language that we can all use, I'll run through each game type and provide a very brief history.


2.1. Arcade style

Although arcade games had their heydey in the 80's, they are nonetheless very popular. Nothing will ever replace walking into a dark, crowded and noisy arcade gallery, popping a quarter into your favorite machine and playing an old fashioned game of Space Invaders. Arcade style games attempt to simulate the arcade games themselves. There is such a vast number of these things that it's nearly impossible to enumerate them all, but they include clones of Asteroids, Space Invaders, Pac-Man, Missile Command and Galaxian.


2.2. Card, logic and board games

Computer based card games simulate a card game like poker or solitaire. The program can simulate your opponent(s).

Logic games usually simulate some well known logic puzzle like Master Mind or the game where you have put sliding numbered tiles in order inside a box.

Computer based board games simulate some kind of board game you'd play on a table top with friends, like monopoly, Mille Bourne, chess or checkers. The program can simulate your opponent.


2.3. Text Adventure (aka Interactive Fiction)

Once upon a time, when Apple ][, Commodore, and Atari ruled the world, text adventures were the game of choice of `intelligent folk'. You are given a scenario and can interact with the world you're placed in:

     You are in a room.  It is pitch dark and you're likely to be eaten by a grue.     > Light lantern with match.     You light the lantern.  This room appears to be a kitchen.  There's a table with a     book in the center.  You also see an oven, refrigerator and a door leading east.     > Open the oven.     In the oven you see a brown paper bag.     > Take the bag.  Open the bag.  Close the oven.     Inside the bag is a some garlic and a cheese sandwich.  The oven door is now closed. 

Back then, text adventures were self contained executables on a disk or casette. These days there's usually a data file and an interpreter. The interpreter reads data files and provides the gaming interface. The data files are the actual game itself, similar to the relationship between first person shooters (Section 2.7) and wad files.

The first adventure game was Adventure (actually “ADVENT”, written on a PDP-1 in 1972). You can play Adventure yourself (actually, a descendent); it comes with “bsd games” on most Linux distros. Text adventures became popularized by Scott Adams (Section 11.5) and reached their height of popularity in the late 80's with Infocom (Section 11.4) which are also playable under Linux.

As computer graphics became easier and more powerful, text adventures gave rise to graphic adventures. The death of commercial interactive fiction more or less coincided with the bankruptcy of Infocom.


2.4. Graphical Adventures

Graphical adventures are, at heart, text adventures on steroids. The degree to which they use graphics varies widely. Back in the 80's, they were little more than text adventures which showed a screen of static graphics. When you picked up an item, the background would be redrawn without the item appearing. The canonical example would be the so-called `Hi-Res Adventures' like The Wizard And The Princess. Later on, the sophisticated graphical adventures had your character roaming around the screen, and you could even use a mouse, but the interface remained purely text.

Next there are the `point and click adventures' which basically have no text interface at all, and often have dynamic graphics, like a cat wandering around the room while you're deciding what to do next. In these games, you point at an object (say, a book) and can choose from a pull-down list of functions. Kind of like object oriented adventuring. :) There aren't many graphical adventures written natively for Linux. The only one I can think of is Hopkins FBI (which happens to be my favorite game for Linux).


2.5. Simulation (aka Sims)

Simulations strive to immerse the player behind the controls of something they normally wouldn't have access to. This could be something real like a fighter jet or something imaginary like a mechanized warrior combat unit. In either case, sims strive for realism.

Some sims have little or no strategy. They simply put you in a cockpit to give you the thrill of piloting a plane. Some are considerably complex, and there's often a fine line between sims and strats (Section 2.6). A good example would be Heavy Gear III or Flight Gear. These days sims and strats are nearly indistinguishable, but a long time ago, sims were real time while strats were turn based. This is awkward for modern day use, since a game like Warcraft which everyone knows as a strat, would be a sim by definition.


2.6. Strategy (aka Strats)

Strategy games have their roots in old Avalon type board games like Panzer Leader and old war strategy games published by SSI. Generally, they simulate some kind of scenario. The scenario can be peaceful, like running a successful city (SimCity), or not, like illegal drug selling operation (DrugWars) or an all-out war strategy game like Myth II. The types of games usually take a long time to complete and require a lot of brainpower.

Strats can be further divided into two classes: real time and turn based. Real time strats are based on the concept of you-snooze-you-lose. For example, you're managing a city and a fire erupts somewhere. The more time it takes for you mobilize the fire fighters, the more damage the fire does. Turn based strats are more like chess---the computer takes a turn and then the player takes a turn.


2.7. First Person Shooter (aka FPS)

What light through yonder window breaks? It must be the flash of the double barreled shotgun! We have a long and twisted history with FPS games which started when id Software open sourced code for Doom. The code base has forked and merged numerous times. Other previously closed engines opened up, many engines are playable via emulators, many commercial FPS games were released for Linux and there are quite a number of FPS engines which started life as open source projects. Although you may not be able to play your favorite FPS under Linux (Half-Life plays great under winex) Linux definitely has no deficiency here!

First person shooters are characterized by two things. First, you pretty much blow up everything you see. Second, the action takes place in first person. That is, through the eyes of the character who's doing all the shooting. You may even see your hands or weapon at the bottom of the screen. They can be set in fantasy (Hexen), science fiction (Quake II), present day `real world' (Soldier Of Fortune) and many other settings.

Like text adventures, FPS fit the engine/datafile format. The engine refers to the actual game itself (Doom, Quake, Heretic2) and plays out the maps and bad guys outlined by the datafile (doom2.wad, pak0.pak, etc). Many FPS games allow people to write their own non-commercial datafile. There are hundreds, even thousands of non-commercial Doom datafiles that you can download for free off the net. Often, companies release their engines to the open source community so we can hack and improve them. However, the original data files are kept proprietary. To this day, you still have to purchase doom.wad.


2.8. Side Scrollers

Side scrollers are similar to FPS but you view your character as a 2D figure who runs around various screens shooting at things or performing tasks. Examples would be Abuse for Linux and the original Duke Nukem. They don't necessarily have to be violent, like xscavenger, a clone of the old 8-bit game Lode Runner.


2.9. Third Person Shooters

Similar to FPS, but you view your character in third person and in 3D. On modern third person shooters you can usually do some really kick-butt maneuvers like Jackie Chan style back flips and side rolls. The canonical example would be Tomb Raider. On the Linux platform, we have Heretic 2 and Heavy Metal FAKK2.


2.10. Role Playing Game (aka RPG)

Anyone who has played games like Dungeons & Dragons or Call of Cthulhu knows exactly what an RPG is. You play a character, sometimes more than one, characterized by traits (eg strength, dexterity), skills (eg explosives, basket weaving, mechanics) and properties (levels, cash). As you play, the character becomes more powerful and the game adjusts itself accordingly, so instead of fighting orcs, at high levels you start fighting black dragons. The rewards increase correspondingly. At low levels you might get some gold pieces as a reward for winning a battle. At high levels, you might get a magic sword or a kick-butt assault rifle.

RPG's generally have a quest with a well defined ending. In nethack you need to retrieve the amulet of Yendor for your god. In Ultima II, you destroy the evil sorceress Minax. At some point, your character becomes powerful enough that you can `go for it' and try to complete the quest.

While the insanely popular Ultima series, written by Richard Garriot (aka Lord British) for Origin, was not the first RPG, it popularized and propelled the RPG genre into mainstream. Ultima I was released in 1987 and was the game that launched 9 (depending on how you want to count them) very popular sequels, finishing with Ultima IX: Ascension. You can play Ultima VII under Linux with Exult (Section 11.7).

The canonical RPG on Linux is Rogue (the ncurses library started life as a screen handling routine for Rogue!) and it has infinite variants like Zangband and Nethack (which has many variants itself). Some RPG's are quite complicated and great feats of programming. There seems to be a deficiency of commercial RPGs for Linux. Not counting the rogue variants, there's also a deficiency of open source RPGs too.


3. Libraries

We'll run through the different gaming libraries you'll see under Linux.


3.1. What is Glide2?

Glide2 is a low level graphics API and driver that accesses 3D hardware accelerated functions on 3dfx's Voodoo I, II and III cards, under XFree86 3.x. A program can only use the special hardware accelerated features of these cards by using the Glide2 library in one of two ways:

  • directly written using Glide2 (Myth II, Descent III)
  • indirectly using Mesa built with a Glide2 backend to simulate OpenGL (Rune, Unreal Tournament)

3dfx opened up the specifications and source code to the open source community. This allowed Daryll Strauss to port Glide2 to Linux which enabled XFree86 3.x users to use Voodoo I, II and III cards under Linux.

Since Glide2 accesses the video card directly, Glide2 applications will either need to be run by root or be setuid root. A way around this was to create the kernel 3dfx module. This module (and its device file /dev/3dfx) allows Glide2 graphical hardware acceleration for non-root users of non-setuid applications.

Unfortunately, Glide2 is also a dead issue. It's only used for Voodoo I, II, III boards (which are becoming outdated), under XFree86 3.x (most people use XFree86 4.x). And since 3dfx is now a defunct company, it's a sure bet that no more work will be done on Glide2 and no more games will be written using Glide2.


3.2. What is Glide3?

Unlike Glide2, Glide3 is not an API used for game programming. It exists only to support DRI on Voodoo III, IV and V boards under XFree86 4.x. None of the games which use Glide2 will work with Glide3. This shouldn't be a surprise since Glide2 and Glide3 support different video cards and different versions of XFree86. The only video card that can use both Glide2 (under XFree86 3.x) and Glide3 (under XFree86 4.x) is the Voodoo III. It's reported that a Voodoo III using Glide2 will outperform a Voodoo III using Glide3.

When you use a Voodoo III, IV or V under XFree86 4.x, you want to use a version of Mesa (see Section 3.4) which was compiled to use Glide3 as a backend to ensure hardware accelerated OpenGL on your system.


3.3. What is OpenGL?

OpenGL is a high level graphics programming API originally developed by SGI, and it became an industry standard for 2D and 3D graphics programming. It's defined and maintained by the Architectural Revision Board (ARB), an organization which include representatives from SGI, IBM, DEC, and Microsoft. OpenGL provides a powerful, complete and generic feature set for 2D and 3D graphics operations.

There are 3 canonical parts to OpenGL:

  • GL: The OpenGL core calls
  • GLU: The utility calls
  • GLUT: OS independent window event (mouse, keyboard, etc.) handler.

OpenGL is not only an API, it's also an implementation, written by SGI. The implementation tries to use hardware acceleration for various graphics operations whenever available, which depends on what videocard you have in you computer. If hardware acceleration is not possible for a specific task, OpenGL falls back on software rendering. This means that when you get OpenGL from SGI, if you want any kind of hardware acceleration at all, it must be OpenGL written and compiled specifically for some graphics card. Otherwise, all you'll get is software rendering. The same thing is true for OpenGL clones, like Mesa.

OpenGL is the open source equivalent to Direct3D, a component of DirectX (Section 3.14). The important difference being that since OpenGL is open (and DirectX is closed), games written in OpenGL are much easier to port to and co-develop on Linux than games written using Direct

Linux-Gamers-HOWTO (last edited 2009-04-23 08:39:40 by jdd)