PDA

View Full Version : Window dragging lag



Tuubi
October 19th, 2023, 08:57
Hello!

Recently, after an graphics driver update, I've noticed that while dragging the reference manual window my fps drops like crazy. It did not do that before that update. I've set the Nvidia settings to "let the 3D application decide" under "adjust image settings with preview". No other window lags and drops fps while I hold and drag them around. Even if I resize the other windows, they do not cause the issue. Only the reference manual window. And it does not matter which reference manual it is, it still lags and drops the fps like crazy. I've not yet tried to tinker with vsync commands.

This is a completely new campaign that I've just started btw. So no images or other resources are shared.

Should it be like this or is it something that needs fixing?

EDIT: I tried to attach a screen recording but it did not let me do it.

Regards,
Tuubi

Lo Zeno
October 19th, 2023, 09:56
I have noticed the same thing yesterday.
(Using D&D 5E ruleset, BTW, fresh campaign, only PHB, DMG and MM loaded modules plus Rime of the Frostmaiden, no extensions)
Any other window (images, characters, NPCs, Items, assets... you name it) moves smoothly when I drag it across FGU's window; but when I open a reference manual, if I need to move the window from left to right (for example) it lags noticeably. It seeems to be dependent on how "large" the reference manual is: the Players version of the DMG for example is almost empty and the window moves super smoothly when dragged, while the DM version of the DMG, like the whole Rime of the Frostmaiden module (which is a pretty large adventure module) lag a lot when dragged. And it doesn't seem to cause noticeable spikes in CPU or GPU usage either.

I've got a video of it here:
https://1drv.ms/u/s!AhU4e1ugaj2Rg_Bp2YiHFgItDAjRkQ?e=vTWRQv

It doesn't look terribly disruptive on this video, but keep in mind I'm using a fairly high-specced PC, so for users that have more medium-range machines it might be more noticeable and more annoying.

Ludd_G
October 19th, 2023, 19:47
Hi,

Since the most recent updates I'm having a similar issue with PC character sheets in a clean (no extensions) Pathfinder 2e session. NPC sheets are fine as are other windows, although it is present for Reference Manuals of larger books (e.g. PF2e Heroes Handbook fine, PF2e Core Rulebook very laggy).

