Re: [pygame] pygame.time.get_ticks() vs. time.clock()

2007-05-24 Thread Ulf Ekström
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.

Re: [pygame] pygame.time.get_ticks() vs. time.clock()

2007-05-23 Thread Greg Ewing
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

Re: [pygame] pygame.time.get_ticks() vs. time.clock()

2007-05-23 Thread Mike Wyatt
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

[pygame] pygame.time.get_ticks() vs. time.clock()

2007-05-23 Thread Mike Wyatt
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().

Re: [pygame] pygame.time.get_ticks() vs. time.clock()

2007-05-23 Thread René Dudfield
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