Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Andre Luiz Silva

Windows Vs. My Game

This topic is 6699 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

While I''m running my 2D game, sometimes Windows start doing some background jobs, writing to/reading from the hard disk, and while Windows is on it my frame rate drops or even worse - my game stops for some milliseconds and then returns back to normal. Is there a way to stop or minimize it? I think so, because when I play commercial games (Unreal, for example) I''ve never noticed something like that. Thanks, André Luiz Silva "There is no knowledge that is not power"

Share this post


Link to post
Share on other sites
Advertisement
I don''t know how to do it in code, but to stop Windows from randomly screwing around with the cache, set your cache minimum and maximum both to 2.5 times the amount of RAM you have. It''s in the System dialog somewhere. That should stop it from resizing.


Lack

Christianity, Creation, metric, Dvorak, and BeOS for all!

Share this post


Link to post
Share on other sites
Perhaps you are accidently allocation and/or deallocation a lot of memory and windows needs to resize the swapfile often...
you can set the virtual memory to a given size like LackOfKnack said. press [Windows-key]-[Pause] and click on the most right tab.

Share this post


Link to post
Share on other sites
You could call SetPriorityClass (at least I think thats the call). I personally dont advocate using it though, as Windows programs should share resources (even at the detriment of performance).

If you do chose to use it, a word of advice: don''t use the realtime priority class unless you think it''s neccasary to halt up OS tasks!

--TheGoop

Share this post


Link to post
Share on other sites
I''m a big supporter of using SetPriorityClass and SetPriorityThread. In my game, I''m doing absolutely no memory allocation or disk access during a level, yet Window''s would butt in every so often and I''d lose 1 to 10+ frames. I can''t see any other way of keeping Window''s in line, and lets face it, the user shouldn''t really be running background stuff when playing games. Just make sure you set the priority low when they alt-tab out of the game, or use some other way to do nothing until the game is restored.

Rock

Share this post


Link to post
Share on other sites
First of all - thank you all...

LackOfKnack/Ridcully: if I choose to change my virtual memory settings, I would have to recommend it to everyone who wants to play my game. And I am using about 2 MB of memory to store artwork, what give about 14 MB''s of video avaiable video memory.

nullpointer: I understand what you said, but that''s not the case

TheGoop/Rock2000: I will try to use it. And I agree with Rock2000 about playing and running background stuff.

If you have any other suggestions, please let me know...

Thank you all


André Luiz Silva
"There is no knowledge that is not power"

Share this post


Link to post
Share on other sites
Never change your priority to Real-Time, or anything from the default. This is only for drivers, not applications.

Read msn''s rant in the mail bag or whatever section it is for more information on that.

-Dan Smith
dans@3dgamedev.com

Share this post


Link to post
Share on other sites
What''s a good class-priority setting, if not using real-time?
I''m doing:

HANDLE hProcess, hThread;

hProcess = GetCurrentProcess();
hThread = GetCurrentThread();

SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS);
SetThreadPriority(hThread, THREAD_PRIORITY_HIGHEST);


And it magically removes all my on-screen jitters.

Share this post


Link to post
Share on other sites
I''m not looking for a flame war or anything, so I''ll keep this brief.

Dont set your priority. Your doing something wrong if you have to set the priority like that. You will run into problems doing it later on, you may not on your system - but you will eventually.

Bottom line is, dont do it. Pretend you never heard of the API call for that.

-Dan Smith
dans@3dgamedev.com

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!