Re: DT in BGT

The pattern makes sense if something's delaying it, since the shorter delays would be the clock trying to compensate for the apparent lag. But I'm not sure that that's what's happening, given those numbers. The long frames are suspiciously close to twice as long as they should be.
Can

OK, I went and tried testing the clock by itself, and it turns out that there is a bug if the first tick happens less than delay ms after the clock was last reset. I completely failed to account for the possibility of a delay that was shorter than expected. This caused a double negative to show up in the first frame, and the oscillation you found is the result of the clock compensating without a way to prevent the problem from repeating for short frames.
I fixed it by adding this line before the call to wait in clock.bgt:
if(elapsed<0) elapsed=0;
So yeah, you found a bug in the clock. I'm not sure if this will fix the problem, since tiny variations were still happening after I fixed it, with some frames getting random extra ms even though they weren't doing anything, but it was on the order of 22ms instead of 20ms at worst, and the clock compensates for it correctly. Now, if it turns out those 1-2ms are also from a bug in the clock, I'll let you know, but it should never wait longer than delay, with that fix, so I'm assuming the noise is from my computer.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : JLove via Audiogames-reflector

Reply via email to