Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Frame rates
Topic Started: May 18 2009, 03:55 PM (933 Views)
Gandalf20000
Member Avatar
Geek
[ *  *  *  *  *  * ]
Eanbro
May 25 2009, 09:43 PM
roelor
May 25 2009, 09:19 PM
also my pc tends to lie about fps speed.
Never rely on GM functions for delta time.
Rely on the High Resolution Timer DLL. It's works really quite nicely, and is very simple.
Offline Profile Quote Post Goto Top
 
skarik
Member Avatar
kitten eating scum
[ *  *  *  *  *  * ]
Quote:
 
How the heck does taking an average of the last 300 steps help anything at all? The problem is sudden and inconsistent FPS drops. If you need to wait 300 steps what is the point of delta time at all?

It doesn't wait. It changes drastically when there's an FPS drop. It was originally at 30 FPS, but my game is too jumpy for that.

For some reason, with using the last 300 steps, it proves extremely responsive. You should try it if the HRT is proving too jumpy for ya.
Blog|EHS
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
skarik
May 26 2009, 06:12 AM
Quote:
 
How the heck does taking an average of the last 300 steps help anything at all? The problem is sudden and inconsistent FPS drops. If you need to wait 300 steps what is the point of delta time at all?

It doesn't wait. It changes drastically when there's an FPS drop. It was originally at 30 FPS, but my game is too jumpy for that.

For some reason, with using the last 300 steps, it proves extremely responsive. You should try it if the HRT is proving too jumpy for ya.
Can you show me the code? I haven't the slightest guess of how that might work...
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
skarik
Member Avatar
kitten eating scum
[ *  *  *  *  *  * ]
I honestly have no idea why it works so well.

It's kinda old, so don't expect it to work right off:
Code:
 
// Define exports
#define export extern "C" __declspec (dllexport)

// Of course.
#include <ctime>



//using namespace std;

// Declare sum stuff the bad way
clock_t current_time_timer = clock();
// Init ze autre stuffs
double current_time_avg [300];
int current_array_size;

// Initialize ze timers
export double InitTimer( void )
{
/*clock_t * new_clock_timer;
new_clock_timer = new clock_t;
*new_clock_timer = clock();

return (double) new_clock_timer;*/
current_array_size = 0;

current_time_timer = clock();

return (double) current_time_timer;
}

export double CalculateDeltaFactor( void )
{
// Just practicing pointers here
clock_t * temp_time_timer;
temp_time_timer = new clock_t;
*temp_time_timer = clock();

*temp_time_timer = (*temp_time_timer) - (current_time_timer);

current_time_timer = clock();

// Using a few calculations, we calculate the FPS
double temp_calculator = *temp_time_timer;
delete temp_time_timer;

// Get the amount of seconds passed
temp_calculator /= CLOCKS_PER_SEC;
// Get the amount of steps supposedly passed
temp_calculator *= (30);

// We add it to the array
int i;
for (i = 1; i < current_array_size; i += 1)
{
current_time_avg[i] = current_time_avg[i-1];
}
current_time_avg[0] = temp_calculator;

if (current_array_size < 300)
{
current_array_size += 1;
}
// We average the array
temp_calculator = 0;
for (i = 0; i < current_array_size; i += 1)
{
temp_calculator += current_time_avg[i];
}
temp_calculator /= current_array_size;

//temp_calculator = 0.5;

return temp_calculator;

}


If it doesn't update fast enough, you can always change the number of values averaged. Stickman does the last 100 steps now, because people had problems on other PC's.
Blog|EHS
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply