View Full Version : Playing games with compiz?
amgeex
December 14th, 2006, 10:20 PM
I've spent the last hour trying to get enemy territory to run under compiz, but all I get is a white screen and broken X, so I decided to write a little script to run games. It will set metacity as the window manager, wait a little and then run enemy territory. So far it has worked out for me. Just thought someone might find it useful. :wink:
#!/bin/bash
# Small script that sets metacity as the window manager
# and then executes enemy territory. For use with Compiz.
metacity --replace &
sleep 5
et
twigsby
December 14th, 2006, 10:46 PM
I made a little something like that for ut2004...
#!/bin/sh
#
# ut2004 startup script
/usr/bin/metacity --replace &
/media/hda5/ut2004/ut2004
Now if only it could be made to restart compiz when the game is closed...
watkin5
December 14th, 2006, 11:01 PM
Now if only it could be made to restart compiz when the game is closed...
I'm guessing but...
#!/bin/sh
#
# ut2004 startup script
/usr/bin/metacity --replace &
/media/hda5/ut2004/ut2004 ; compiz --replace gconf &
amgeex
December 15th, 2006, 12:12 AM
That would restart it right after executing the ut2004 command. I'll see into it... maybe we can check if the game process is running, if it is not, then we can run compiz. Hum, sounds like a plan, but I guess its not that easy...
mikedee
December 15th, 2006, 12:15 AM
#!/bin/sh
#
# ut2004 startup script
/usr/bin/metacity --replace &
/media/hda5/ut2004/ut2004 && compiz --replace gconf &
This code will wait for the game to return before starting compiz
delphinen
December 15th, 2006, 01:20 AM
somewhat related, I can play Lineage 2 on Wine with Compiz running (sadly I cant use XGL if I want to do this)
http://img248.imageshack.us/img248/8125/screen12bs4.png
twigsby
December 15th, 2006, 01:40 AM
...
This code will wait for the game to return before starting compiz
That works birlliantly, thanks!
amgeex
December 15th, 2006, 03:10 AM
My current script to run Enemy Territory:
#!/bin/bash
# Small script that sets metacity as the window manager
# and then executes enemy territory. For use with Compiz.
metacity --replace &
sleep 5
et && go-compiz
Works perfectly! Thanks mikedee!! :D
nesnomis
December 15th, 2006, 09:27 PM
Another approach when running openGL games could be:
export LD_PRELOAD=/usr/lib/libGL.so; ./ut2004
Not sure about Nvidia, but works nice with fglrx.... :) ...
/nesnomis
amgeex
December 16th, 2006, 12:35 AM
export LD_PRELOAD=/usr/lib/libGL.so; ./ut2004 What does this exactly do? You know, to expand my knowledge! :oops:
nesnomis
December 16th, 2006, 09:38 AM
export LD_PRELOAD=/usr/lib/libGL.so; ./ut2004 What does this exactly do? You know, to expand my knowledge! :oops:
I guess this is only an issue with ATI cards and fglrx!?
LD_PRELOAD is an eviromental variable where you can put information about a function or shared library. When running Compiz, Xgl some games cant find the right libGL so, by using it with LD_PRELOAD you make sure the game finds the right library and understands that there is hardware acceleration.... :)
Well i am not an expert so... i wont get any deeper into this :)
nesnomis
December 16th, 2006, 09:52 AM
export LD_PRELOAD=/usr/lib/libGL.so; ./ut2004 What does this exactly do? You know, to expand my knowledge! :oops:
I guess this is only an issue with ATI cards and fglrx!?
LD_PRELOAD is an eviromental variable where you can put information about a function or shared library. When running Compiz, Xgl some games cant find the right libGL so, by using it with LD_PRELOAD you make sure the game finds the right library and understands that there is hardware acceleration.... :)
Well i am not an expert so... i wont get any deeper into this :)
I have to correct myself, if you have ATI and fglrx, the above script in combination with 'export LD_PRELOAD=/usr/lib/libGL.so; ./ut2004' works perfectly... :) ...
amgeex
December 16th, 2006, 04:39 PM
Oh, now I understand. So that means that if I use the LD_PRELOAD method I don't have to restore metacity? :D
mikedee
December 16th, 2006, 06:28 PM
This command should probably be used instead
LD_PRELOAD=/usr/lib/libGL.so ./ut2004
The difference is that your command exports the variable which means that it will be set for all other applications that you start in that terminal after ut2004 is finished. You might not want this to be used for other apps so it is generally safer to not use the export command.
amgeex
December 22nd, 2006, 07:29 PM
I updated to Compiz 0.3.5 today, and so I figured my game script wouldn't work anymore because I'm now using Gnome Compiz Manager. Well, I just updated the script too, here it is:
#!/bin/bash
# Small script that sets metacity as the window manager
# and then executes enemy territory. For use with Compiz.
gconftool-2 -s /apps/gnome-compiz-preferences/enable_gl_desktop "False" --type=bool &&
sleep 2
et &&
gconftool-2 -s /apps/gnome-compiz-preferences/enable_gl_desktop "True" --type=bool
amgeex
January 10th, 2007, 03:22 AM
Is it me, or the latest packages on gandalfn's repositories just made my games lag like hell? :cry:
This is not good! The previous version (1:0.3.6-0gandalfn5 I think) was working alright. The packages I'm talking about are these ones:
compiz version 1:0.3.6-0gandalfn7
compiz-core version 1:0.3.6-0gandalfn7
compiz-gnome version 1:0.3.6-0gandalfn7
compiz-plugins version 1:0.3.6-0gandalfn7
gnome-compiz-manager 0.10.2-0gandalfn3
libgnome-compiz-manager 0.10.2-0gandalfn3
Maybe its those patches he's putting in? :?
amgeex
June 17th, 2007, 10:13 PM
Ok, I'm bringing back to life this thread because I still cannot play Enemy Territory decently with Compiz 0.5 enabled... I tried using my old scripts, but the game still lags. Anyone has a solution?
Thanks in advance,
amgeex
Matias
June 18th, 2007, 02:46 AM
I haven't got problems with games at all using feisty's "desktop effects" (bah compiz).
But maybe I'm used to some clippiness.
amgeex
June 18th, 2007, 03:07 AM
I'm using compiz 0.5... desktop effects sucks! Anayway, Enemy Territory runs... not good, it stutters a lot, and its laggy. :?
Matias
June 18th, 2007, 05:05 AM
desktop effects does sucks in comparison with 0.5 but i'm lazy to get it. I think, maybe I'm wrong, it is too much unstable by now.
Whats your average opinion about the version?. despite plugins, i'm just asking for performance.
amgeex
June 18th, 2007, 05:30 AM
I'm using it without any extra plugins, just the core ones and it does feel smoother, and works really good. The only gripe I've got is that to compile it from source is a pain in the ass, but its doable... Anyway, ANYONE GOT A SOLUTION TO THE FRIGGIN' GAME PROBLEM? Sorry, didn't want to shout, but it seems to e necessary 'round here... :P
vBulletin® v3.7.1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.