Archive: Framerate Limiter - Request to UnConeD


14th May 2003 12:09 UTC

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!


14th May 2003 21:25 UTC

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'.


15th May 2003 12:09 UTC

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.


15th May 2003 14:29 UTC

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


15th May 2003 21:27 UTC

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).


16th May 2003 11:57 UTC

I cant imageine that it would cause delays ina an other way than desired. But that would have to be tested.


17th May 2003 07:06 UTC

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.


18th May 2003 09:30 UTC

hang on...this one is quite an easy one, i can do it.
so, should i?


18th May 2003 12:26 UTC


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.

18th May 2003 14:55 UTC

great, but should i make an ape for it?


19th May 2003 02:31 UTC

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...


19th May 2003 03:18 UTC

Or 1024 x 768, i love teh new processor :D


19th May 2003 03:29 UTC

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.


19th May 2003 04:47 UTC

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.
:eek: 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...)

19th May 2003 11:55 UTC

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.


20th May 2003 16:17 UTC

ok, gimme some time because i am not that free these days :)


22nd May 2003 11:56 UTC

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 ;)


23rd June 2003 16:05 UTC

Erm Shreyas, any progress made?


23rd June 2003 17:05 UTC

Yes i'm waiting for it too


23rd June 2003 18:55 UTC

/sigh. he will post it when it is ready. there is no need to revive dead posts


24th June 2003 16:35 UTC

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


25th June 2003 10:12 UTC

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 ;) ;)


28th June 2003 07:02 UTC

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.