Lag when scrolling backgrounds/moving

Started by Izman, October 16, 2012, 03:06:00

Previous topic - Next topic

Izman

Sorry, just re-read your answer and I think I understand it now.

I'm going to be busy for a little bit, so I'll report back with the results in a bit.

Izman

Okay, so initially I thought it was a refresh rate issue, because the monitor on the Mac could handle 75Hz and, when using 75Hz and setting the game to 60Hz (via DisplayMode), it would recreate the issue I'm facing on my Windows machines.  However, after properly implementing refresh rate selections, I can't seem to recreate the issue.

I also removed the setTitle() from the game loop, it didn't really do much.

Quote from: broumbroum on November 09, 2012, 07:48:22
Try to not access any of the awt member functions within the gameloop thread.

What exactly is meant by this?  The awt classes I'm using are:

awt Font (for slick-util)
awt Rectangle (for collision detection via .intersects())

Do these really have a great effect on the performance?  I can probably find work arounds for these, but there's no point if I can't notice a difference.

broumbroum

Good to know you sorted it out!
Further more about the awt member function I'm pointing out, they involve the event dispatcher thred EDT. Each awt function that modifies the UI or looknfeel must but don't everytime need to synchronize with it. E.g. On Windows its the AWT-Windows thread that can make the UI update. Look for EDT across the forum, I should have found more about.

Izman

Quote from: broumbroum on November 13, 2012, 07:57:12
Good to know you sorted it out!

Sorry, I probably wasn't clear.  Windows still performs like ass with windowed vertical sync :( I was mostly talking about my Mac in the post above.

Quote from: broumbroum on November 13, 2012, 07:57:12
Further more about the awt member function I'm pointing out, they involve the event dispatcher thred EDT. Each awt function that modifies the UI or looknfeel must but don't everytime need to synchronize with it. E.g. On Windows its the AWT-Windows thread that can make the UI update. Look for EDT across the forum, I should have found more about.

Okay, thanks for the information :)

--

Recap:

I feel like this is an issue with refresh rates.  When the Windows machine runs the game in fullscreen + vsync, it's a solid 57 FPS (which seems strange), but it doesn't lag at all.  In windowed mode however, lag exists at the lower framerates (60ish) but diminishes exponentially as Display.sync() is increased.  60 FPS by Vertical Sync "lags" noticeably more than 60 FPS by Sync().

I'll start removing AWT classes in general, but until then, any ideas?

Izman

Funny enough, I installed a Windows XP bootcamp on the Mac with the NVIDIA 9400M, and it ran perfectly with vertical sync...

Looks like the issue might lie with Windows 7/HD 6850...