Jump to content
  • Advertisement

Archived

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

oxygen_728

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

This topic is 5286 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

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 #()$&(#&$)(#&)($*)(#&$

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 loop
long startTime = GetTickCount();

// End of loop
long 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]

Share this post


Link to post
Share on other sites
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 )

Share this post


Link to post
Share on other sites
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.

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!