[1.2.2747] Caravan auto-supply calculations cause the UI to lag.

Started by AileTheAlien, September 05, 2020, 07:38:25 AM

Previous topic - Next topic

AileTheAlien

The new caravan auto-supply calculations lag out the UI, when you're checking or unchecking pawns to send. The slowness scales with number of pawns, and number of kinds of different caravan-supply items. (This will more heavily affect modded games, that add more different caravan-supply items. Medicines, foods, etc.) This one's easy to verify:
1. Start a new game.
2. Verify form-caravan screen isn't laggy.
3. Spawn pawns.
4. Check again.
5. Spawn many different kinds of food, all three types of medicine, and many different quality-levels of sleeping bad.
6. Verify game UI is slow to update, when checking and unchecking pawns to send on caravan.
7. Repeat as necessary with different combinations of the above, to profile the speed decrease.

Mr_Fission

https://ludeon.com/forums/index.php?topic=52783.0

I reported this as well, but forgot to supply a savegame, so it got buried.  I'm actually surprised that only the two of us have reported this so far.

AileTheAlien

Might as well answer the questions from the original thread: no save, because this can be checked by spawning in items on a fresh game. Verified it by disabling all mods except for the Royalty DLC, then again with Royalty disabled (only Core). Animals don't seem to affect the slowness; I had about 15 muffalos spawned and tamed, with about a dozen or so types of meat, meals, raw corns, rice, and medicine spawned (that took a while to spawn in...), but only noticed slowness this last time after I spawned a dozen colonists.

Quote from: Mr_Fission on September 06, 2020, 03:09:12 PMI'm actually surprised that only the two of us have reported this so far.
The streamers I've seen, plus the few friends I have who play, have overkill computers, that can run the game with large map sizes and dozens of colonists. I've got a Udoo Bolt, which is miles better than the min specs listed in Steam, but much slower than that. Plus many people won't immediately report a bug or defect. :)

EDIT:
This is really weird, because in my normal game, there's far fewer types of meals and supplies, than what's needed to reproduce this with a new game. Possibly affected by health conditions...?

Mr_Fission

I don't think hardware matters.  I've got an intel i9-9900, 32 gig ram, and an nvidia 2080 and I still get lag from forming even small caravans.

I don't think health conditions matter.  It seems to be an exponential increase in lag between each "X" that gets checked when adding any people, animals, or items that changes caravan weight in any way.

The problem is that the feature is running what is probably a very long and complicated chunk of code each time you check any new item that changes weight.

Pheanox

I have tried to mimic what you were saying, if you lok at this screenshot I have a ton of meat and corn (rice/medicine was already loaded), with 16 animals and 10 colonists.  I have experienced no lag with this, is there something more I should add on to it or do to try and get this lag to appear?

AileTheAlien

The amount of food doesn't matter; Fifty meat or 10 thousand will act the same. The number of different kinds of travel-items is what it appears to scale with. For example, in the attached screenshot I've spawned about 10 kinds of meat, simple, refined, and lavish meals, all three medicines, rice, corn, insect jelly, and chocolate. Interestingly, the lag starts out at zero, then increases as I check more colonists to come on the caravan, by click-dragging through the line of pawns, on the caravan screen. (Seems like about 0.2 seconds per click, by the end of the line.) It speeds back up in the reverse too - with all colonists checked, as I click-drag through the line of checkmarks, it gets less laggy as fewer colonists are checkmarked. Attached the save for this.

Pheanox

So the lag you experience isn't actually in game with them gathering, it's with you selecting everything for the caravan, in the caravan screen?

I think I got it, thanks for the help.