Skip to content
Forum Archive

Framerate Limiter - Request to UnConeD

23 posts

Magic.X#

Framerate Limiter - Request to UnConeD

I know the Framerate Limiter idea is nothing new,but as i read that UnConeD has already written a FPS Detector ape, i thought that this could easily be transformed into an Framerate Limiter by inserting some delay code.

This would be kinda great as i have a lot of best at xx.x fps presets!
mikm#
and what if the framerate is below xx.x? what then?

I think the biggest problem with this is that it might cause the framerate to be 'blocky'.
Magic.X#
BLOCKY???

Don't know what you mean by this.

It could be done like this:

Check fps

If fps>xx.x increase %loop%
If fps<xx.x decrease %loop%
If fps=xx.x do nothing

do some hungry processes for %loop% times (could be a double inversion of the frame for example)

See if your pc is not able to even achieve xx.x fps the loop will be always 0.

Otherways the ape will always adjust it to the desired fps.

Quite simple, i'snt it? I'd do it myself, only prob is that i'm too busy with coding hotlist and my c++ knowledge is not the best.
sidd#
obviously if the fps is already less than desired, you cant do much abuot it. but thats not the point. i think its a damn nice idea magicX
mikm#
what I'm saying is that if you have a FPS slowing APE at the end, it would stop the processing for one frame. Thus, there would be 'delays' in the updates. (At least I think...not positive).
Magic.X#
I cant imageine that it would cause delays ina an other way than desired. But that would have to be tested.
sidd#
hang on, are you saying it will physically limit the fps, or just run code loops so that the preset is running slower.

the second one should have no problems at all, because it is just like puting in heaps of pointless effects to slow it down.
UnConeD#

struct apeconfig {
int mFrameLimit;
};

class C_THISCLASS {
...
private:
int mLastTicks;
apeconfig config;
...
}

C_THISCLASS::C_THISCLASS {
mLastTicks = GetLastTicks();
}

C_THISCLASS::render(...) {
int vTicks = GetLastTicks();
int vDelay = 1000/config.mFrameLimit;
int vRenderTime = vTicks - mLastTicks;
if (vRenderTime < vDelay) {
Sleep(vDelay - vRenderTime);
}
mLastTicks = GetLastTicks();
}
That should do the trick, it measures the rendering time of everything except the APE itself and adjusts framerate accordingly. I don't feel like whipping up an APE project for it.
UnConeD#
Dunno, I still don't see the use of this. If a preset goes too fast, increase the AVS size and be amazed at the miracles of 400x300 or 512x384...
anubis2003#
Speaking of new processor, I may be getting a dual Intel Xeon 3.06Ghz computer with 4GB(max of 12) PC-2100 RAM this summer. I'll also have at least 500GB of harddrive space as well. It's going to be sweet.
uNDefineD#
Originally posted by anubis2003
Speaking of new processor, I may be getting a dual Intel Xeon 3.06Ghz computer with 4GB(max of 12) PC-2100 RAM this summer. I'll also have at least 500GB of harddrive space as well. It's going to be sweet.
😱 Fuck me.

Seen the latest PowerMac yet? Dual 1.42GHz G4's with 2MB cache. *drool* (Not that I'm a Mac user or anything...)
Magic.X#
Ahem, back to the Topic.

Shreyas, go for it, will be great.

And UnConed, you can go to higher res of course as the ape should always keep the fps if possible, so it won't limit the resolution you can do with it.

But i recently watched old Presets i did on My Celeron 400 and now they ran on 63 fps and looked all messy unless i reduced the framerate to 20 again.

That should be the purpose of this APE, getting the same effect on each machine no matter which hardware is used.
Magic.X#
I know what you mean, i'm messing with nsis2 for hotlist2.2 since 4 days because i never have more than 1 houre per day for this stuff 🙁

Take your time, but get it done 😉
shreyas_potnis#
ehh, so wait a bit, lemme submit my pack. what is over is : couple of well, something is over. sort of buggy though. crashes winamp for no reason at all, will figure out soon
blazer1504#
naah naah

ooOOh, but I already have a fps limiter.. yup yup, it never gets over 64 fps with this :P You must be jealous as hell 😉 😉
Shock Value#
Heh Blazer same with me. But try opening up Kazaa and clicking the theater tab. This causes the frame rate to be normal on my machine until I close Kazaa for some reason. Some other programs will do this as well, usually ones that have to do with multimedia type stuff. I don't know why this happens, though, or why the frame rate was stuck in the first place.