Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Game hangs for several minutes when moving items via AIM

Open harakka opened this issue 1 year ago • 4 comments

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

Mutagen hunt-trimmed.tar.gz

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

image

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

harakka avatar Oct 18 '24 17:10 harakka

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.

  1. The freeze occurs at exactly 8:50:00. (the first one, there is a second one: 9:00:00)
  2. You can just stand there and do nothing.
  3. The reason is NPCs, as their death gets rid of the freeze.
  4. 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.
  5. 8:50:00 does not match the construction completion time. But canceling the construction, gets rid of the hang.
  6. 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.
  1. 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?

IdleSol avatar Oct 18 '24 19:10 IdleSol

Okay, sounds like any fix should go in main and be backported

harakka avatar Oct 20 '24 09:10 harakka

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.

MikasaTanikawa avatar Dec 03 '24 08:12 MikasaTanikawa

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.

Brambor avatar Dec 03 '24 09:12 Brambor