-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option "Unlimited" on frame limiter #324
Conversation
I still don't really like this idea (was proposed a long time ago, #40). Personally, I find it annoying when I'm toggling FPS and suddenly hit 100% CPU usage. Towards your points, I don't believe that this game should be run past 240fps (which already seems high), and it's not the correct way to go for improving input latency. Feel free to argue with me, I'm open to hearing more actual use cases for this. |
Actually i can buy a pretty good 240hz monitor from taobao(an online shopping mall in China) for only 370 bucks. And if the max frame rate of opsu! is 240 fps, it only reach the standard frame rate of the monitor(v sync). And because osu! have this option for a long time and it is pretty stable. I recommend to add this feature. |
I think it would be fine to have it as a setting, but not a keyboard shortcut? E.g. the setting can toggle between vsync, 120, 240 and unlimited, but the shortcut only vsync, 120 and 240 |
I had proposed this because the game logic update and render update are both executing on one thread (AFAIK that's how updating the game's logic and display are implemented on Slick). Any calls to For a long-term solution though, having to separate render and logic updates into different threads would be better. |
that sounds like a pain to synchronize |
@Lemmmy: Okay, that's a good compromise. @Lyonlancer5, if you want to update this PR to do that, I'll accept it. @LovelyA72: I understand, but do you really notice a difference with a >240hz refresh rate compared to 120 or 240 for a 2D game? @yugecin: Do you find that doing that actually helps? And with what kind of framerates / computer specs? I'd be surprised if the Slick2D developers would overlook something as simple as this, which is why I haven't bothered trying it. |
Noted of @Lemmmy's idea. |
"Unlimited" would remain accessible through the Options menu
@@ -399,15 +399,17 @@ public void selectItem(int index, GameContainer container) { | |||
|
|||
@Override | |||
public String getValueString() { | |||
return String.format((getTargetFPS() == 60) ? "%dfps (vsync)" : "%dfps", getTargetFPS()); | |||
return String.format((getTargetFPS() == -1) ? "Unlimited" : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take (getTargetFPS() == -1) ? "Unlimited" :
out of String.format()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted.
} | ||
|
||
@Override | ||
public Object[] getItemList() { | ||
if (itemList == null) { | ||
itemList = new String[targetFPS.length]; | ||
for (int i = 0; i < targetFPS.length; i++) | ||
itemList[i] = String.format((targetFPS[i] == 60) ? "%dfps (vsync)" : "%dfps", targetFPS[i]); | ||
itemList[i] = String.format((targetFPS[i] == -1) ? "Unlimited" : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same as above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, what?
The shortcut function to "Unlimited" has already been removed. Removing this would result in the option "Unlimited" being not displayed on the option's dropdown list, but available via modifying the configuration file's FrameSync
parameter to -1.
@@ -985,7 +987,7 @@ private Options() {} | |||
* @param container the game container | |||
*/ | |||
public static void setNextFPS(GameContainer container) { | |||
int index = (targetFPSindex + 1) % targetFPS.length; | |||
int index = (targetFPSindex + 1) % (targetFPS.length - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment:
int index = (targetFPSindex + 1) % (targetFPS.length - 1); // Skip "Unlimited" option
It actually feels much more responsive when I do that, and I get a bit less 100s (which makes sense because if the time between input polls is too long too much time might already been passed). It might also be a placebo effect (or something weird I did in my code), but to me it feels like it helps. 120 updates/s with 60fps already feels much smoother than 60ups & 60fps. 60fps suddenly doesn't feel like 60fps anymore. osu! (and other rythm games) really need fast input processing, whereas many other types of games may not, so that might be why they don't give options for that. It's probably not a common thing in games to do that actually (not that I know of).
|
Add a comment stating that changes to `index` would skip the last option by default.
Was used when calling `setNextFPS()`, displaying the notification bar when changing the target FPS rate. Not needed anymore since the shortcut call to "Unlimited" has been removed.
Also changed FFmpeg parsing code from 0b36328 (thanks @tpenguinltg). Signed-off-by: Jeffrey Han <[email protected]>
Cleaned up and added in 6449b73. |
Intended for use on benchmarking specific parts of the game, especially during render-intensive scenarios such as during high note densities, testing experimental sliders and the like, but can also be used to decrease input latency by indirectly affecting input polling rate.
Changes to input latency and FPS rates may vary depending on your system configuration.