FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Framerate - Questions

 
Post new topic   Reply to topic     Forum Index -> ArcLib
View previous topic :: View next topic  
Author Message
deadimp



Joined: 22 Oct 2008
Posts: 28

PostPosted: Sun Nov 09, 2008 10:17 pm    Post subject: Framerate - Questions Reply with quote

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 Sad ), 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
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Mon Nov 10, 2008 2:53 pm    Post subject: Reply with quote

Hello,

Can you explain more what is happening when you are using limitFPS? Does the movement "twitch" or "freeze"?

It may be because the timer isn't high resolution enough. The problem with being cross platform is that you have to target the lowest common denominator of functionality.

You could always try using the elapsedMilliseconds() function and multiply the movement speed by it. I think the old console games movements speeds were hard coded because they could depend on a reliable processor speed.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> ArcLib All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group