Larkinabout / fvtt-token-action-hud-pf2e

Token Action HUD is a repositionable HUD of actions for a selected token.
10 stars 15 forks source link

Long time to render HUD #69

Closed uniwars closed 8 months ago

uniwars commented 1 year ago

Hi, when selecting a token /switching from one to another it sometimes takes several seconds before rendering/updating HUD. It's primarly true when selecting the first token on a scene, it can take more then 5 seconds to render HUD.

Is that normal or do I have an issue with the module ?

Larkinabout commented 1 year ago

It's likely to be impacted by the performance of your machine, what other processes are happening (impacted by other modules) and how many actions the HUD builds (for example, it will take longer when you have lots of macros and compendiums).

I don't experience the same delay, but it may be normal for your setup. I'm constantly looking to improve performance, so it may get better in future releases. If it negatively affects your play experience, you may need to consider changing some of the above factors.

LeKopic commented 1 year ago

Same here, but only towards the end of a game session. I have a suspicion it has something to do with either a memory leak (unlikely, imo), multiple conditions being added to a character and then removed or a module conflict, but I haven't yet looked into it. Also, I am pretty sure the issue has appeared after V11 update.

Larkinabout commented 1 year ago

Are either of you running on The Forge? Can you also let me know what browser and version you're using and if the delay still exists when no other modules are enabled.

@LeKopic, I'll have a look to see if I can diagnose any memory issues, but any insight you can provide from your side will help. Also, were you using Token Action HUD Core on v10?

uniwars commented 1 year ago

I did some test with find the cutprit, with all my modules there is more delay when switching from a token to another to render the HUD, without modules it's almost instantenious, but I could not find a single module that changed that, it seems that it's the accumulation of modules.

LeKopic commented 1 year ago

No forge, the issue was from GM's side (mostly). I think I did use Core on V10, yeah.

Sadly, I can't test it right now, maaaybe next weekend. Usually it goes like this: several hours of normal session, there is no issue with clicking on npcs, but then if I click on PCs it struggles to draw the hud for up to 30 seconds or so. Hmm, can it be an issue with handling deleting and drawing the hud itself? Also, I run quite a few modules alongside this one, so it can really be just a module conflict. @uniwars Can you share your module list so that I can cross-reference it later?

uniwars commented 1 year ago

No forge neither, and issue with PC only as well

Larkinabout commented 1 year ago

I'm considering using a different method to render the HUD, but it's a big change so it may take a little while. Rendering the HUD is the biggest cost, but I can also see if changing the source of the enhanced tooltip data will also help as that's the next biggest.

Maelorn09 commented 1 year ago

Same issue here. Before I switched to Core + PF2 module it was super fast. Now sometimes during game I open character/npc sheet because I know it would be faster. I use Forge + 57 active modules. Foundry V11. Please tag me if any testing is needed.

Larkinabout commented 1 year ago

Same issue here. Before I switched to Core + PF2 module it was super fast. Now sometimes during game I open character/npc sheet because I know it would be faster. I use Forge + 57 active modules. Foundry V11. Please tag me if any testing is needed.

I noticed The Forge typically has noticeable lag with TAH Core even with no other modules enabled. But, any performance gains will hopefully help The Forge too.

Larkinabout commented 1 year ago

Token Action HUD Pathfinder 2 1.4.13 improves the performance of building the enhanced tooltips. If you have full tooltips enabled and are still having performance issues on some machines, you may find that setting Token Action HUD Core's 'Tooltip Display' to 'Name Only' or 'No Tooltips' helps, although it will disable the enhanced tooltips.

uniwars commented 1 year ago

OK, I just discovered I had lock core and was 5 updates late, now there is a very small delay but it's near instant like with the legacy module, I'm really sorry

Maelorn09 commented 1 year ago

OK, I just discovered I had lock core and was 5 updates late, now there is a very small delay but it's near instant like with the legacy module, I'm really sorry

Hey, it's very good now after I disabled tooltips. Thanks a lot for fixing this! You saved my game )

Grafvollud666 commented 1 year ago

Heya :) Recently upgraded to Foundry v11.306 and have Token Action HUD PF2e 1.4.13 (core = 1.4.16); using Forge-VTT.com. I've disabled Tooltips but the HUD does not appear. Can confirm that "Always Show HUD" and "Enable HUD" are enabled. In summary, I or players cannot use HUD at all since the upgrade. Any advice?

Grafvollud666 commented 1 year ago

Further information, when selecting a token, I observe the following in my Chrome browser console log (115.0.5790.110 (Official Build) (64-bit)): image Hope that helps. Thanks in advance.

Grafvollud666 commented 1 year ago

Thank you Larkinabout for your response :)

Looks like the issue may be isolated to Forge-VTT. Know that during my previous testing I did try disabling all modules except for Token HUD and the hud did not appear.

I also observed that Foundry/PF2e Compendiums were not working as well. Know that I'm running three PF2e games with Forge-VTT. I was advised to a) shutdown all worlds, b) uninstall/reinstall PF2e, c) startup worlds to resolve the Compendiums issue. I've now discovered that Forge-VTT has a known concerns with v11 & Compendiums when running multiple worlds. If you only have one world active, the Compendium Packs are accessible. Until resolved I can only have one World/Server active at a time. Hopefully this will be resolved quickly :)

After doing this I realized that Token HUD now works. This also seems to be related to the multiple worlds issue for Forge-VTT as well. E.g. Start world #1 = Token HUD ok, Compendium = ok. Start world #2 (world #1 still active) and Token HUD & Compendium do not function for world #2. World #1 is ok.

In summary, ignore my situation for the time being. I have a workaround. Be aware of this multiple worlds active at once issue for Forge-VTT that seems to affect at least a few modules/features. Hope this helps. Thank you again, much appreciated :)

jonathanmclaus commented 1 year ago

I'm on Forge + Foundy 11, v307, with Pathfinder 2E token Hud and am also seeing lag. I only have 1 2e world and have disabled enhanced tooltips, but still get noticeable lag of a few seconds when clicking on tokens.

Silvertower commented 8 months ago

Because the HUD is built each time a token is selected, this is likely a combination of local JavaScript speed (e.g. the browser), and remote data access speed (e.g. the Foundry server). Without something like a possible client-side caching mechanism (which likely isn't feasible), or code optimization, there is probably not much that can be done here at this time.