• Welcome to Dark Bit Factory & Gravity.
 

Delta Timing Test.

Started by Shockwave, August 20, 2006

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Shockwave

Hiya,

Having been miffed at jittery refresh rates with tinyptc I think I might have cracked the problem.
I have tested this intro at several refresh rates, right down to 9fps. It remains watchable at speeds as low as 20fps, anything between 50 and 400fps looks nice and smooth.

BUT! As I am painfully aware, that doesn't mean that it would be the same on all systems so please give it a run if you can.

The intro will stutter for approximately the first second while it works out what speed it should be running at on your system, then it should smooth it's self out.

Cheers.
Shockwave ^ Codigos
Challenge Trophies Won:

Jim

About 120-125fps here.  What exactly is the problem you are trying to fix?  The fact that the time it takes to draw a frame isn't consistent?  So are you now averaging out the first N frames-worth to find out what the amounts you are adding on should be?  Under Windows you should be able to adjust continually, because you never know what the rest of the OS is going to throw at you.  In our games we used to use the time it took to draw the previous frame as the best guess for how long it will take to draw the next frame.  Or you can average the last few to get a smoother guess.  All our movement/AI/physics/animation routines took time as a parameter, so any movement gets scaled by how fast you're rendering.  For instance angle = angle + elapsed_time_of_last_frame * some_suitable_scale_factor.
Just watch that that time doesn't drop below 1ms or go to a huge value when someone alt-tabs away and your app effectively stopped.
As this is an experiment can you show some source with the problem?

Jim
Challenge Trophies Won:

Shockwave

Mmm, sorry Jim, I wasn't really after FPS, I just wanted to make sure that it looked smooth on several different systems to be sure that my technique works.
All I am doing is seeing how many frames are rendered over the last second and then adjusting accordingly, it does this throughout so if an event happened that slows the PC down then the intro should compensate.

I will of course release the full code for this intro when it's finished, it's a little bit of a mess at the minute.
Shockwave ^ Codigos
Challenge Trophies Won:

Jim

Silky smooth after the first few hundred milliseconds.  I should try inserting a CD or plugging in a USB dongle while it's running to try out the new features.

Jim
Challenge Trophies Won:

ninogenio

nice and smooth here shockwave.

very cool btw.
Challenge Trophies Won:

DrewPee

Again, Shockwave - looks amazing - no problems with my rig . . .

Ive got an AMD Athlon 2600+ with 1Gb ram, A GF5600 with 256Mb Ram - nothing special!

Hope this helps - can't wait to see the source code!

Drew
DrewPee
aka Falcon of The Lost Boyz (Amiga)
Ex-Amiga Coder and Graphic Designer
Administrator of > www.retrocomputermuseum.co.uk

Rbz

Smooth here, 60 to 70 fps on my PC - P4 2.8ghz Geforce 6600GT
Challenge Trophies Won:

Ghost^BHT

Smooth here as well 50-60 fps

Stonemonkey

just over 60 here and pretty smooth.

Shockwave

Shockwave ^ Codigos
Challenge Trophies Won:

Blitz Amateur

'Bout 130 FPS here and silky smooth

Shockwave

Thank you BA. I'm quite confident that it will be fine to use this technique now.
Shockwave ^ Codigos
Challenge Trophies Won:

Clyde

64 Fps here dude.

And that's very clever how you've managed to toggle the Effect Screen & console window with alt + tab using tinyptc. 

Cheers,
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

Shockwave

That's automatic mate, as long as you compile the program -s console the console window will run in the background, Alt+Tab will send most programs to the background.
Shockwave ^ Codigos
Challenge Trophies Won:

Clyde

Cool and thanks for that mate.

Cheers,
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

Tetra

Runs smooth here @ 50fps

One thing I noticed though, when I alt-tab back to it after a while of looking at the fps, the effect is in turbo mode then settles back down again, so it does seem to catch up :)
Challenge Trophies Won:

Shockwave

Thanks Daf. This technique has come to fruition now, hopefully I'll be able to use it in something. :) It goes ape because it averages fps over 1 second. Jims method would be better.. ie see how many millisecs it took to draw the last frame and base it on that.
Shockwave ^ Codigos
Challenge Trophies Won:

relsoft

Runs at about 25 FPS here 750 duron but it feels like it runs at 60FPS. It's sooooooo smooth!!!!  You'd have to teach us how to do that!
O0
Challenge Trophies Won:

Shockwave

It's really easy Rel, I'll make a little tutorial post about it with an example soon :)
Shockwave ^ Codigos
Challenge Trophies Won:

relsoft

Quote from: Shockwave on August 28, 2006
It's really easy Rel, I'll make a little tutorial post about it with an example soon :)

Does it work like this?

get time difference from last frame to current frame
divide the time diffirence by the needed frames
multiply each vector component with the multiplier

Hell, just make a tute. I like it!
Challenge Trophies Won: