[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] pygame slow on linux (ubuntu)



Things keep getting more interesting on ubuntu...I have tried
controlling the frame rate, as rene suggested, and on windows, it
works just like it should. The frame rates arent spot on but close
enough. I added the same code under ubuntu and even though I made it
so that it should run at 60, then even at 100 fps, it did not.

Here is some of the weird things i noticed from the get_fps call in ubuntu:

for the first 10 frames, fps is 0
next ten frames, fps is 21.367...
next ten frames, fps is 22.123...
next ten frames, fps is 22.831...
next ten frames, fps is 22.0264...
next ten frames, fps is 21.834..

and so on....

at this point I know something is very odd...later on the fps gets
even lower to 20 as I fire the
missiles on the ship.



On 6/12/06, spotter . <talonspotter@xxxxxxxxx> wrote:
Okay, I have tried some things on ubuntu. I tried commenting out the
delay, and it did nothing. I also tried to delete all the .pyc files,
just in case, but that did not work either.
I guess i should try and add in frame rate management as rene suggested.

On 6/12/06, spotter . <talonspotter@xxxxxxxxx> wrote:
> I use that to prevent the game from using 100% cpu (windows at least),
> I have not tried commenting it out on ubuntu. I will try that.
>
>
> On 6/12/06, andrew baker <failrate@xxxxxxxxx> wrote:
> > I noticed you put this in the bottom of your loop, presumably to keep it
> > from running too fast.  I wonder if Ubuntu has any strange issues with the
> > sleep command?  Have you tried running it without this?
> >
> > time.sleep( 0.01) #delay loop
> >
> >
> > On 6/12/06, spotter . <talonspotter@xxxxxxxxx> wrote:
> > > I dont have a website for the game, the main module is attached below.
> > > As for the frame rate, I have no real management, as I thought that it
> > > was not really necessary. Should I have some sort of frame rate
> > > control?
> > >
> > >
> > >
> > >
> > > On 6/12/06, Rene Dudfield <renesd@xxxxxxxxx> wrote:
> > > > Do you have a link to your game?
> > > >
> > > > How do you manage the frame rate?
> > > >
> > > >
> > > > On 6/13/06, talon spotter <talonspotter@xxxxxxxxx> wrote:
> > > > > Hey everybody,
> > > > >
> > > > > I am writing a space invaders style game, and it works well on
> > > > > windows. When I tried the game
> > > > > under ubuntu linux(dapper), it was noticeably slow. After some
> > > > > googling, I found this:
> > > > >
> > http://www.libsdl.org/pipermail/sdl/2006-May/074254.html
> > > > >
> > > > > I dont have access to any other distro of linux right now to check if
> > > > > it is just a problem under ubuntu. I wasnt really able to see any
> > > > > speed increase in pygame after opening up firefox, but i just casually
> > > > > checked it and have not been able to do further tests as of yet.
> > > > >
> > > > > Has anybody heard of this? Does anybody have any ideas?
> > > > >
> > > > > Thanks, s.
> > > > >
> > > >
> > >
> > >
> > >
> >
> >
> >
> > --
> > Andrew Ulysses Baker
> > "failrate"
>