KSP-RO / TestFlight

KSP Mod that provides a part research and reliability system
42 stars 31 forks source link

Extremely long restart windows cause game freeze #256

Open Capkirk123 opened 1 year ago

Capkirk123 commented 1 year ago

The RO S5.92 and S5.98M engine configs have started freezing the game when they are moused over. This seems to be caused by their extremely long (300 day) restart windows, as removing the restart windows fixes the crashes. This change to RO changing the TF config structure seems to be the cause, these issues started appearing after it was merged, but it doesn't effect any of the restart window patching or logic. Since I'm not entirely sure what's responsible for the issue, I'm just opening the issue here. https://github.com/KSP-RO/RealismOverhaul/pull/2725

lpgagnon commented 1 year ago

n.b. the reason this started happening with RO#2725 is that the TF patches on those two engines were just broken previously; they used the wrong config names and didn't get applied at all (s5.98m vs s5-98m)

jwvanderbeck commented 1 year ago

https://github.com/KSP-RO/TestFlight/blob/99852016fb2ade07937d6aa8d51da2ba6343a2c1/TestFlightFailure_IgnitionFail.cs#L83

Most likely the problem is the code that describes the restart curves is just too slow for so large a restart window

Capkirk123 commented 1 year ago

Oh yeah, those were engines that weren't getting configs applied correctly, in which case the 300 day window was never working in the first place. Unless anyone has any ideas on how to make the code more efficient, it's probably best to just avoid values that large.

MikeOnTea commented 1 year ago

Instead of evaluating a curve over 300 days every 10 ms (!) just to generate descriptions for the UI, what about either implementing some kind of back off or even better, just reading the keys of the curves directly and iterating over them to generate information that's probably good enough?