Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: FPS Drag Calculator  (Read 848 times)

mirrizin

  • Bay Watcher
    • View Profile
FPS Drag Calculator
« on: August 22, 2016, 05:49:00 pm »

This might be an auxiliary thing to put alongside the game, but has anyone thought about calculating how significantly a given object affects lag? Perhaps one could figure out a unit of lag, and try to work out how much a given condition adds to the total lag, and attach a value of lag units to a given thing.

For instance, a pump stack costs X units per level. An open cavern adds X units per dwarf, etc.

Is this too crazy an idea to float? I feel like it'd be helpful for people who struggle with framerate or are trying to work out what the particular cause of a certain drop is...
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: FPS Drag Calculator
« Reply #1 on: August 22, 2016, 07:24:40 pm »

Main problem is that it's a very variable problem. It would have to be calculated tick-by-tick.

mirrizin

  • Bay Watcher
    • View Profile
Re: FPS Drag Calculator
« Reply #2 on: August 22, 2016, 09:00:53 pm »

Main problem is that it's a very variable problem. It would have to be calculated tick-by-tick.
That's fair. Maybe even a set of categories for known lag-inducers

For instance, this was somewhat inspired by my experience with a sealed-in lycanthrope who got hit with a strange mood. My FPS went from the 40s-60s down to  7 for the duration of the mood until the sad thing went insane.

I'd picked up from the wiki that this was a cause, but I hadn't figured out exactly how much lag it could generate.

This probably isn't something to do in the game itself, but a general list of causes and relative ideas of how much lag each can create might be useful, though I admit it'd be a ballpark thing at best.
Logged

Ghills

  • Bay Watcher
    • View Profile
Re: FPS Drag Calculator
« Reply #3 on: August 22, 2016, 09:59:35 pm »

A consolidated list of major lag-causes would be a good start for troubleshooting. I don't think something that actually tried to calculate an individual game's lag would be feasible though.
Logged
I AM POINTY DEATH INCARNATE
Ye know, being an usurper overseer gone mad with power isn't too bad. It's honestly not that different from being a normal overseer.
To summarize:
They do an epic face. If that fails, they beat said object to death with their beard.

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: FPS Drag Calculator
« Reply #4 on: August 23, 2016, 11:20:58 am »

It'd be good for debugging as well as helping fort last, even if the tool calculating step by step would cause lots of lag itself. Maybe usually off but enabled by setting/for a single hour from menu?

Rataldo

  • Bay Watcher
    • View Profile
Re: FPS Drag Calculator
« Reply #5 on: August 23, 2016, 11:49:41 am »

It sounds like you're taking about what is known as "dynamic code analysis" in software engineering. I haven't worked with many tools to do this first hand, but I know most of the comprehensive ones require it to be integrated into the code itself. Basically it can provide you with info like "60% of the CPU time is being spent in this method" which could be valuable for figuring out what is causing lag.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: FPS Drag Calculator
« Reply #6 on: August 23, 2016, 02:23:41 pm »

You can hook a profiler into the process just fine as of now, but unless the FPS drops are being caused by DFHack or you can read assembly really well that won't help, since you don't get symbols with DF.