On 11/12/2010 19:31, Steve wrote:
More information: I just changed my sprites so they have only one
subgroup rather than two (they had been rotating two triangles in
opposite directions using two groups, now it is just one rotating
group). That gave me 40 FPS immediately without the extra lines for
smoothing.
Then I turned on psyco and got 280 FPS. Turning the extra lines back
on takes it back down to 50 FPS.
So it looks like most of the speed hit is happening because my group
hierarchy is so large and Python just gets weighed down by it, and
drawing a lot of anti-aliased lines is expensive. This is probably an
acceptable speed for this game to run at, so I'll just try to simplify
my sprites.
If anyone has any ideas about speeding it up anyway, they are still
welcome.
Could you post the new source? Or is it in an online repo?
If you're interested in speed, then obviously one good thing to do is
profile it. I like to run with stdlib cProfile:
python -O -m cProfile -o profile.out Aerthian.py
then view the resulting profile.out file using RunSnakeRun, which can be
pip (or easy_) installed, but I don't think it installs its dependencies
- last I checked you have to install those manually too. Details at:
http://www.vrplumber.com/programming/runsnakerun/
For what it's worth, I'm getting 18fps with the original .zip you
posted, on a very old (pre 2005) OpenGL2.1 laptop.
BTW, if I run with fullscreen=True, then I get an ugly flashing of
uninitialised memory across the top inch of the screen. My desktop is
1680x1050. If I change scene.py, 74, from:
draw.rect(0, 0, gamestate.norm_w, gamestate.norm_h)
to:
pyglet.gl.glClear(
pyglet.gl.GL_COLOR_BUFFER_BIT |
pyglet.gl.GL_DEPTH_BUFFER_BIT
)
then this fixes it.
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en.