Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Large FPS differences depending on what I'm looking at  (Read 6292 times)

Arkangel

  • Bay Watcher
    • View Profile
Large FPS differences depending on what I'm looking at
« on: December 25, 2014, 11:50:42 am »

I'm experiencing vast differences in frame rate when looking at different things. Window size also appears to have a large effect. Some stats on a new embark (4x3):

Embark site: 140 FPS (maximized), 500 FPS (default window size)
Sky (max z-level, 5 above ground): 66-67 FPS (maximized), 360 FPS (default window size)
Below ground (everything black): 480 FPS (maximized), 500 FPS (default window size)

This behaviour seems very odd to me, I didn't think whatever the view is pointed at should have any effect on performance unless it's a graphical issue. Can anyone shed some light on this?
Logged

fourthgeek

  • Escaped Lunatic
    • View Profile
Re: Large FPS differences depending on what I'm looking at
« Reply #1 on: December 25, 2014, 12:05:16 pm »

Unless DF runs a more detailed game simulation for objects that you are looking at, then it is probably related to rendering. Try configuring DF to run in fullscreen and see what that gives you. Games can often run faster in fullscreen rather than windowed.

Without PDB files it's very difficult to determine just what the game is doing at any particular moment. If you are technically minded then you could try analyzing DF with Windows Performance Toolkit.
Logged

Pirate Santa

  • Bay Watcher
  • [CURIOUSBEAST_EATER]
    • View Profile
Re: Large FPS differences depending on what I'm looking at
« Reply #2 on: December 25, 2014, 06:49:43 pm »

How do you configure for fullscreen?
Logged
Welcome to Dwarf Fortress. Where peaceful death of old age is something nobody sees coming.
it turns out Dog Bone Doctors aren't very good at doctoring.

utunnels

  • Bay Watcher
  • Axedwarf
    • View Profile
Re: Large FPS differences depending on what I'm looking at
« Reply #3 on: December 25, 2014, 07:04:01 pm »

It is normal. And I'm sure the multilevel rendering has something to do with that.
Basically if you are on a higher level you "see" more things so your computer takes more time to render them.
Logged
The troglodyte head shakes The Troglodyte around by the head, tearing apart the head's muscle!

Risen Asteshdakas, Ghostly Recruit has risen and is haunting the fortress!

Arkangel

  • Bay Watcher
    • View Profile
Re: Large FPS differences depending on what I'm looking at
« Reply #4 on: December 25, 2014, 08:50:36 pm »

Unless DF runs a more detailed game simulation for objects that you are looking at, then it is probably related to rendering. Try configuring DF to run in fullscreen and see what that gives you. Games can often run faster in fullscreen rather than windowed.

Some more stats for fullscreen mode: 110 FPS at both embark and sky level, 200 FPS below ground

How do you configure for fullscreen?

In init.txt:
"This lets you set the starting windowed/fullscreen setting.  Can be YES, NO or PROMPT.

[WINDOWED:NO]"

It is normal. And I'm sure the multilevel rendering has something to do with that.
Basically if you are on a higher level you "see" more things so your computer takes more time to render them.

Well, yes, obviously more stuff to see means more rendering time, I was just surprised it had such a massive (at times) impact on the FPS DF can manage, since FPS here doesn't relate to actual frame rate but "steps per second". This just feels very odd to me, but maybe I'm just looking at it the wrong way.
Logged

utunnels

  • Bay Watcher
  • Axedwarf
    • View Profile
Re: Large FPS differences depending on what I'm looking at
« Reply #5 on: December 25, 2014, 09:02:05 pm »

There are actually two fps numbers on screen, one is your logic update rate, the other is screen update rate. It is the first number really matters.
Logged
The troglodyte head shakes The Troglodyte around by the head, tearing apart the head's muscle!

Risen Asteshdakas, Ghostly Recruit has risen and is haunting the fortress!

Arkangel

  • Bay Watcher
    • View Profile
Re: Large FPS differences depending on what I'm looking at
« Reply #6 on: December 25, 2014, 09:12:39 pm »

