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

Empty game runs too slow on Windows #8100

Closed
James103 opened this issue Apr 26, 2020 · 8 comments
Closed

Empty game runs too slow on Windows #8100

James103 opened this issue Apr 26, 2020 · 8 comments

Comments

@James103
Copy link
Contributor

@James103 James103 commented Apr 26, 2020

Version of OpenTTD

1.10.0 and 20200426-master

Expected result

Simulation rate: ~33 fps (expected 33.33 fps)
Graphics frame rate: ~33 fps (expected 33.33 fps)

or

Simulation rate: ~30 fps (expected 30 fps)
Graphics frame rate: ~30 fps (expected 30 fps)

Actual result

Simulation rate: ~30 fps (expected 33.33 fps)
Graphics frame rate: ~30 fps (expected 33.33 fps)
Game speed factor: ~0.90x

CPU, GPU usage is <10% and tick times are <1ms (on an i5-9400F running at ~1.5 GHz)
image

Steps to reproduce

On a fast enough computer, perform the following:

  1. Open a new game.
  2. Open the FPS window (Help > Show frame rate)
  3. Observe the stats
@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Apr 26, 2020

OS? Game resolution? Screen resolution? Blitter? Multimonitor or single monitor? Any OS colour management in effect?

@James103
Copy link
Contributor Author

@James103 James103 commented Apr 26, 2020

Here is my OpenTTD config:
openttd-cfg.txt

Win 10 Home, 1080p (single-monitor)

@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Apr 26, 2020

Can you try joining a multiplayer game on a remote server, ideally on a small-ish map with no or very few other players, and check what framerate you get?
Also see if the simulation seems to be playing catch-up in some way, e.g. appears to run normally (or slightly slow) and then suddenly run several frames at once.

In multiplayer mode the game should lock on to the server's rate and run that regardless of the timing otherwise used in local play. For that reason you will often see 32.9 fps on Windows in local play, but 34 fps on the same Windows machine joined a server running on Linux.

@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Apr 26, 2020

Also, try running a dedicated server on your own machine (run openttd.exe with the `-D´ commandline switch) and check what the rate it with the fps command. If the rate then is correct, try joining the server and see if that affects the rate.

@nielsmh nielsmh changed the title Inconsistent target framerate (30 vs 33 fps) Empty game runs too slow on Windows Apr 26, 2020
@James103
Copy link
Contributor Author

@James103 James103 commented Apr 26, 2020

Running a dedicated server and connecting to it returns framerates anywhere from 25 to 28 frames per second (average of 26 fps), or about 75-80% normal speed (average of 78%).
image

Additionally, "Brodong's OpenTTD Sandbox" runs at almost exactly 1/2 speed, or about 17 ticks per second.

@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Apr 26, 2020

Is this a portable or a desktop computer? If it's a portable, is it running on battery power or on charger?

Can you try screenshotting (or recording) the Game loop total timing graph on that multiplayer server where the game runs half speed?

@James103
Copy link
Contributor Author

@James103 James103 commented Apr 26, 2020

Static image including last 5 seconds of game ticks:
image

The computer is a full desktop computer with no noticeable battery, but the CPU speed adapts to the load. The higher the load, the higher the CPU speed (up to 3.9 GHz).

@James103
Copy link
Contributor Author

@James103 James103 commented Jun 6, 2020

I can't seem to reproduce this. I'm getting 32-33 fps on an empty game, on Windows 10 Home 10.0.18363 Build 18363. Therefore, I will close for now.

@James103 James103 closed this Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants