[OLPC-Games] KuKu refactor for decreased playtime lag

Julius B. Lucks julius at younglucks.com
Mon Aug 20 08:56:26 EDT 2007


Hey Chris,

I'll get that working patch in this morning.  I'd love for you to have  
a look at the image loading too!  What would also be super terrific  
would be if you could make some notesn on the kuku wiki page on how  
you do the profiling - other pygame activities would benefit a lot I  
bet.

Cheers,

Julius

Please Reply to julius at younglucks.com

On Aug 20, 2007, at 7:35 AM, Christopher Schmidt <crschmidt at metacarta.com 
 > wrote:

> On Sun, Aug 19, 2007 at 05:45:03PM -0400, Julius B. Lucks wrote:
>> Hey Chris,
>>
>> Actually I just realized that those get_xxx() methods are probably
>> relics of the old code.  The main differences you will encounter in
>> the main loop is that all these get_xxx() methods are now just
>> object.number, that the object.draw(screen) -> object.draw(), and
>> that lives_object.draw_lives() -> lives.draw().
>
> Yep, that's exactly it. I got to the point of cargo culting, but not  
> to
> the point of actually porting over to the newer style code :)
>
>> I just did those fixes to your patch and ran it on an XO and except
>> for the initial 10 questions that draw the fruit images in the tiles,
>> it is MUCH faster.  Thanks for this, and I can't wait to get your
>> final patch committed.
>
> If you've got something that works, feel free to run with it. Changing
> the accessor methods to just access the values seems fine to me: I had
> gotten far enough to see that it looked like that was neccesary, but  
> not
> far enough to actually doing it -- it looked like that was a large  
> chunk
> of the remaining work, so far as I could tell.
>
> Once you've got that in, I'll start taking a look at the image drawing
> part -- I think it's likely that the code is reloading all the images
> from disk every time the chicken moves, which has obvious negative
> affects. (Before it was actually reloading them all every time the  
> event
> loop ran, so far as I could tell - a 15 second game would call
> load_image 9000 times.)
>
> Let me know if you want me to dive back in and fix anything, but I  
> think
> at the moment the next step is just to get your working version of the
> patch in, and then I'll start hacking again here.
>
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta


More information about the Games mailing list