Jump to content
Eternal Lands Official Forums
Sign in to follow this  
Learner

Framerate cap and anything related

Recommended Posts

I'd like to see being able to limit the client to a maximum frame rate. When it sees that it is drawing the screen more then the specified amount, if it could nap/sleep instead of redrawing or being in a busy loop so that other processes on the client system can get more CPU cycles it would be great.

 

Any other ideas on how to keep a lively client while still being a good CPU citizen would be good to hear.

Share this post


Link to post
Share on other sites

Usually most of the peopl who play games want the max frame rate, so that's why the client is set to use all the CPU. However, when in the console mode, the framerate is limited to about 20 FPS, I guess, so whenever you want to do something in the background, just go to the console mode.

Share this post


Link to post
Share on other sites

I know how many people play their games, but having 120FPS when you are only doing 70FPS scanning is a waste if you want to do something else (like use a web browser to check the items pages of EL for what you need to get next).

Share this post


Link to post
Share on other sites
add 'V-synch' option to synchronize max FPS in client with frequency of monitor.

VSync doesn't really help. That just forces the CPU in a loop that eats CPU time anyway until it gets a command to swap buffers. Also, you will notice the difference between 70 and 200 fps even if your Vsync is set to 60 or so. The graphics may only get updated 60 times per sencond, but everything else (sound, network, input, physics) will update at 200 fps.

Share this post


Link to post
Share on other sites

Hmm, u r teh right :)

Maybe I can do something to limit the FPS, and sleep for the rest of the time. Win98 didn't have any problems with sharing the CPU, but XP feels like Win3.11 :(

I can't run the server and client on the same machine, unless I decrease the client priority (it kills 90% of the server time).

Share this post


Link to post
Share on other sites

You probabely have to take a look at the way MFC apps are made then. MFC apps are message driven. They only use the CPU when they get a message and need to do something.

 

In my experience though you would have to recompile the Windows version with different settings (MFC like. possibly you need to change the code a lot). Even when I create a simple Win32 app that does nothing at all, it still uses 100% CPU in the WinMain() and message loop.

 

Even if there is a command that gives control back to windows in a non-MFC Win32 app, then there is no guarantee that windows will hand back control to EL in time. This could lead to lag, stalling and loss of internet data if you run anything remotely CPU intensive next to EL.

Share this post


Link to post
Share on other sites

If you use peekmessage it won't take that much.

Anyway, the game has to eat all the CPU, in order to give maximal frame rate. If I'll add a limitation, I'll add it in a non platform specific way, i'll just check if there were more than, say, 60 frames this second, and after that I sleep() till next second.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×