-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lag in Caravan Screen #32
Comments
If more informations are needed just tag me here. |
Can confirm this issue in my game. I dont see any errors logged. Here is my hugs log: https://gist.github.com/997a7347c6600c1203fb2b26062e5879 And here is a stack trace of what i think is the offending call that is tanking performance: https://imgur.com/a/ZZR7qVf |
So, for whats it worth, i've tested my game with different versions of EBF i dont have any of the mods installed your unification layer seemed to be addressing, so I dont think its a conflict there. |
The main deal with the Because we are using reflection, the performace will be poorer than directly using machine code in the C# dlls, but I expected that "it wont be that bad"... From the attached log it seems something is going on with AchievementsExpanded.AchievementCard ...? I also see your tracing screenshot, but just in case, which tool were you using to get that info? I want to explore a bit on my side to see if I can get something similar, also to get familiar with using profilers etc. Edit: to add to this, a while ago I replaced my laptop due to some other reasons, and now my current laptop is much more powerful than my previous laptop, so it is possible that "I did not see this performance problem on my side" because my laptop is simply too fast that no lag can be seen, so I am trying to get your profiler to see if the numbers are larger than usual. |
The tool is Dub's Performance Analyzer, on steam... I use a fork of that project by user @simplyWiri of that project with some slight re-tooling of the UI, and some additional troubleshooting categories https://github.com/simplyWiri/Dubs-Performance-Analyzer For what it's worth, there is also a pretty active performance optimization focused discord group: https://discord.com/channels/241677926855081984/660280287497814078 , i've seen the folks over there help other mod authors with stuff like this |
as for my log, there is definitely something borked with the Achievements expanded. I yanked that mod mid-way through my current play through and i am still seeing some vestigial issues that i havent been able to fix. That said, i dont think that is the particular issue here. I run quite a few other mods with minimal issues, and my machine seems to keep up fine with a TPS in high 300's at 3x speed (without EBF, that is) |
For Achievements Expanded, my guess is that it injected some string value into some savedata, and those strings are actually defNames of Achievement Expanded data structures. It keeps throwing errors because the savedata could be loaded fine (ie not corrupted) but the game could not find the defs as specified by the string. I'll just setup the profiler first and investigate later. |
I opened up the profiler, and indeed there is a great lag, and with my rather powerful laptop, it only showed up as an (personally) acceptable fps drop. It was not outright unusable so it slipped past unnoticed. One thing to notice is that there are many many calls to GetMaxHealth , which does not seem right...? it is mainly the many calls to GetMaxHealth that is causing the lag. Edit: one thing to point out: it just seem strange that I seemingly cannot find any profiler record of GetMaxHealth if I disable EBF... so in the strictest sense, I cannot compare the performances correctly |
I noticed it becomes outright unusable when you have a significant amount of pawns. The issue directly scales with how many pawns are displayed on the screen, and I noticed it becomes essentially unusable around 20 pawns. Not noticeable early on, but very noticeable later in the game. |
Every computer system becomes unusable when there is too much going on, but becoming unusable with only 20 pawns is unacceptable. Something is going on with the seemingly excessive amount of calls to the GetMaxHealth function. |
I do not know why the function had to be called many many times, but apparently the most number of calls came from
In fact when I think about it, when we are forming caravans the game will be paused, so eventually most of those calls are expecting the same value. Might as well cache those values for a great peerformance boost. I will release the update later, but when testing locally with the Performance Analyser, the performance is now greatly improved, to the point where there is virtually no performance impact whatsoever: I'll see if I can also deal with #33 and push them both in the same update. Edit/update: On my side, before the patch, if I didnt use any other mods and went to the caravan screen, I got roughly 20 fps. After I fixed that, I got 40 fps, which is OK and indicates that the game is running smoothly. Then, I enabled Pawnmropher to test sth else, and boy, entering the caravan screen tanked the fps to ~10 fps. I fixed it again, and it returned to 40fps. I can see when you are using Pawnmorpher, the Pawnmorpher calculation + the vanilla social interaction/social fight/etc calculation can tank fps to perhaps 5 fps. |
I'm closing this because v5.0.4 (released) has solved this. |
Multiple Steam users report extreme lag with the Caravan UI. It would seem to originate from the People and Animals tab in some of the caravan GUIs.
Not sure what is going on for the moment, but perhaps there are some unexpected side effect that I did not notice, or there are some hidden assumptions that I used + does not hold in the relevant GUI screens.
Or, maybe there are some hidden optimizations that can be done, just like how I previously improved the performance of Real Time Clock Plus just by discovering and using the
ToStringCached
function instead of the usualToString
.What is strangest, is that there are no error logs. This rules out exception-based lag, but rather logic-based lag.
Regardless, a deeper look is needed.
The text was updated successfully, but these errors were encountered: