On Sep 17, 2008, at 4:01 AM, Alex Holkner wrote:
>>> These results are surprising (and don't match mine at all). You
>>> should see far higher FPS readings for the code you supplied for
>>> intervals 1/100 and 1/200; because the event loop degenerates to
>>> polling in this case (by design). For the 1/30 and 1/60 cases you
>>> should also see framerates far above the target interval.
The following code fixes schedule_interval(update, 1/100.) timings (in
trunk and pyglet-1.1-maintenance). But schedule_interval(update,
1/90.) still results in 64-70fps. In other words - the polling version
(>100fps) of the main-loop works ok with this change:
import pyglet
pyglet.clock.set_default(pyglet.clock.Clock(time_function=time.clock))
Finally, after timing nearly everything in pyglet/app/win32.py, I made
a little test-program and got some depressing results:
# python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)]
import time
p = 0.
while 1:
t = time.time()
if t != p: print "timeupdates/s", 1. / (t - p)
p = t
...
timeupdates/s 62.4998733404
timeupdates/s 66.6662004292
timeupdates/s 62.5008046731
timeupdates/s 66.6662004292
...
time.time() updates only ~64 times per second on my computer. And
seems that _user32.SetTimer has the same resolution.
>> For my little hobby-games/programs I make the assumption that every
>> computer worth supporting can run the program at 60fps. 30fps and
>> animating non-blurry graphics is too ugly for me. I just can't stand
>> it. And since I'm too lazy to decouple game-physics from framerate
>> and
>> use interpolation to get updated positions in the renderer, I have no
>> other choice but to run *everything* at 60fps. (sadly physics has to
>> work with a fixed timestep. no other way).
>
> Well, I don't quite agree with your premise, but anyway...
>
> You can get _exactly_ the monitor refresh rate fps using
> clock.schedule() and vsync=True. Surely you'd prefer to run at 75 fps
> on a 75 Hz display, to avoid duplicating frames (and creating jitter).
I might prefer some jitter over slightly changing gameplay physics and
over fixed 30fps. I'll do some testing to find out how bad 60fps is on
a 75Hz display.
> FWIW, my latest PyWeek entry (http://pyweek.org/e/midnightsun/) is
> physics-based and runs at 30 FPS using the method described above
> (schedule_interval + invalid flag), without interpolation, and doesn't
> seem to exhibit any jitter on slow or fast machines.
Very nice : ) although 22fps here..
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---