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

Big performance loss during the game

Open KHeket opened this issue 1 year ago • 2 comments

Describe the bug

While I making somthing like crafting, reading or somthing else at my base - the game running slower, than I make similar thing far from my base And I didnt have so much lags 1-2 months ago even when I place solar panels and few freezers with food I dont have lots of items in sight, so my items outside dont affect it. Because you can close yourself in toilet and see the lags And also I reveal map via debug menu and there is no labs underground I want someone to help me to understand, what is the cause of lags? And tell me, what can I do with it?

I know only about two reasons:

  1. Food in freezer consume fps, but I am not sure, because previoasly I didnt have so much lags
  2. Lots of appliance - but there is not too much. I have freezers and batteries at the basement, at the second floor, and some solar panels at the roof. In previous versions I have much more appliance at the base and didnt expect so notable performance slowdown

Attach save file

1-trimmed.tar.gz

Steps to reproduce

Character have few books in inventory, just read one of the book at base, than run away for 10 tiles - read again and see, that time will pass faster, than at the base

Expected behavior

Dont have lags

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19045.4170 (22H2)
  • Game Version: bbda3e4 [64-bit]
  • Graphics Version: Tiles
  • Game Language: Русский <color_dark_gray>(90,9%) [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] ]

Additional context

No response

KHeket avatar Mar 25 '24 20:03 KHeket

I planted lots of plant near the base, but I am not wure, that it can be the reason of lags

KHeket avatar Mar 25 '24 20:03 KHeket

There's a lot of vehicles with cargo and items in that cargo that have to get processed per turn. Probably just generally 'living in city' problems.

image

akrieger avatar Mar 25 '24 21:03 akrieger

There's a lot of vehicles with cargo and items in that cargo that have to get processed per turn

But in previosly runs I have more items in my car and didnt expect so much lags

Can you tell me the in which program did you test performance at the screenshot and where to click to find this function, I want to learn it to test performance by myself

KHeket avatar Mar 26 '24 07:03 KHeket

And at the screeshot I see 1784 items in process_vehicle_items, and I have only one main car with lot of needable stuff, and after unloading all items from car, there is 4755 items, and I cant understand, from where 1784 number appear, which items are eating my performance

KHeket avatar Mar 26 '24 07:03 KHeket

Not all items need to be processed, hence the number is smaller than the total in your car

Zireael07 avatar Mar 26 '24 08:03 Zireael07

Not all items need to be processed, hence the number is smaller than the total in your car

The question is which items causing this performance loss, because in that case I will just unload it, but while testing, I unload all items from car - and still have the problem, and number in fridges, which I think can be calculated as cargo - also greater, than number at screeshot

KHeket avatar Mar 26 '24 08:03 KHeket

This was in visual studio, using the performance profiler.

When I looked closer this seemed to be mostly hot in code trying to find batteries. I wonder if it's trying to process active vehicles and using battery power in them. I'm going to check it out again later to see better.

akrieger avatar Mar 26 '24 17:03 akrieger

I can confirm, that the main lag cause in this case is batteries and items in recharge station tile of my car I reproduced this big here test-trimmed.tar.gz If you put batteries (I spawned 4000 of them) in the cargo with active recharge station - the game became extremely laggy, but if you turn off recharge station or place batteries out or in another cargo - the game will run at normal performance speed

KHeket avatar Mar 26 '24 21:03 KHeket

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.

github-actions[bot] avatar Apr 25 '24 22:04 github-actions[bot]