Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Gosu in Slow-Motion on Windows
- - By ml Date 2015-11-24 18:12
Hello Gosu friends,

Sometimes Gosu runs in slow motion when I install it on Windows.

Can anyone recommend a quick fix or a link to a discussion?

This happens from time to time, when I install Gosu on a random Windows machine such as at the library or an internet cafe.

I have searched the internet and the forums, and I am not finding the solution to this. I assume it is a common issue. It happens on about one out of every five Windows machines I try it on. I tried with Ruby 2.1 and 2.3, and I have seen it happen with older versions of Ruby as well.

Thanks and best wishes to all!
Parent - By jlnr (dev) Date 2015-11-24 19:38
This is usually the symptom of a computer that does not run Gosu with hardware acceleration, caused by outdated graphics drivers. You could try to find other games/demos that use OpenGL for rendering (not Direct3D) and compare.
Parent - - By lol_o2 Date 2015-11-24 19:39
One out of every five? So it even has pattern.
I encountered this problem numerous times, when people just complained on how they can't play my games because of lags. One person even had 1 FPS in game, while I could run with 600 (and 1300 in main menu).
I brought this topic few times here, but so far, there was no solution. I had once a situation when Gosu started to lag suddenly and it was because of bad driver update.
Let's just hope that one day all the problems get fixed somehow. I just started too many projects with Gosu, it's addicting XD
Parent - By ml Date 2015-11-24 23:50
Hi guys! Haha, yes, Gosu is definitely addicting! Thank you both for the suggestions. I will investigate graphics cards and drivers. Glad to hear I'm not the only one with this issue. Technically, it's one in every 4.7 Windows computers. That's the unexpected slow-motion ratio. I will post here if I am able to resolve it.
Parent - - By cichol Date 2016-06-07 04:37 Edited 2016-06-07 11:26
I am experiencing the same issue.

I am making a STG game, when using input(pressing arrow key and Z), there are tiny lags every several seconds. And sometimes it would be in slow motion(cannot reproduce), when you keep pressing keys, it get slower, otherwise it will return to normal.

I believe it is related to Input handling, or it is caused by GC(unlikely) because that inputs will initialize lots of Vector and Bullet.

My environment is Windows 8, Ruby 2.3.0 x86, and I've tested on Ubuntu the demo is working well.

my repo https://github.com/CicholGricenchos/toho-like-rb, use arrow keys to move and Z to fire.

I could upload a video clip later representing the tiny lags if needed.

=============
update:

Here is the video clip and you can see the character is shaking when moving left/right. This issue doesn't show on Ubuntu.

I tried GC.disable, doesn't help this case.

And I tried Ruby 2.1.8/1.9.3 with Gosu 0.9.0 ,it is almost the same.
Attachment: 2016-06-0718-27-33.mp4 (569k)
Parent - By cichol Date 2016-06-07 17:28
I found a misuse consuming a large amount of CPU and disk I/O resource: I used Gosu::Image.open to create image for each bullets, which should be cached in global variables or something.
Correcting this did help a lot, although I still feel a little frame drop, but does not matter (illusion  maybe).

Any further updates would be reported here, thanks!
Parent - By nietzschette Date 2016-06-07 21:55
Key pressing can cause lag simply because, depending on the code, doing so can inject a series of function calls into the update cycle.   I typically work around this by polling for user input in the main thread, appending this to some list, and from that list call functions from a separate thread.
Up Topic Gosu / Gosu Exchange / Gosu in Slow-Motion on Windows

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill