Cataclysm-dda: The game becomes too laggy when fast-forwarding through time

Created on 20 Jun 2020  ·  16Comments  ·  Source: CleverRaven/Cataclysm-DDA

Describe the bug

PS:I have found that the more things you carry on your backpack, the lager the game is,
whatever the item is, guns ammo food etc. about 150 different items in your backpack,the game becomes obvious lag
When you sleeping or smashing corpses the game will laggy even in early game.It's too slow that passing 30min in game will cost 1-2minutes in real.
By the way,reading or vehicle interface won't laggy like that two above.

Steps To Reproduce

1.start new game.
2.get lots of things in your inventory
3.try to get yourself tired
4.sleep

Expected behavior

Back to normal.

Screenshots

image
This is a two hour cost cbm installation and the timer show how long it takes in real time.

Versions and configuration

  • OS: Windows

    • OS Version: 10.0 1903

  • Game Version: 0.E-3388-gc2cd66c [64-bit]
  • Graphics Version: Tiles
  • Game Language: 系统语言 []
  • Mods loaded: [
    浩劫余生 [dda],
    禁用NPC需求 [no_npc_food],
    C.R.I.T 扩展 [crt_expansion],
    变形怪工业 [blazeindustries],
    大魔法 [magiclysm],
    余波未尽 [aftershock],
    恐龙世界 [DinoMod],
    Zetsukaze's Hair - 0.E EDIT [zets_hair_extensions_undead],
    疯狂大灾变 [crazy_cataclysm],
    神话武术 [MMA],
    移除真菌类怪物 [No_Fungi],
    Fuji的军事职业Mod [fuji_mpp],
    技能提升属性 [StatsThroughSkills],
    敏捷速度加成 [speedydex],
    杀怪提升属性 [stats_through_kills],
    余震个人用强化模组 [After_Shock_Personal_UsageMod],
    无限手套 [Infinity_Gauntlet]
    ]

Additional context

debug.log
I've deleted the original save, but I've made a new one and they exhibit the same problem!
TESTVALI.zip

Performance stale

Most helpful comment

What's interesting is that slowdown disappears if you put container (or drop it) with items in another container - here, I got a video - https://www.youtube.com/watch?v=lDP0_mPj974

Steps:

  1. no starting items
  2. spawn a backpack
  3. spawn a 1000 rings
  4. observe slowdown
  5. spawn giant backpack
  6. take off the backpack with rings - that puts it in the giant one
  7. observe lack of slowdown

Save: Default World.zip
Default world, no mods, build 10802, version 0.E-3656-gabf16ce (tiles) Windows x64

All 16 comments

I have the same problem in my game.
I started with default starting day (60 i think) and now it is summer, day 25.
Time passes VERY slowly when sleeping, installing CBMs, cracking dial safes, etc. To sleep for an 8 hours I have to wait for about 5 to 10 minutes.
But when crafting, time passes like 5min in game time per 2 sec of irl time,
This issue occured right after some update (around 10650, i think), like, everything was fine, time passes at normal rate, then i update the game and got this slowdown.

Last time I did a profile (this was a few weeks ago), 40% of sleeping time was spent inside the function item_pockets::overflow I believe calling the can_contain function, item_pocket.cpp line 1037. This was tested on a save that had a char with loads of containers and items in his inv and around him.

Not sure how this scales based on items, or if thats even accurate any more, since it was a couple weeks ago I did that test, but might be worth looking into.

can you upload your save please, so it can be profiled

can you upload your save please, so it can be profiled

here your are,if you put more things in your inventory,you can feel even more lag.
TESTVALI.zip

40745 would probably help.

i've suffered the same issue on the win10 OS, but not on linux.
I'm not sure but this may be related in how the OS handle the game's data.

Edit: I have a weak machine using dual boot win10/linux so it was actually the same condition in matter of hardware.

What's interesting is that slowdown disappears if you put container (or drop it) with items in another container - here, I got a video - https://www.youtube.com/watch?v=lDP0_mPj974

Steps:

  1. no starting items
  2. spawn a backpack
  3. spawn a 1000 rings
  4. observe slowdown
  5. spawn giant backpack
  6. take off the backpack with rings - that puts it in the giant one
  7. observe lack of slowdown

Save: Default World.zip
Default world, no mods, build 10802, version 0.E-3656-gabf16ce (tiles) Windows x64

Tried again with latest build 10855 (0.E-4297-g3c67e80 (tiles)), as it has #40745.
Nothing changed :(

Save: Default world.zip

With 10874 (0.E-4529-gb82b0cb (tiles)) it doesn't matter anymore if the backpack of rings is equipped - slowdown stays until I drop it.

So, at least that inconsistency is gone now :)

What's interesting is that slowdown disappears if you put container (or drop it) with items in another container

Interesting, it doesn't work for me. Have an old character who wears a survivor suit, in one of pockets of which lies a satchel with 600+ Merches and various cards (cash, scientific, etc). It isn't even possible to move around with any measure of predictability about how much time a turn would take. But drop the pouch on the floor and voila, everything is suddenly fine, game working normally with turns taking approx. same amount of time.

e: aaaand I just now noticed you already mentioned it. Oh well. It's still an issue so I'll leave it here anyway.

This issue occured right after some update (around 10650, i think)

I narrowed it down to a build, but it won't help much, as it was the build (bn. 10615, 0.E-1662-g686104e (tiles)) that brought the pocket system.

Could someone knowledgeable profile saves, please?

Edit: oh, it seems the slowdown isn't there anymore at latest build (0.E-5233-g406f7bb (tiles)) - I'll test it some more and get back in ~10 hours

Edit: ok, as far I can see thousands of items do not trigger the slowdown anymore.

42899 and my own profiling have shown that Character::calc_encumbrance is being decently expensive.

doesn't #40745 cache the encumbrance? or is it still rather expensive?

It caches what degree of the item encumbrance you get due to items contained in it.
It does not cache encumbrance in general.
Here's where we are:
image

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not \'bump\' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

This issue has been automatically closed due to lack of activity. This does not mean that we do not value the issue. Feel free to request that it be re-opened if you are going to actively work on it

Was this page helpful?
0 / 5 - 0 ratings