Skip to content
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

com_maxfps caps fps higher than specified #530

Open
joebonrichie opened this issue Nov 21, 2024 · 2 comments
Open

com_maxfps caps fps higher than specified #530

joebonrichie opened this issue Nov 21, 2024 · 2 comments
Labels

Comments

@joebonrichie
Copy link
Contributor

Describe the bug
com_maxfps caps the fps at a higher rate than specified according to fps 1

To Reproduce
Steps to reproduce the behavior:

  1. Set fps 1 obverse the fps is 90 during gameplay whilst the default value of com_maxfps is 85
  2. Change com_maxfps to 144, obverse the fps is 166

Expected behavior
FPS to not exceed the value of com_maxfps

Screenshots (OPTIONAL)
If applicable, add screenshots to help explain your problem.

Logs
N/A

Version information (please complete the following information):

  • OS: Solus
  • OS Version Rolling
  • OpenMoHAA Version: 48c2d02

Dump (OPTIONAL)
N/A

Additional context (OPTIONAL)
N/A

@smallmodel
Copy link
Member

smallmodel commented Nov 21, 2024

It's an issue that should be addressed upstream: https://github.com/ioquake/ioq3/blob/cc18246f22ab033e1b17af4616a68e9ea2e873db/code/qcommon/common.c#L3119 it's in milliseconds, divide 1000 by 143 or 166, it will always be 6 milliseconds (the higher the value, the less precise it will be). The solution could be to use nanoseconds rather than milliseconds.
To cap to the monitor refresh rate, r_swapInterval 1 can be used instead

@mohaa-man
Copy link

This same "issue" exists with the original game engine, for the aforementioned reason. IOQuake/OpenMOHAA does have an alternative frame timer you can enable if your system timer's resolution within the select() call is too low:

com_busyWait 1

See:
https://ioquake3.org/help/players-guide/

I have found that the swap interval (aforementioned) also actually works (it does not in the original game, at least not in WINE on Linux). I did have to "force" the nVidia driver to sync to the correct display with an env var.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants