On 5/24/07, Mike Wyatt <[EMAIL PROTECTED]> wrote:
I'm working on a synchronized RTS using pygame and Python's socket
library, and I've discovered that the values returned by
pygame.time.get_ticks() and the time module's clock() method are not
consistent. My test results suggest that pygame.time.
Mike Wyatt wrote:
the values returned by
pygame.time.get_ticks() and the time module's clock() method are not
consistent.
The difference is pretty small, but it is enough to cause a networked
game to go out of sync within a few seconds.
Even if this difference didn't exist, relying on the loca
I took the easy path and replaced pygame.time.get_ticks() with
int(time.clock()*1000). The game seems to be running much smoother
now. I agree that this is not an ideal solution, so I'll make a note
to look at modifying my logic to use a network-synced timer value. I
actually already have a net
I'm working on a synchronized RTS using pygame and Python's socket
library, and I've discovered that the values returned by
pygame.time.get_ticks() and the time module's clock() method are not
consistent. My test results suggest that pygame.time.get_ticks() runs
slightly faster than time.clock().
I don't think you can rely on the time to be accurate - especially
across machines, and different CPUs/OS's.
Inaccurate to within 10ms is what XP can do.
So... what to do? I think maybe use one of the machines as a master
clock? Then sync to that?
So you could add the master clocks time to ev