bbradson / Performance-Fish

Performance Mod for RimWorld
Mozilla Public License 2.0
423 stars 34 forks source link

Game freezes when trying to link certain storages #47

Closed Cheremenin closed 2 weeks ago

Cheremenin commented 2 months ago

When linking together some things like hoppers (but not the vanilla or VE shelves, or Adaptive Storage Framework buildings) the game will completely freeze

Seems to be connected to Performance Fish

http://0x0.st/XX7c.log

tiger8255 commented 2 months ago

I get the same issue with the vanilla shelves

Seems like you can toggle all patches off when you link containers as a temporary workaround? Not sure which patch it is that's causing the issue.

Cheremenin commented 1 month ago

I get the same issue with the vanilla shelves

Seems like you can toggle all patches off when you link containers as a temporary workaround? Not sure which patch it is that's causing the issue.

Judging by some other reports it looks like it's the "TryFindBestBetterStoreCellForWorker" patch doing it

tiger8255 commented 1 month ago

I get the same issue with the vanilla shelves Seems like you can toggle all patches off when you link containers as a temporary workaround? Not sure which patch it is that's causing the issue.

Judging by some other reports it looks like it's the "TryFindBestBetterStoreCellForWorker" patch doing it

I actually tried turning that off by itself and still froze. I don't think that's the one causing it when linking storages.

TheHitman2772 commented 1 month ago

I had to turn off all patches in that section to stop the crashes, but I think the one TryFindBestBetterStoreCellForWorker patch can be disabled by itself for vanilla. Mods that mess with storage seem to require turning off all the other prepatches in that section of optimizations.

sunxyw commented 1 month ago

You have to disable "TryFindBestBetterStoreCellForWorker" patch, and all others patches that relies on it.

Patches to disable:

Restart your game to make the changes apply.

Also, duplicate of #44

20240616: Foxtr0t1337 posted a PR #53 fixing this issue. You can either follow his instructions to try to fix it, or wait for the official release and disable the patches above for now.

quicksilverfox commented 1 month ago

You have to disable "TryFindBestBetterStoreCellForWorker" patch, and all others patches that relies on it.

I did that, and not only it fixed crashes, but also serious lag spikes I had.

kvalek commented 1 month ago

I can confirm that this happens to my game aswell. Game will freeze if i try to link 7 or more shelves at the same time. 6 works fine. This was all vanilla shelves. Only storage mod i have is Rimfridge. Will try to disable the patch.

Izeick commented 1 month ago

+1

VaelophisNyx commented 1 month ago

Getting this myself, also tried the listed patches to turn off, still froze.

FWDekker commented 1 month ago

@VaelophisNyx I also encountered this bug just now, but for me sunxyw's solution worked fine. Did you restart the game after disabling the patches? I guess it might also help to clear the cache (which you can do at the bottom of the mod's settings). Otherwise, your bug might be different from the one others are encountering.

VaelophisNyx commented 1 month ago

@VaelophisNyx I also encountered this bug just now, but for me sunxyw's solution worked fine. Did you restart the game after disabling the patches? I guess it might also help to clear the cache (which you can do at the bottom of the mod's settings). Otherwise, your bug might be different from the one others are encountering.

a reload after the settings changed fixed the issue.

SirMalFet commented 1 month ago

Can confirm this happens when linking 7+ storages.

Foxtr0t1337 commented 2 weeks ago

Found the problem in the source code. It is a infinite loop caused by decreasing an index by a unchecked negative number. Will post a pr in a moment.

And no, in my case it is not because of TryFindBestBetterStoreCellForWorker but TryFindBestBetterStoreCellFor. When I link shelves it freezes.

Foxtr0t1337 commented 2 weeks ago

PR is made, please feel free to try the fix out. If it can't fix the problem please let me know. If it can fix it, that's great, please let me know. ; )

To apply the fix you will need to pull the commit to your local mod folder and compile it. Or replace the 1.5/1.4 folder of the mod with ones in my repo which have the fix compiled.

sunxyw commented 2 weeks ago

PR is made, please feel free to try the fix out. If it can't fix the problem please let me know. If it can fix it, that's great, please let me know. ; )

To apply the fix you will need to pull the commit to your local mod folder and compile it. Or replace the 1.5/1.4 folder of the mod with ones in my repo which have the fix compiled.

Hi Foxtr0t1337, I just downloaded the dll you compiled to try it out and it did fix the problem caused when linking storage shelves, thank you very much!

Jigain commented 2 weeks ago

PR is made, please feel free to try the fix out. If it can't fix the problem please let me know. If it can fix it, that's great, please let me know. ; )

To apply the fix you will need to pull the commit to your local mod folder and compile it. Or replace the 1.5/1.4 folder of the mod with ones in my repo which have the fix compiled.

Can also confirm, after replacing my 1.5 folder with the one from your repo, no further crashes.

bbradson commented 2 weeks ago

The fix is merged in now