Allegro.cc - Online Community

Allegro.cc Forums » Game Design & Concepts » Separating Logic from Drawing Part III- The Resurection

This thread is locked; no one can reply to it. rss feed Print
Separating Logic from Drawing Part III- The Resurection
Ben Delacob
Member #6,141
August 2005
avatar

Read the previous one if you haven't. I just have to cut in that it seems everyone who read misunderstood what AMCERASOLI was saying (correct me here if I'm wrong about your point).

The point wasn't that the fps would magically be increased. The point was that logic time is variable so if drawing is always done immediately after logic is completed, frames per second may not be updating at as even of a pace as possible. I think (not sure at all) that AMCERASOLI was assuming that if the drawing was more consistent, it would look smoother. Considering that movies would have probably employed some sort of mechanic (which I think would have been mentioned in articles I've read) to display frames with a small variability if this were not the case, that seems a safe bet to make, but not a given.

Does anyone know if small inconsistency of draw (flip) times in a rock steady average fps time can look significantly worse than the same fps, completely steady?

__________________________________
Allegro html mockup code thread -website-
"two to the fighting eighth power"

X-G
Member #856
December 2000
avatar

The point wasn't that the fps would magically be increased.

Quote:

But the question is... Would it make any difference in performance?

Quote:

this might reduce the FPS of my game at that point [...] this I could improve the FPS of my game...

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

AMCerasoli
Member #11,955
May 2010
avatar

The point wasn't that the fps would magically be increased. The point was that logic time is variable so if drawing is always done immediately after logic is completed, frames per second may not be updating at as even of a pace as possible.

There you got it right. That was exactly what I was talking about.

Logic is variable inside your game, you might tell your program to run at 30 FPS (Logic) and 15 FPS (Draw), But you computer might not have the enough performance to do so. So if you don't do the drawing immediately after logic and instead you say your computer:"If you are doing logic then don't draw, and if you are going to draw don't do logic) this may help your computer to keep FPS consistency...

I think (not sure at all) that AMCERASOLI was assuming that if the drawing was more consistent, it would look smoother.

Well actually I wasn't thinking in smoothness. With today's computers is very difficult to reach at a point where you have to implement algorithms to see things more smoother, since they are very powerful. I was thinking more in performance and helping an old computer to show a game at a good frame rate..

Ben Delacob
Member #6,141
August 2005
avatar

Oh, in that case, people usually just do constant logic rate with a draw if there is time. A check that not too many draw passes are skipped can be added so older computers can still play. Either that or the delta timing mentioned already, which can be great for a simple 2d game without too much physics- 3d and physics libraries are usually easier with constant time.

__________________________________
Allegro html mockup code thread -website-
"two to the fighting eighth power"

Chris Katko
Member #1,881
January 2002
avatar

Does anyone know if small inconsistency of draw (flip) times in a rock steady average fps time can look significantly worse than the same fps, completely steady?

Inconsistent frames per second is worse than lower frames per second because players can no longer predict and compensate for it. (If that's what your asking.)

As for worrying about it, I wouldn't.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Johan Halmén
Member #1,550
September 2001

{"name":"603398","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/9\/89b55389e67c17fb0f4d1ab08a01ad9d.png","w":318,"h":76,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/9\/89b55389e67c17fb0f4d1ab08a01ad9d"}603398
Would this be a somewhat correct explanation of the framerates? If our graphics card works at 50 Hz, the screen is updated each 0.02 second. That's the light blue bar with the red stripes at each 0.02 s. If our game updates the graphics at some 60-70 fps (dark blue bar), we will be sure of that each refresh of the screen brings up a new image. And behind these rates we have the game logic, that has an even higher rate to ensure all collision handling and whatnot will be as accurate as possible.

Now if the game logic rate is not stable (the yellow stripes being not very evenly distributed) and there's no delta-time calculations involved, one would think that it would theoretically mean jaggy movement or something similar to the game. But no matter if the logic rate is constant or the delta-time calculus would compensate the variations, we will get uneven steps in the final frame refresh. Every once in a while your graphics will update twice before next frame refresh. In my image this happens at 0.022 and 0.037. An intuitive calculation tells me that if the screen framerate is 50 Hz and your game graphics rate is 55 fps, you get 5 skippings of a graphic frame per second. Each 0.2 s your game character moves slower than he should, then he skips a frame to compensate for it.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.

Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.

Go to: