dkavolis / Ferram-Aerospace-Research

Aerodynamics model for Kerbal Space Program
Other
80 stars 32 forks source link

Extreme lag with exposure turned on #141

Open abrenneke opened 2 years ago

abrenneke commented 2 years ago

Thanks for keeping this mod going!

So I'm not sure if it's my heavily modded setup or what, but I get extreme and variable lag when exposure is enabled. To get the game to be playable, I have to open the FAR menu, go into Debug, and change Prefer GPU to None, then suddenly the game is playable again. The worst-case I've had is like 2 fps, or even the game just freezing forever (could be unrelated), and it seems to change depending on what ships are near, whether I've switched ships using [ and ], etc.

As far as I can tell this is a main part of the mod... however the place that this is the worst is at a space station... in space... where FAR really shouldn't need to do anything at all.

Maybe the space station parts are incredibly high resolution to render or something? Maybe it's a different mod that's being especially incompatible? I'll look into this more as I get the time and energy.

According to the readme it seems this is disabled by default? It's definitely enabled by default for me 🤔

TurretProblems commented 2 years ago

Also having this exact issue, happens even in stock

uriyuzhui commented 1 year ago

Quick Fix

Disable the exposure debugging should temporarily fix the issue.

To do so, find GameData/FerramAerospaceResearch/FARConfig.cfg, locate Exposure section and set airstream = false, sun = false and body = false.

In addition, sometimes a GameData/Custom_FARConfig.cfg is created which overrides the config file mentioned above, so either apply the same changes or simply delete this custom file.

Root Cause Analysis

Unknown.

But I have narrowed down the entry point to this section where I inserted debugging lines and observed the compute time grew steadily as more scene changes accumulated.

It looked like growing from

[LOG 01:26:18.915] [FAR v0.16.1.1]: 2 renderers have been added and processed in 4ms

after a fresh game start-up, and to

[LOG 01:40:56.488] [FAR v0.16.1.1]: 2 renderers have been added and processed in 131ms

after a dozen of KCT simulations & reverts. Note this is per-frame latency.

Hopefully @dkavolis might have time to look into this.