Is your game "slightly" jerky, jumpy, or shaky? Here's a fix!

Started by
30 comments, last by oxygen_728 20 years ago
I worked for a few hours trying to solve the "jumpiness" of my game. It was only slightly jumpy... and I could not figure out what the deal was... Sure enough, when I put this one line of code in: SetPriorityClass(process handle, priority); // SetPriorityClass(hInst, HIGH_PRIORITY_CLASS); // code for me My game went from jumpy to smooth. ARG WINDOWS #()$&(#&$)(#&)($*)(#&$
Advertisement
What was jerky, jumpy, or shaky about it? Were you using time-based movement?

edit: from MSDN:
quote:
MSDN
Process that performs time-critical tasks that must be executed immediately. The threads of the process preempt the threads of normal or idle priority class processes. An example is the Task List, which must respond quickly when called by the user, regardless of the load on the operating system. Use extreme care when using the high-priority class, because a high-priority class application can use nearly all available CPU time.


[edited by - Fuzztrek on March 29, 2004 9:05:03 PM]
Setting the process to high priority is not a very good idea. It will cause more problems than its worth. This isn't like the days of DOS when you could make your game use near 100% of the CPU time and get away with it. You need to make your app work nicely with other apps and with the OS. Otherwise, your typical user will think your program is bad because everytime they run it, Windows becomes very sluggish, and they won't know why, other than your program is bad. The better way to remove the jumpiness is to optimize the app, not use brute force.

[edited by - Mastaba on March 29, 2004 9:27:07 PM]
.
still its not an idea with out merit, if your game is full screen how much else on windows can they be using, and even so you could lower the piority when they alt tab out
I always try to do other things while gaming. I can''t stand how Unreal Tournament is a processor hog, so I play counter-strike instead most of the time.

If your game is small, the problem is probably in your algorithms/code. Maybe if you could figure out the bottleneck we could provide some solutions. You may be performing too many resource allocations, etc.

Brian J
Brian J
"I always try to do other things while gaming."

what the, huh? Then why are you gaming at all?
quote:Original post by 2dcoder
"I always try to do other things while gaming."

what the, huh? Then why are you gaming at all?


If the game is windowed, you can easily chat/browse the web, etc while playing most types of games.
My game is a little jerky, but i think it has something to do with my main loop and how it sleeps. I use this:

// Start of looplong startTime = GetTickCount();// End of looplong processTime = GetTickCount() - startTime;        while( processTime < 1000/MAX_FRAMERATE ) {            Sleep( 1 );            processTime = GetTickCount() - startTime;        }  


I render a (D3DX)Font object, moving it across the screen at a constant speed (2pix/frame). It jerks by about 1 or 2 pixels more than it should every half a second or so. If I decrease MAX_FRAMERATE to about 40 it seems to stop it (I have it at 60 normally). Has anyone else had this, or does anyone know how I should fix it (setting thread to high priority doesn't work either, not that I wanted it to)

[edited by - red_sodium on March 30, 2004 2:27:32 AM]
"Learn as though you would never be able to master it,
hold it as though you would be in fear of losing it" - Confucius
quote:Original post by 2dcoder
"I always try to do other things while gaming."

what the, huh? Then why are you gaming at all?


if you''re not a very good player you will spend most your time being dead anyway... =P ( I get lots of reading done while playing CS )
I''ve always had this in games (mine and other peoples'') with things smoothly scrolling. I finally decided it was psychological/physiological (my problem, not the machine''s). Try focussing on one fixed spot (put some whiteout on your monitor or something ) and see if the jumpiness goes away. It did for me.

This topic is closed to new replies.

Advertisement