Linux Game Development Part 4
Testing
Hardware Accelerated Video DriversFor OpenGL-based Linux games, the end user will need to have a video card that supports OpenGL and have the 3D accelerated driver installed for it. Both NVidia and ATI provide accelerated drivers for Linux, and you can usually install them through the package manager of your Linux distribution. One of the things I quickly discovered is that performance is not as good on a laptop as a desktop machine. You probably knew that already, but I didn’t. My laptop happens to be quite a powerhouse, so I never noticed any performance issues with it. But a number of laptop users had problems with Dirk Dashing. The lesson I learned was that I should have provided a fallback mechanism to allow users on older laptops and slower machines to disable the OpenGL and use SDL rendering instead. Another thing I discovered was that sometimes the default installation settings for the accelerated drivers will do weird things to your game performance. Different distributions use different default settings, so your game performance will vary depending on whether the system is set to sync with the vertical retrace, or whether anti-aliasing or other high-performance OpenGL settings are enabled by default. In my case, I have a computer system with swappable hard drives. I set up one drive with SUSE 10, which I used to develop Dirk Dashing, and the game ran great. I then installed another distribution on a different hard drive, put the game on it, and the game performance was horrible. I couldn’t figure out why - it was the exact same machine, just running a different Linux distribution on a different hard drive. After cruising Google for a while, I found a way to check the OpenGL settings of the graphics card, and I discovered that the default settings on the two distributions were different. The problem is that the Control Panel and System Settings windows provided by most distributions do not provide you with a way to control these settings. You can usually control the resolution and the monitor refresh rate, but that’s about it. Fortunately, both NVidia and ATI provide utilities to help. NVidia provides a handy configuration utility called nvidia-settings, which is usually installed along with the driver. A few distributions give you a menu entry for this utility, but most do not, so it has to be started from the command line. It brings up a professional-looking window that lets you change all kinds of settings. ATI provides a similar utility called aticonfig, which is also installed along with the driver. I’ve never used this tool, because all of my video cards are NVidia cards, but from what I’ve read, I believe aticonfig is a command-line tool only. I’m not sure how many Linux users know about these utilities, so if performance seems to be an issue with your OpenGL game, the first thing you should do is point them to these utilities.
|