deadimp
Joined: 22 Oct 2008 Posts: 28
|
Posted: Sun Nov 09, 2008 10:17 pm Post subject: Framerate - Questions |
|
|
Two things: 1) Asking about jumpiness and 2) Asking about frame-independent calculations
1) I've noticed that with my test project under arc that the framerate is a bit jumpy.
It's been perplexing me for a while now.
I'm using arc.time to limit the framerate, and I have it draw the resulting framerate to the screen.
I tell it to limit it to 60, and the resulting fps is on average 63.
I'm running this on a quad-core i386 running Ubuntu 8.04.1 32-bit, under GNOME of course.
I remember running into this sort of thing with my old game / engine, and it was mostly 'fixed' by using a higher-resolution timer (QueryPerformanceCounter() on Windoze).
This is the general game loop I have:
Code: | while (!keyPressed(ARC_QUIT) && !keyPressed(ARC_ESCAPE))
{
arc.window.clear();
arc.input.process();
arc.time.process();
//Draw the stuff here ...
arc.window.swap();
arc.time.limitFPS(fps);
} |
I've tried switching the ordering of window.clear(), input.process(), and time.process(), and additionally window.swap() and time.limitFPS(), but to no avail.
Also tried switching it to fullscreen to see if any sort of priority for the application would be improved, but no.
Does SDL have anything for a higher resolution timer?
2) That being said (since this is for a MegaMan X fan game), does anyone happen to randomly know how the Super Nintendo games' movements are done? I would guess the calculations are frame independent, 'cause otherwise it would be quite expensive especially for the SNES processor.
However, when running ZSNES, when I reduce the framerate the slowdown is smooth. Are these games actually using frame dependent calculations?
I would rather just use simple frame independent calculations because I'm lazy, and it's a very 'pixel-based' platformer (a.k.a. classic). However, if I must (and I probably will ), is there an existing frame-dependent calculation library written in D?
Preferrably something that wraps integral types, so that certain operations are frame dependent (such as relative operations).
If there isn't, this is yet another thing that I wouldn't mind trying to implement - with some help, of course. _________________ deadimp.org
> MegaMan X Crossfire - MegaMan X fan game
Beginning D; Basic experience in PHP, C++, Java, C#, MySQL, HTML, CSS, JavaScript, VB |
|