You may be able to force the latency below 40ms by specifying a small
call interval and by changing the scheduling method from
schedule_interval_soft to schedule_interval:
In pygletreactor.py:
# Schedule a method to deal with Twisted calls
-self.clock.schedule_interval_soft(self._make_twisted_calls, call_interval)
+self.clock.schedule_interval(self._make_twisted_calls, call_interval)
In any case, I'm not sure how reliable it is to use Twisted for
timing-critical stuff as I've never tried it. But there should be no
limit to how often the polling function above can be scheduled in Pyglet
(down to the timing tolerance on the platform you are running it on...)
Admittedly, the way I put the reactor together isn't ideal, but I found
that regularly polling for Twisted function calls was the only way to
get the two event loops to integrate reliably.
Hope that helps,
Padraig
On 19/03/2010 15:37, Thomas Woelz wrote:
Apparently, for the pyglet-twisted reactor you mentioned, you can
change the ping by altering the call-interval setting, but you will
still hit a wall at some point, check this issue:
http://code.google.com/p/pyglet-twisted/issues/detail?id=4
Thomas
On 19 mar, 07:14, caribou<[email protected]> wrote:
Hello,
I'm fighting for weeks now, trying to make work twisted and pyglet. I
found several projects :
* pyglet-twisted (pygletreactor)
* a simple coiterate snippet in this very group
* and a few other ones from different projects
My problem is that with all my tests i can't get les than ~40ms ping
on a local server. Actually the communication duration is quite ok but
once the information is on the client-side there is some latency. I
guess this is an event handling "problem".
I made a lot of tests on different machines, in different situations,
twisted alone is ok, mixed with pyglet it isn't.
I'm doing a realtime network game, should i go with these 40ms ?
Knowing that 80ms is kind of the max ping a player could tolerate,
that would mean that a player need a maximum of 40ms to reach a total
of 80ms "playable" ping.
Any advise, clue ?
--
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.