With the PF2e character sheets, on initial opening they are fine, but once you click on the 'Activities' tab, and that populates, the sheet becomes very laggy to move or resize (both are worse if you remain on the populated Activities tab, but even with other tabs open there is a noticeable slow down.

This feels very similar to behaviour in early FGU, when dealing with larger data sets (spell list etc.), but which hasn't been an issue for a long time and in fact till this point has incrementally improved over time.

Cheers,

Simon

Tuubi
October 20th, 2023, 18:17
Yeah, pretty much what you explained Lo. I tried with a "smaller" reference manual and it did not lag as much but still very, very noticeable. I would consider my machine as fairly high end aswell so I think I can live with it. But it still annoys me.

I have not noticed it with PC character sheets yet (im using 5e).

Hopefully a hotfix in the near future will take care of it.

Ludd_G
October 21st, 2023, 12:42
Any Smiteworks bods got any thoughts on this?

Ecks
October 21st, 2023, 18:00
I'm seeing this as well with the latest FGU, FPS drops from 120 to 10-20 when moving the Curse of Strahd reference manual window around.

Moon Wizard
October 21st, 2023, 18:01
I won't have any idea until I have time to look. Since it's not a showstopper/blocker kind of issue, it will be looked at eventually but not as a priority. Still working on settling the latest release.

Regards,
JPG

Arimil508
October 22nd, 2023, 22:41
So I run a pathfinder 1e game on Fridays. I noticed something similar one some of my players sheets they are a caster and tend to have a lot of spells which i originally thought it was sluggish because of that. Ever since the most recent patch last week it has gotten considerably worse. Depending on how many spells the sheet has when on the action tab it can be perfectly fine to really bad. This sluggishness involves switching tabs, scrolling on current tab, Moving character sheet. even sections like inventory and skills are effected the least effected is the main tab.

At first i thought it was something with the massive amounts of extensions i use in my games but i copied the offending campaign and removed all extensions and no real difference.

Midge
October 24th, 2023, 02:18
So I run a pathfinder 1e game on Fridays. I noticed something similar one some of my players sheets they are a caster and tend to have a lot of spells which i originally thought it was sluggish because of that. Ever since the most recent patch last week it has gotten considerably worse. Depending on how many spells the sheet has when on the action tab it can be perfectly fine to really bad. This sluggishness involves switching tabs, scrolling on current tab, Moving character sheet. even sections like inventory and skills are effected the least effected is the main tab.

At first i thought it was something with the massive amounts of extensions i use in my games but i copied the offending campaign and removed all extensions and no real difference.

We are having almost this exact same issue in our games (PF2e, though). Even when we try to load one of the characters locally (no extensions) just to mess with it, the lag, freezing, and slowness is still intense. It's definitely most apparent with our spellcasters, and especially bad for our prepared casters. It progressively got worse as we gained levels, and now that we're 15+, it's really bad. This last patch it seems to just be worse than ever. Players can barely move their character sheet or scroll through their tabs (Action tab is the worst).

We were testing deleting spell lists from these characters, and suddenly the sheet 'unlocks'. This only worked on a few characters--one of them just keeps crashing the client every time we try to delete their spell list.

Sadly, deleting our entire spell lists (spontaneous or prepared) defeats the purpose of having the functionally in the first place. This is happening across three different PF2e games, and every time, it's a spellcaster with a big list of spell built into their action tab.

Arimil508
October 24th, 2023, 16:03
I know this is a dumb as **** solution but what can you do right now...
what if you made new characters to contain parts of the spell list. at least that should reduce the strain on loading an individual character sheet.
ps. I know this is stupid as all hell but without a major fix there is not anything we can do if only we had Turbo for character sheets.

Moon Wizard
October 29th, 2023, 17:06
Turbo just moves all the processing into memory for effect calculations (i.e. more memory usage, more speed); and doesn't have any impact at all with large numbers of UI objects.

I have been poking at this on and off over the last week as I have time. The only change that I can see is the clipping fix updates for deep nested lists (most visible in new PF2 activities tab when it occurred), which is needed to keep controls from displaying outside windows.

However, I couldn't see any big spikes in performance hit beyond opening tabs with huge numbers of controls (i.e. when sitting idle, it was not consuming lots of cycles). If you have an example character sheet that has the issue when viewed in the default ruleset (i.e. no extensions) when first opened, please send me the XML export.

We actually made some structural changes in 5E/4E/3.5E actions tabs earlier in the year to reduce the number of controls instantiated (i.e. having to be tracked by interface logic, whether visible or invisible). It may also be relevant to have complex sheets refactored to reduce instantiated controls from the ruleset side. (i.e. there's a limit to what can be done on client, if the ruleset creates a very complex view.)

I plan to keep looking in between working on features to see if I can spot anything; but having examples to work from helps greatly since I can use a profiler to see where things are spending the most time in the code logic. I have some related improvements queued for release next week (optimizations I found while trying to figure out what changed).

Regards,
JPG

Arimil508
October 29th, 2023, 17:35
Yah will do.
I mentioned Turbo because it was an extension that helped with performance a bit I personally do not use it i was just wishing we had something that could help with this until a patch/ rework happened.

Ecks
October 29th, 2023, 17:40
In a new 5E campaign, no extensions, I see a ton of lag just trying to move the Reference Manual for Curse of Strahd around.

With only the Curse of Strahd reference manual open, FPS is 120.
With all chapters collapsed (by clicking each chapter heading closed), moving reference manual around drops FPS to 2.
With all sub-chapters collapsed (normal view when opening), FPS drops to 10 when moving the reference manual window.
With all pages expanded, FPS is around 20 when moving the reference manual window.

Windows 11
Ryzen 7 3800X
RTX 2080 Super
FGU v4.4.5

Moon Wizard
October 29th, 2023, 19:30
Interesting that it would decrease performance with chapters collapsed; maybe there is a hint in there for poking around. Thanks for the example.

Regards,
JPG

Arimil508
October 29th, 2023, 20:44
Okay I am running a Pathfinder 1e game I have a druid that their spell sheet just lags to all hell when in the action tab.
I opened it up in a copy of the campaign with no extensions active and it acted the same. I was concerned that even with the extensions gone that any lingering data left in the character sheet that is not being used could be the problem so I recreate the situation with a fresh character sheet in the this copied campaign. The first file is the originals character the second is the fresh character sheet. Both lag when you move the sheet if the Action tab is active and it tends to continue to happen through out the sheet after the fact though to a lesser degree.

https://drive.google.com/file/d/1phjHQ02sRSkg-C2-wb0dFEYHYf-86Evx/view?usp=drive_link
(https://drive.google.com/file/d/1phjHQ02sRSkg-C2-wb0dFEYHYf-86Evx/view?usp=drive_link)

https://drive.google.com/file/d/1bPxXjXTOckWvyfQY2JRKHZ7z1QtUmZyV/view?usp=drive_link

Talonmaster
October 29th, 2023, 23:56
Same with my 5e character. Large action tab, lags like hell.

Wish there was a fix, or heck, a way to add a second action tab hehe

willrune
October 31st, 2023, 01:13
I'm in a late Pathfinder 2E game as a druid. The lag is awful. I noticed it gets worse if I collapse the individual spell levels, so maybe that is related to the code that expands/collapses chapters.

Activities and actions are both pretty bad, but actions are like pulling teeth. Being a Druid who archetyped into Cleric isn't doing me any favors.

I haven't been able to determine if the window drag lag is related to scrollbar lag.

If I click on the dragon icon to bring up the main entry of any of the spells in the actions tab, it looks like it goes through a few rendering phases. First it populates initial information, then in a second pass it adds descriptions, effects, heightened, saves, etc. The big give away is that the scrollbar changes size and you can't interact with the new window (including dragging it) until the second draw is complete.

My animal companion is represented with a player character sheet and that sheet can be reposition, tabbed, and scrolled without issue, while the druid sheet is also open (but not focused). I wasn't sure how to send my character XML to you Moon, so I sent it as a direct message.

My character was slow but usable a few weeks ago, but now it is almost completely unusable. Some how we limped through our last session by avoiding my actions tab as much as possible and rolling more manually. My CPU and GPU are pretty strong and I have a good amount of memory, so I don't think it is either of those. I was tempted to blame network communication with the host, but the same problem happens in a new local game, no mods, default theme, with the character imported.

---

I don't know if this is helpful, but I'm going to throw this out there, knowing full well that it is non-trivial to implement (if you aren't doing it already)

In web development, when there is a lot of things in the HTML DOM, you can do something called windowing or virtualizing it, where you only render what is in view (with a few leading and trailing items acting as a buffer, you might even change the buffer size with scroll direction and speed). I used to have non-react references, but those are harder to find these days. Math and positioning is done to make the scrollbar size and behave identically to if everything were rendered. The data could all be in memory, but only the visible elements are rendered (regardless of whether or not overflow clips them out of view). I don't know if there is a similar thing in Unity. I can't imagine much of the way a browser renders translates to unity? I mention it in the off chance that it might provide a new option. It isn't unique to web development, so you can probably find similar articles outside of web development. Its easier to do if item dimensions in the direction of scrolling are identical. Its a bit harder when the heights vary, but this is almost always much more useful. Its been a while since I last read up on it, so take with a grain of salt.


- https://dev.to/adamklein/build-your-own-virtual-scroll-part-i-11ib
- https://www.kirupa.com/hodgepodge/ui_virtualization.htm
- https://www.patterns.dev/posts/virtual-lists

"react-window" is a common example. You may also see its predecessor by the same author "react-virtualized"

- https://github.com/bvaughn/react-virtualized#examples
- https://rawgit.com/bvaughn/react-virtualized/master/playground/hover.html
- https://bvaughn.github.io/react-virtualized/#/components/List
- https://react-window.vercel.app/#/examples/list/fixed-size

Moon Wizard
October 31st, 2023, 02:44
In addition to a fix we had to put in place to avoid text within nested lists being drawn outside of sheets, we also moved to the latest version of the Unity engine. It appears that something changed in the way that certain Unity UI objects are updated that causes them to be updated more often than before. Carl and I are working on some optimizations to address the changes and speed things back up. Currently, I'm targeting a release for later this week that should help with this issue.

Regards,
JPG

Midge
November 3rd, 2023, 18:31
The recent update seems to have fixed this lag issue with the spell lists! Thank you Moon Wizard (You really are a wizard!) and Carl!

willrune
November 3rd, 2023, 18:42
The update is so much better, whatever solution ended up being. Thank you!

Moon Wizard
November 4th, 2023, 03:07
Thanks all. The update with the performance fixes went out this morning.

Regards,
JPG