morerokk / IreNFist

A continuation/fix of the IreNFist mod for PAYDAY 2
MIT License
4 stars 2 forks source link

Huge performance drop in Diamond Heist and Prison Nightmare #58

Closed ghost closed 3 years ago

ghost commented 3 years ago

Self-explanatory. While I am aware that the map is unoptimized and I have an old machine, the fps works fine if I wasn't the host or if I'm doing it in stealth. I usually have around 40-60 fps on the map, but whenever I go loud and offline, the fps drops to 10-20, which is unplayable. I suspect it's from IREnFist since that's the only mod that changes the loud playstyle. Could you look into it?

morerokk commented 3 years ago

This probably doesn't have all that much to do with InF, but I'll do some profiling regardless. Maybe the cop code has too much unoptimized stuff in it or something.

This is hard for me to test since I don't have access to a less performant PC.

Do you experience similar drops in any of the Mexico heists or the White House?

morerokk commented 3 years ago

Just to note, I've had similar performance issues in Panic Room, but only with 4 clients. Still unsure where the fault is, but I'm 99% sure it's the cop AI being dumb.

I did find a bit of useless code that I accidentally left in groupaistatebesiege, which I will remove. It's a copypasted core game function but who knows, maybe it'll improve things somewhat by removing it.

morerokk commented 3 years ago

I know I said Full Speed Swarm is incompatible, but what happens if you install it anyway? Does that help at all?

If that doesn't help, does disabling the Assault Tweaks in the options help any?

morerokk commented 3 years ago

I found a potential performance problem in the code. It's unlikely that this is causing your issues, but I won't discount the possibility.

I won't be available to test until about 9 hours from now, so if you want to test this out early, try out this branch:

https://github.com/HugoZink/IreNFist/tree/bugfix/groupai_spawn_performancefix

You can download a zip of this branch from this link.

ghost commented 3 years ago

I have playable performance in the new, unoptimized heists without this mod. But regardless of that, I think the performance issues caused by this mod (or a part of it) have been here for a while, and I just didn't report it prior because it's barely noticeable until I tried playing Diamond Heist, or I just "accept" it since my PC is old anyway.

However, I do remember and suspect that it's from assault tweak. A piece of evidence for this is that when I hosted Hoxton Breakout on Day 2 with Assault Tweak Standalone installed and with 1 client, I had a huge fps drop--to the point where's it least playable, which was around 10-20 fps. And this was with FSS and Iter installed.

Normally, I would have 60 fps on that heist, maybe even more--whether I'm hosting or not.

I'll try testing the mod soon.

morerokk commented 3 years ago

If you can verify whether the issue goes away if you turn the assault tweaks portion off in the InF options, that would be great. I put in code switches, which means the assault tweaks are effectively as good as "uninstalled" with the Assault Tweaks option disabled. If the issues go away with the option disabled, that means I can narrow it down more easily.

Make sure to test the new branch I linked as well, I should have at least a few optimizations done there.

It's weird that performance issues happen though, because the amount of cops should be slightly lower with these tweaks.

morerokk commented 3 years ago

Also, I'll note that FSS and Iter strongly increase the thinking speed of cops, which can often be bad for performance. I don't really care what "performance improvements" it says on the tin, this will degrade performance (but makes cops a little more responsive in turn, at the cost of making them dumber).

I'll run some more tests with FSS and Iter myself, but generally I consider these mods to be incompatible.

ghost commented 3 years ago

I almost confirmed that the new branch fixed the issue, but I had to make sure by testing both versions (the latest on the release page and the one you've provided above), and apparently, this could be a false bug since I have similar performance with both versions now for some reason.

However, this might have been fixed with the previous versions within three days since I played Diamond Heist and noticed the performance issue three days ago. I couldn't remember if there was an update within that time period, but if there was, then you can consider this as a late or false bug, and I apologize for that. But if there wasn't, then I can't exactly pinpoint why I had performance issues on loud that day.

morerokk commented 3 years ago

What I've noticed is that sometimes the game tends to spawn way more or way less cops than usual. When it spawns "way more", performance greatly suffers as a result. My best bet is that that's what is causing it. I'll bet there's a bug in the "balance multiplier" of the game itself.

This is particularly prominent in 2-player games, because sometimes it'll scale to 1 player, 2 player amounts, and sometimes 4.

If you find any more details, please do put them here on this issue.

morerokk commented 3 years ago

Also I just realized, 2-3 days ago I added the wallrunning toggle. I'm sure the calculations for wallrunning aren't exactly cheap on performance, so if you turned wallrunning off, that might explain the better performance you're getting.

ghost commented 3 years ago

That's plausible, yeah. I'll try report other details or issues, but this performance issues are on my end, mostly, considering the fact that my PC is very old. Other circumstances would be just the engine/game, the maps, and the mods I have currently.

morerokk commented 3 years ago

Closing because I can't reproduce this, and some smaller AI optimizations might make this a moot point soon.