There are actually two fps numbers on screen, one is your logic update rate, the other is screen update rate. It is the first number really matters.

I'm sorry, I seem to not be getting my point across, probably to the dual meaning of FPS in this context. I'll use logic/screen update from now on, as you have.
My issue is, I am seeing significant variation in logic update rate when looking at different parts of the map and/or resizing the game window or playing fullscreen. This confuses me somewhat, as I did not expect rendering time (or whatever it actually is that's causing the slowdown) to affect the logic update rate in any meaningful way at all, much less to such an extreme degree.
Logged

utunnels

  • Bay Watcher
  • Axedwarf
    • View Profile
Re: Large FPS differences depending on what I'm looking at
« Reply #7 on: December 25, 2014, 09:21:47 pm »

I have no idea.
Are you using dfhack+twbt? Maybe you can try starting the exe without dfhack to see if there are big differences.
Logged
The troglodyte head shakes The Troglodyte around by the head, tearing apart the head's muscle!

Risen Asteshdakas, Ghostly Recruit has risen and is haunting the fortress!

tussock

  • Bay Watcher
    • View Profile
Re: Large FPS differences depending on what I'm looking at
« Reply #8 on: December 25, 2014, 10:50:01 pm »

At ~500 FPS you're running mostly from L3 cache. At ~120 FPS there's enough data processed every frame that it's got to cycle through stuff from main memory, and at ~70 FPS you're getting into ever more cache turnover. The fortress is at least hundreds of MB of data and the more of it the display function reads for information, the more you run out of cache.

Plus, df is drawing the screen on the CPU, which with a big enough screen is outputting a lot of MB per frame and may be getting somewhere near the limits of your main bus speed. It's the main reason most games switched to GPUs for all that a couple decades ago.

As a helpful hint: switch your G_FPS_CAP in data/init/init.txt to 30 (or some neat fraction of your screen refresh rate). You'll more than double your game logic rate when constrained by graphics, and hardly notice any difference by looking.
Logged

Ancalagon_TB

  • Bay Watcher
    • View Profile
Re: Large FPS differences depending on what I'm looking at
« Reply #9 on: December 26, 2014, 11:35:17 am »

I have noticed something like this too.  I often get 30 FPS (I have a laptop :/) in the mine level but only 20 FPS on the surface.  The surface (with the river, the trees etc) seems to demand more computer resources than the average fortress level.  I am unsure why this is.
Logged
hamster cheese supplies are low

omega_dwarf

  • Bay Watcher
  • Adequate Architect, Dabbling Modder
    • View Profile
Re: Large FPS differences depending on what I'm looking at
« Reply #10 on: December 26, 2014, 11:50:52 am »

At ~500 FPS you're running mostly from L3 cache. At ~120 FPS there's enough data processed every frame that it's got to cycle through stuff from main memory, and at ~70 FPS you're getting into ever more cache turnover. The fortress is at least hundreds of MB of data and the more of it the display function reads for information, the more you run out of cache.

Plus, df is drawing the screen on the CPU, which with a big enough screen is outputting a lot of MB per frame and may be getting somewhere near the limits of your main bus speed. It's the main reason most games switched to GPUs for all that a couple decades ago.

As a helpful hint: switch your G_FPS_CAP in data/init/init.txt to 30 (or some neat fraction of your screen refresh rate). You'll more than double your game logic rate when constrained by graphics, and hardly notice any difference by looking.

I love this explanation. I have a gaming laptop, and I've lowered G_FPS_CAP to like 10. Barely noticed the difference except for the massively accelerated calculations per second. Interesting to think that my large screen (1980x1020) could be the cause of my woes on this laptop...

Edit: in fact, I'm gonna sig that.

damnit,urist,youhadonejob

  • Bay Watcher
  • ugh don't build your self on that side of the wall
    • View Profile
Re: Large FPS differences depending on what I'm looking at
« Reply #11 on: December 27, 2014, 05:39:21 am »

thank you. i can now play this game and actually feel like i am playing it
Logged