Replay lags when switching from player back to observer.

This started happening recently; I believe after the update that caused many mods like Additional Camera Stuff and Random UI improvements to no longer be compatible with the game.

In a replay, and so far only in a replay, whenever I switch to any player, and decide to switch back to observer, the game's fps immediately starts dropping. In my case, it went from 90 to 20 at the start of a match!

Looking in the console, whenever this bug occurs, it starts printing this particular warning at break-neck speeds. Unchecking errors also made the game crash, which is why I'm actually able to provide a text file of the error, instead of a screenshot.

log_extract.txt

I'm unfortunately not knowledgeable enough in how faf works to understand the error, and from past experiences, documentation is non-existent. What the hell is going on in here? If needed, I can provide the entire log (Might have to trim it, as the above error gets looped for over 165000 lines.)

Do you have any UI mods enabled? If so, have you tried watching a replay with no UI mods? I understand it is not ideal, but it helps us narrow down the issue.

A work of art is never finished, merely abandoned

It indeed appears to be a mod problem. I turned off a few I thought were responsible before posting this, but the problem remained. Now, I disabled everything I had, and the problem seems to be gone. Console is clean. I'll narrow the problem down and edit this post once I've found the mod.

Edit: The problem appears to be... UI Party? I'm honestly baffled. It seemed to be the least likely to cause a problem, so what gives? It's also responsible for a very similar error that repeats much slower in the console.

small_log.txt

I have determined the exact option that's causing the error. It's... "Use Alternative Start Sequence"? I am in awe something so innocent-looking could be the problem.

Edit: I played around with the function "AlternativeStartSequence()" in the mods's gamemain.lua. Emptying the function does not fix the problem. Replacing it with the contents of the else statement—the line 84 in particular—did, however. The rest is beyond me, unfortunately. I do not understand why recursively calling OnFirstUpdate(), which seems to call UIP.OnFirstUpdate() every time, results in the replay working properly. I checked that function, and it's completely empty.

Edit 2: And it has to keep calling itself in particular. Making UIP.OnFirstUpdate() call itself in its own function in UI-Party.lua does not fix the problem.

Edit 3: The only fix I can imagine is a workaround, and it's to add a check for if the session is a replay and not trigger the alt start if that's the case. This made me think; if you could also switch between players during a regular match, would this problem appear also? I launched a quick game alone, and no, this does not seem to be the case. The rarely repeating errors that seem to be the prelude to the lag once you flip from player to observer seem to be absent, also.