Is there a difference between frames per second and frame rate?
They both mean the same thing
What exactly is tick counting and how to do you effectively utilize it?
In this case the 'tick' structure fields seems to not be used. But a tick represents an iteration of a timer. The amount of time since the previous tick is based on the resolution of the timer.
Here's a higher resolution FPS counter using delta timing. It can easily be modified to add framerate independent movement speed.
if all you want is just a basic framecounter... This is all I use. I have put it into a working example, but as you can see, no need to overcomplicate things if you don't need to
@flood
The tick thing in my struct was left in by mistake. It's from a failed implementation on my take of ticks.
I like your higher resolution code, however it doesn't work on Linux.
@LuCiFeR[SD]
Your example seems to cap at 60 fps, is this an Engine3D thing? Also, Engine3D already has a built in frame rate counter(Engine3DFrameRate(#PB_Engine3D_Current))
Nituvious wrote:
@LuCiFeR[SD]
Your example seems to cap at 60 fps, is this an Engine3D thing? Also, Engine3D already has a built in frame rate counter(Engine3DFrameRate(#PB_Engine3D_Current))
SetWindowTitle(#Window, "Frames Per Second: "+Str(FrameCounter(@FPS.FPS))+"Engine3D FPS: "+Engine3DFrameRate(#PB_Engine3D_Current))
apart from the engine3d one using a floating point, the results are similar. Although, not good enough it seems It's pretty much how I've done it for quite some time... maybe my math is out a little
So, I found the term I was looking for or trying to explain with 'tick rates'. Fixed time steps!
I also located an article on it but I lack the mental capacity to understand the integration process. http://gafferongames.com/game-physics/
Has anyone tried to implement this method into a game they've written in PureBasic?
Nituvious wrote:So, I found the term I was looking for or trying to explain with 'tick rates'. Fixed time steps!
I also located an article on it but I lack the mental capacity to understand the integration process. http://gafferongames.com/game-physics/
Has anyone tried to implement this method into a game they've written in PureBasic?
Actualy this articel does not speak about fixed time steps but delta time. Depending on your game it can be very tricky to implement FPS independant movement and game mechanics because you may need to interpolate to have reliable game mechanics like collision detection. A collision could happen in a frame not displayed.
Do a search for FPS independant, you sould find a lot of examples on the forum.
Btw. the FPS are capped at 60 because of your displayes refresh rate. Disable VSync to get bigger frame rates.