Author Topic: Delta Timing Test.  (Read 10802 times)

0 Members and 1 Guest are viewing this topic.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Delta Timing Test.
« on: August 20, 2006 »
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:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Delta Timing Test.
« Reply #1 on: August 20, 2006 »
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:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Delta Timing Test.
« Reply #2 on: August 20, 2006 »
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:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Delta Timing Test.
« Reply #3 on: August 20, 2006 »
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:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Delta Timing Test.
« Reply #4 on: August 20, 2006 »
nice and smooth here shockwave.

very cool btw.
Challenge Trophies Won:

Offline DrewPee

  • I Toast Therefore I am
  • Pentium
  • *****
  • Posts: 563
  • Karma: 25
  • Eat Cheese - It's good for you!
    • View Profile
    • Retro Computer Museum
Re: Delta Timing Test.
« Reply #5 on: August 20, 2006 »
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

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Delta Timing Test.
« Reply #6 on: August 20, 2006 »
Smooth here, 60 to 70 fps on my PC - P4 2.8ghz Geforce 6600GT
Challenge Trophies Won:

Offline Ghost^BHT

  • Clueless and Happy
  • ^GVY
  • Pentium
  • ******
  • Posts: 931
  • Karma: 49
  • BYTE ME!
    • View Profile
Re: Delta Timing Test.
« Reply #7 on: August 20, 2006 »
Smooth here as well 50-60 fps

Offline Stonemonkey

  • Pentium
  • *****
  • Posts: 1315
  • Karma: 96
    • View Profile
Re: Delta Timing Test.
« Reply #8 on: August 20, 2006 »
just over 60 here and pretty smooth.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Delta Timing Test.
« Reply #9 on: August 20, 2006 »
Thanks a bunch :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Blitz Amateur

  • Atari ST
  • ***
  • Posts: 243
  • Karma: 13
    • View Profile
Re: Delta Timing Test.
« Reply #10 on: August 20, 2006 »
'Bout 130 FPS here and silky smooth

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Delta Timing Test.
« Reply #11 on: August 21, 2006 »
Thank you BA. I'm quite confident that it will be fine to use this technique now.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Delta Timing Test.
« Reply #12 on: August 21, 2006 »
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:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Delta Timing Test.
« Reply #13 on: August 21, 2006 »
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:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Delta Timing Test.
« Reply #14 on: August 21, 2006 »
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:

Offline Tetra

  • DBF Aficionado
  • ******
  • Posts: 2532
  • Karma: 83
  • Pirate Monkey!
    • View Profile
Re: Delta Timing Test.
« Reply #15 on: August 25, 2006 »
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:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Delta Timing Test.
« Reply #16 on: August 26, 2006 »
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:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: Delta Timing Test.
« Reply #17 on: August 28, 2006 »
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:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Delta Timing Test.
« Reply #18 on: August 28, 2006 »
It's really easy Rel, I'll make a little tutorial post about it with an example soon :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: Delta Timing Test.
« Reply #19 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: