2007-09-11

Frets on fire

Today one friend told me that he downloaded a great game called Frets on fire, but I asked him "it works just in windows, isn't it?, because I just have Linux (kubuntu)", but he told me it was available for Windows, OSX and Linux, so I tried to install it.

So I downloaded the Linux file from here and like always, I had some problems trying to run the game. My first try was just running the game just like this

cgware@gris:~/FretsOnFire$ ./FretsOnFire

and I got this message

Traceback (most recent call last):
  File "/home/skyostil/src/cx_Freeze-3.0.3/initscripts/Console.py", line 27, in ?
  File "src/FretsOnFire.py", line 64, in ?
  File "src/GameEngine.py", line 155, in __init__
  File "src/Video.py", line 68, in setMode
pygame.error: Couldn't find matching GLX visual

I thought it was strange, because I already had installed the nvidia-glx package for my nVidia Corporation Quadro NVS 110M / GeForce Go 7300 and glxgears does actually work. If you are not sure of want kind of graphic card you have, just type

cgware@gris:~/FretsOnFire$ lspci | grep VGA

... now I continue with the explanation. I read in a forum (I don't remeber which one of the many I have visited) that the problem was that you have to avoid the antialiasing... and how to do that? One way to do this is to edit/create the file fretsonfire.ini with this lines in it

[video]
fullscreen = False
multisamples = 0
fontscale = 1.0
fps = 50
resolution = 640x480

I think antialiasing has to do with the multisamples parameter. Once I had modified/created that file, I tried to run the game once...

cgware@gris:~/FretsOnFire$ ./FretsOnFire
Traceback (most recent call last):
  File "/home/skyostil/src/cx_Freeze-3.0.3/initscripts/Console.py", line 27, in ?
  File "src/FretsOnFire.py", line 64, in ?
  File "src/GameEngine.py", line 155, in __init__
  File "src/Video.py", line 61, in setMode
pygame.error: Couldn't find matching GLX visual

...and I got the same... now back to the forums. In another forum I found that there is a verbose mode for Frets on fire so I tried that in order to know what happened

cgware@gris:~/FretsOnFire$ ./FretsOnFire -v
(D) Initializing audio.
(D) Audio configuration: (44100, -16, 1)
(D) Initializing video.
(E) Video setup failed. Make sure your graphics 
    card supports 32 bit display modes.
Traceback (most recent call last):
  File "/home/skyostil/src/cx_Freeze-3.0.3/initscripts/Console.py", line 27, in ?
  File "src/FretsOnFire.py", line 64, in ?
  File "src/GameEngine.py", line 155, in __init__
  File "src/Video.py", line 61, in setMode
pygame.error: Couldn't find matching GLX visual

with this information I figured out that the problem has to do with the number of colors in my screen configuration. Actually Linux 24bit colors is the same as Windows 32bit colors (true color), because to the linux 24bit color should be added 8bit alpha. Now, how can I know how many bit colors am I using? and how to modify that?. The answer is the file xorg.conf, located in /etc/X11. In the Screen section of this file you can find the parameter DefaultDepth which in my case was set to 16, that means 16bit colors, so now I should change that line to 24

Section "Screen"
    Identifier     "Default Screen"
    Device         "nVidia Corporation G72M [Quadro NVS 110M/GeForce Go 7300]"
    Monitor        "Monitor genérico"
    DefaultDepth    24

Now, in order to apply the changes I should restart X (if you don't know how to do that, just restart Linux or your PC). Once you have restarted X or whatever, just rerun the game

cgware@gris:~/FretsOnFire$ ./FretsOnFire

...and that's all :), I hope this will be useful. Saludos

No hay comentarios: