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

Super slow sleeping near the furniture

Open KHeket opened this issue 1 year ago • 7 comments

Describe the bug

If you sleep near the table/anvil and other furniture - the game will go super slow I think, its because character have lying position image And game checking every turn character

Attach save file

1-trimmed.tar.gz

Steps to reproduce

Load save Sleep in shelter, check, that speed of sleeping is fast Alt+f4 Load save again Move table right to the shelter, like at screenshot below Sleep See slow down of sleeping, and you will need to wait for few minutes

Expected behavior

Normal speed of sleep everytime

Screenshots

lags image

After I move table 1 tile away - the sleeping going by normal fast time image

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19045.5011 (22H2)
  • Game Version: cdda-experimental-2024-10-11-2113 405e875 [64-bit]
  • Graphics Version: Tiles
  • Game Language: Русский <color_dark_gray>(92.2%) [ru]
  • 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], Innawood [innawood] ]

Additional context

No response

KHeket avatar Oct 14 '24 01:10 KHeket

#73552 might be relevant?

osuphobia avatar Oct 14 '24 03:10 osuphobia

/Confirmed

PatrikLundell avatar Oct 14 '24 12:10 PatrikLundell

Loading your save does not give me the game state from your screenshots. I tried with and without your config. I see a big hollow square of pit, and can't drag the table to the left of the shelter because of the pit.

If I drag the table to the north of the shelter, I don't see any difference in sleeping speed, it seems normally fast with and without moving the table.

image

sparr avatar Oct 18 '24 22:10 sparr

If I drag the table to the north of the shelter, I don't see any difference in sleeping speed, it seems normally fast with and without moving the table.

I have performance issue after placing table at any tile near the character sleep place image image image

KHeket avatar Oct 19 '24 09:10 KHeket

When I confirmed the issue I too failed to move the table to the west of the shelter, and ended up dragging it to the north of it instead, which was sufficient to cause the issue to appear. That was done using the master code as it stood at that time (freshly downloaded and compiled).

However, if some people see it and some don't, we might be faced with an OS/compiler issue. The original report, as well as my confirmation, was using Windows and MSVC (I assume the packaged experimentals for Windows are using MSVC, anyway).

PatrikLundell avatar Oct 19 '24 09:10 PatrikLundell

I should have specified. I am using clang on Linux. Another user on Discord who is able to reproduce #73552 is using MSVC.

sparr avatar Oct 19 '24 10:10 sparr

I was trying to profile it, and it seems the time is largely spent in calls to different interpretations of the template cast_horizontal_zlight_segment, in which the time largely is spent in expf, whatever that is (trying to expand that asks for an assembly file). The largest user within the template is the line last_intensity = calc( numerator, this_span->cumulative_value, dist ); which is largely due to it being in a loop over distances within a loop over distance of the outer loop. About 70% of the time was spent in the cast_zlight template (shadowcasting.cpp), which is the caller of the template interpretations above.

I don't know if anyone can draw any useful conclusions of the above, though.

PatrikLundell avatar Oct 19 '24 14:10 PatrikLundell