Game hangs for several minutes when moving items via AIM
Describe the bug
When moving items via AIM to another tile, game freezes and takes several minutes to recover. Happens 100% consistently for me on this save. It's possible it has something to do with NPCs working on disassembly tasks elsewhere in camp but not sure.
Attach save file
Steps to reproduce
Open Advanced Inventory
Press , to move all items to tile at the bottom
Operation hangs somewhere around miscellaneous repair kit and takes several IRL minutes to finish
Expected behavior
Game doesn't hang for a long time
Screenshots
Versions and configuration
- OS: Linux
- OS Version: Distributor ID: Ubuntu; Description: Ubuntu 24.04.1 LTS; Release: 24.04; Codename: noble;
- Game Version: 1240ace [64-bit]
- Graphics Version: Tiles
- Game Language: English <color_dark_gray>(100.0%) [en]
- Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], Slowdown Fungal Growth [no_fungal_growth], Translate Complex Dialogue [translate_dialogue], Stats Through Kills [stats_through_kills] ]
Additional context
Also reproduces on experimental apparently with this save, even though this was tested and filed against 0.H originally
On the experimental version (cdda-windows-tiles-x64-2024-10-18-0902 and cdda-windows-tiles-x64-2024-08-01-0043), the freeze also occurs.
- The freeze occurs at exactly 8:50:00. (the first one, there is a second one: 9:00:00)
- You can just stand there and do nothing.
- The reason is NPCs, as their death gets rid of the freeze.
- Killing NPCs one by one did not reveal the cause. As long as everyone is alive, there is a freeze. If you kill any NPC, there is no freeze.
- 8:50:00 does not match the construction completion time. But canceling the construction, gets rid of the hang.
- Canceling construction one at a time:
- Whitney and Jules. There is no freeze. (Jules may have one, but less than a second).
- Tom. Freeze duration reduced to 2-3 seconds.
- Spawning tools for tasks: Each NPC has its own tool: firearms repair kit. The duration of freezing reduced to 2-3 seconds.
Presumably the problem is finding the tool? But why at about 60% completion of the job? Or does the instrument check, similar to vitamins, occur at the end of an interval of 10 minutes?
Okay, sounds like any fix should go in main and be backported
I have similar issue. Whenever AIM displays misc repair kit, every interaction could take seconds and transferring multiply items could take minutes. This is because to write number of charges for misc repair kit game rescans nearby area and recalculates number of available duct tape - thousands of items stored nearby will tank performance. As a workaround, misc repair kit stored in any container doesn't display charges.
Whenever AIM displays misc repair kit, every interaction could take seconds and transferring multiply items could take minutes. This is because to write number of charges for misc repair kit game rescans nearby area and recalculates number of available duct tape - thousands of items stored nearby will tank performance.
Quick thought - we could cache misc repair kit items per tile, then update only tiles. Summing up would be much easier. I don't know how much work would have to go into that and how much code it would create.