**** BEGIN LOGGING AT Tue Feb 21 02:59:58 2012 Feb 22 00:21:49 anyone alive Feb 22 00:21:55 my brain isnt working Feb 22 00:22:00 can this be reduced? Feb 22 00:22:01 1.0 / fps - ( clock.tick() / 1000.0 - ( 20.0 / fps ) / fps ) Feb 22 00:28:02 (1.0 - (tick/1000.0 - 20.0/fps)) / fps Feb 22 00:29:32 * rrix headsplode Feb 22 00:30:46 dwc-, thats not right Feb 22 00:31:04 that results in approx fps/2 Feb 22 00:31:10 (1+(1/f))/f - T/1000 Feb 22 00:31:39 err Feb 22 00:31:51 (20+(1/f))/f - T/1000 Feb 22 00:32:16 20/f^2 + 1/f - T/1000, with the 'f' division grouped for evaluation reasons Feb 22 00:32:46 python has no ^ operator Feb 22 00:32:58 ;) Feb 22 00:33:02 oh, brainfart. Feb 22 00:33:06 * dwc- has problems with math these days Feb 22 00:33:23 1/f - (T/1000 - ((20/f)/f) => 1/f - t/1000 - 20/f^2 Feb 22 00:33:28 wait. Feb 22 00:33:34 then just pulled out the f division as mentioned above Feb 22 00:33:52 errr sign error on the 20 above, but you get the idea Feb 22 00:34:24 oh. I misread where the ( is Feb 22 00:34:33 or he mistyped it, i'm honestly not sure Feb 22 00:35:02 if you interpret it as written it's just 3 distinct terms and you immediately get 20/f^2 + 1/f - T/1000 Feb 22 00:35:33 I'd guess that 4 floating point divisions might be faster than 3 fp divs and a fp squaring, but I don't remember Feb 22 00:35:37 dwc-: but otherwise i think your answer is right, dwc--refactor our the single divison by f, and that's all you can really do Feb 22 00:36:25 err what about 3 floating point divisions? ((20/f) + 1)/f - T/1000 Feb 22 00:36:42 I'm just curious what the calculation is for actually Feb 22 00:38:01 me too, for example 20 in the above is apparently "frames per second-squared" which is an unusual metric Feb 22 00:38:16 (f/s)^2 anyway Feb 22 00:38:25 >.< wow it's been longer than i thought haha, sorry all :) Feb 22 00:40:20 dwc-, you familiar with pygame? Feb 22 00:40:51 inverse fps = rendering time? minus ( current time (in ms? s?) minus 20/fps(?)) / fps ... some sort of adjusted rate of fps? Feb 22 00:41:23 know of it, never used it... not much of a python person, had to build it once upon a time for something Feb 22 00:41:33 ya its a rate adjustment Feb 22 00:41:47 i am trying to create a way to integrate pygame and twisted Feb 22 00:42:47 https://gist.github.com/1880225 Feb 22 00:42:50 twisted... I've used that, maybe once ;) Feb 22 00:42:56 that is what I have so far Feb 22 00:43:16 so in pygame you can do time.Clock.tick(30) once per frame Feb 22 00:43:21 (simplest telnet server I could easily make changes to test a telnet client) Feb 22 00:43:25 and it will maintain 30 fps Feb 22 00:43:54 so I am trying to emulate that behavior with twisted's reactor Feb 22 00:45:01 This method should be called once per frame. It will compute how many milliseconds have passed since the previous call. Feb 22 00:45:05 ahh Feb 22 00:46:22 did we ever got a simplification of that which works Feb 22 00:46:41 what's the 20.0 Feb 22 00:47:28 ummmm Feb 22 00:47:33 lets see how I can explain that Feb 22 00:47:43 seems like you should only need to delay 1/fps - clock.tick [ms]/1000 seconds Feb 22 00:49:36 no that doesnt work Feb 22 00:50:12 if I use that to maintail 30fps I get ~45fps Feb 22 00:52:22 1/30 = 0.0333... seconds... if 10 ticks passed, that's 0.01s, and you should sleep (1/30-0.01) more seconds Feb 22 00:56:05 im telling u, the equation u gave me does not work Feb 22 01:02:11 does tick_busy_loop change anything? Feb 22 01:03:57 its more precise but more expensive Feb 22 01:04:12 and precision is not the issue Feb 22 01:04:40 I dunno, maybe my brain is broke, but the math seems right Feb 22 01:25:19 selfhelper works ok, pygamehelper does not... what did I do wrong... besides poor python coding practices. http://pastebin.com/btwCT70e Feb 22 01:27:07 if you take out the print ticks, the pygamehelper runs the 1000 loops in 16s, the selfhelper runs it in 33 **** ENDING LOGGING AT Wed Feb 22 02:59:58 2012