[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] help... please



anijap@zapo.net wrote:
I've been looking through the http://www.nongnu.org/pygsear/
tutorials. When I ran the example games i found out that some of them (like
pygsaw and pathmaker) are VERY slow...
here's some of the easiest ways to crush your running speed.

first is to run with loaded graphics that you haven't called Surface.convert(). without making this call, each pixel must be slowly converted every time the image is blitted to the screen.

also, calling display.update() without passing a list of updated areas. even with many objects on the screen, passing a list of areas to update will be much faster than updating the entire display. of course, this only helps for games without scrolling backgrounds, but it is a big win.

similar to the last problem, when you "erase" the screen to start a new frame, only erase areas that have changed. filling or blitting a fullscreen surface just to erase some small objects is going to damped performance.

well, those are the usual suspects for speed problems. i haven't looked hard into the pygsear examples, so i'm not sure where the bottleneck is coming from, but i'm assuming it is a combination of these.

also remember that using the sprite.RenderUpdates group to manage rendering your sprites will automatically take care of these last two items for you.


P.D: solarwolf is awesome! how long have you worked on it?
or how long have you been a programmer?
P.D: i won the game in 30 min but still...
solarwolf took me about 3 months of dedicated "off-hours" development. i had the core gameplay up and running within a short amount of time. getting the last 20% of the game put together took by far the most time.
(that includes things like the menu, player scores, and other niceties such as a limited number of lives :] )


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org