erdelf / AlienRaces

Rimworld mod alien race framework
MIT License
103 stars 69 forks source link

Colonists selection in caravans can get very laggy #44

Open partisan-terran opened 3 years ago

partisan-terran commented 3 years ago

UI becomes less responsive to left clicking the mouse and dragging through the colonist list. As a result, some colonists are skipped, or the selection doesn't initiate due to left click not being registered.

The conditions are not fully clear, yet I confirmed it's related to this mod (possibly race mods make it worse). If this happens, it's going to be worse with the number of colonists. It's not required though, as I had one game with a handful of colonists and big lags regardless. However, I can't reproduce it with a new game where I just make a bunch of wanderers join.

Here's the log from one of the games, where I did tests specifically with this mod and without it https://pastebin.com/Wgr0Qat7. That game wasn't started with it. I also validated that removal of practically all other mods (besides Harmony etc.) doesn't change it. Here's the save file Mecha Explorers (Permadeath).zip.

Here's the log from another game, where I haven't done extensive tests, but where it lags even with handful of colonists https://pastebin.com/jRFBCKSq. Here's the save file Lava Explorers (Permadeath).zip.

marr75 commented 3 years ago

Most caravan lag has to do with the recursive calculations necessary to figure out how much food is left based on the consumption of every caravan member, the rules about what they can eat, how much that fills them up, and how much each of them can forage. I've experienced the exact same thing as you, and yes, not using race mods will make this faster because the "what can you eat" calculation will be faster. Maybe even more powerful, though, is to use the "CaravanOptions" mod and use the mod options to turn foraging all the way down. It's a little bit of a disadvantage because you won't be foraging on the way (your herbivores should still be able to graze) but it fixes slowdown for any UI element that shows how many days of food are remaining.

The other fix I found was to uncheck the box that automatically picks survival supplies (the third tab) until you've set the caravan up. Recalculating happens live while you're picking caravan members, with no debouncing otherwise.