Page 1 of 1

Very weird google chrome issue with game.

Posted: Thu Jun 13, 2013 8:03 pm
by like80ninjas
I was writing up an engine the same way I always do but this time something odd is happening.

I'm using SFML and setting my framerate limit to 60.

When google chrome is open my game gets 60 fps, or whatever I set it to.
When google chrome is closed my fps goes to about half of whatever I cap it to.

My compiler is Visual C++ Express and I literally just started this new engine,
so all I have is a window and some basic sprite stuff.

I can't figure this out at all, so if anybody knows the magic reasoning behind this I'd appreciate the help!

Re: Very weird google chrome issue with game.

Posted: Thu Jun 13, 2013 8:19 pm
by dandymcgee
Wait what?? Closing Google Chrome makes your game run slower? Is it's a web-based game? That makes zero sense.

Re: Very weird google chrome issue with game.

Posted: Fri Jun 14, 2013 10:42 am
by like80ninjas
Yes, I am just as confused as you are.

It's c++ SFML and OpenGL only.

Also, it is very simple code, just bringing up some basic sprites to draw, not a whole game.

If Chrome is closed it will run at 30fps with SFML frame limiter set to 60.

With Chrome open it runs at 60fps with SFML frame limiter set to 60.

Basically with chrome closed I get 30-50% frame rate.

Re: Very weird google chrome issue with game.

Posted: Fri Jun 14, 2013 3:12 pm
by Falco Girgis
How are you limiting your framerate?

Re: Very weird google chrome issue with game.

Posted: Fri Jun 14, 2013 10:18 pm
by like80ninjas
I'm using an SFML function in the window class called something like "setFramerateLimit( int limit )".
It seems that this function uses a clock to count the time and then Sleeps the remainder of the frame using the OS.

Re: Very weird google chrome issue with game.

Posted: Sat Jun 15, 2013 10:53 am
by dandymcgee
Have you considered packaging Chrome as a prerequisite with your game's installer? Everyone should be running Chrome all the time anyway. ;)

Re: Very weird google chrome issue with game.

Posted: Wed Jul 10, 2013 12:10 pm
by bbguimaraes
Sorry to revive a semi-dying thread, but I just found this. Basically it says some applications on windows (like google chrome) lower the (global) timer interrupt interval when they are running, which may cause the behavior you're seeing.

Re: Very weird google chrome issue with game.

Posted: Wed Jul 10, 2013 12:50 pm
by dandymcgee
bbguimaraes wrote:Sorry to revive a semi-dying thread, but I just found this. Basically it says some applications on windows (like google chrome) lower the (global) timer interrupt interval when they are running, which may cause the behavior you're seeing.
Wow, nice research.

Re: Very weird google chrome issue with game.

Posted: Thu Jul 11, 2013 1:40 pm
by Falco Girgis
Interesting as shit. Sounds like a driver issue with SFML. For framerate limiting, they should be ensuring the global timer interrupt interval is frequent enough to achieve the desired framerate.