jordanmchavez / kdm-tts

Source for my Kingdom Death: Monster mod for Tabletop Simulator (https://steamcommunity.com/sharedfiles/filedetails/?id=2112101994)
MIT License
26 stars 25 forks source link

99540 nil color values in XML, possibly causing slow load times #11

Open salmelo opened 2 years ago

salmelo commented 2 years ago

I've noticed the mod takes a bit to get going even after all the assets are loaded in. Maybe an extra 10-20 seconds or so. When I loaded a save with logging turned on it took a very long time, multiple minutes, and then the chat said [XmlLayout] Warning: 'nil' is not a valid Color value. <99540>. I believe writing all ~10k errors to the log file is probably what slowed it down so much more. I don't know if they're related to the normal slow load, but I assume they aren't good.

jordanmchavez commented 2 years ago

Starting the mod with logging, especially XML logging, is going to be very slow. Sending a lot of simultaneous log statements in a single frame is very very slow in TTS, and the XML logging does all of that on the very first frame.

Starting without logging, the survivor board added last major update is causing the additional load time. It's because of the massive XML UI we're creating all at the beginning. Unfortunately there's not much we can do about this unless TTS decides to make their XML UI loading faster. The only way to make it faster would be to display fewer survivor slots, or reduce the amount of stuff we show on each slot, neither of which I'm willing to sacrifice.

jordanmchavez commented 2 years ago

On second thought, I'll leave this open and double check that there's not some misuse of the UI code during init that's causing the slowness.