[OLPC-Games] Reducing pygame cpu-load to < 4 %

Dave LeCompte tsmaster at gmail.com
Mon Dec 10 14:53:03 EST 2007


It's not just animation, though, right?

Like the previous poster mentioned, any game that has a realtime simulation
component is going to be using the CPU even when not responding to user
input. Example of this would include games ranging from SimCity to Tetris.

Similarly, any game with a computer player might use CPU when the human
player isn't doing anything, whether it's a turn-based game like chess, or a
realtime game like Galaga.

Also, for networked games, the local machine may have to use CPU when data
comes in from a remote player.

I would hesitate to use screensaver information outside of its intended use
- I would certainly suspend most of my games when a screensaver activates,
to be sure, but I would not rely on it to know when the user might be doing
something else. For this, I imagine I'd first look to see if my window has
lost focus, and additionally have a game-specific means for reverting to a
low-CPU use mode when left unattended for long periods.

-Dave LeCompte


On Dec 10, 2007 11:36 AM, Jim Gettys <jg at laptop.org> wrote:

> In this case (animation), the games should "go quiet", if there is no
> user input after a short period (say, 30 seconds).  It is pretty easy to
> get the window system to tell you when it has been idle, I believe (the
> X screen saver extension, for example).
>
> When no animation, applications should be quiet as a tomb...
>
> We can't rely on young kids to remember when to suspend a computer, I
> don't think....
>                             - Jim
>
> On Mon, 2007-12-10 at 17:28 -0200, Roberto Fagá wrote:
> > Jim
> >
> > This is specific of games which use many resources, like animations
> > and some more advanced graphics. I also think will be nice if screen /
> > video driver supports other screen resolution, like 600x450 and less
> > color depth if the only depth that XO works is 16bits. This can save
> > CPU/GPU to some games that need speed but not so much resolution...
> >
> > The 100% using CPU happens only if you don't use anything to control
> > framerate, and for it you can use the pygame clock, time.sleep and the
> > event.wait if you can freeze application while you wait for an event.
> > Can happens too if the game / pygame application uses many resources,
> > exactly as a GTK/Hippo activity does.
> >
> > []'s
> >
> > On Dec 10, 2007 5:11 PM, Jim Gettys <jg at laptop.org> wrote:
> > > There is one piece of this discussion that is scaring the bejesus out
> of
> > > me: the idea that an application should take *any* cpu time when the
> > > user isn't doing anything...  Is this specific to pygame based
> > > applications? Or am I missing something?
> > >
> > > Electricity doesn't grow on trees, you know....  In Peru, 55,000 of
> the
> > > machines will be going to schools/kids with *no* electricity.  And
> this
> > > is just the beginning...
> > >                            - Jim
> > >
> > > --
> > > Jim Gettys
> > > One Laptop Per Child
> > >
> > >
> > >
> > > _______________________________________________
> > > Devel mailing list
> > > Devel at lists.laptop.org
> > > http://lists.laptop.org/listinfo/devel
> > >
> --
> Jim Gettys
> One Laptop Per Child
>
>
> _______________________________________________
> Games mailing list
> Games at lists.laptop.org
> http://lists.laptop.org/listinfo/games
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/devel/attachments/20071210/811ecb9f/attachment.html>


More information about the Devel mailing list