ShoyuVanilla / FoundryVTT-Chat-Portrait

Other
14 stars 24 forks source link

Missing character sheet portraits on initiative rolls #75

Closed Bryn1701 closed 3 years ago

Bryn1701 commented 3 years ago

Foundry VTT Version: 0.8.8 Operating System: Windows How Are You Using Foundry: Chrome Which Game System: DND5e 1.4.1 Modules Enabled?: No, tested without any bar Chat Portrait for testing purposes.

As the title suggests, when you have selected Avatar option in the Chat Portrait menu, it still tries to look at the battle map to see what tokens are available and if it finds a token connected to the sheet, it will put a portrait of the token up instead of the players Avatar when rolling initiative. I am uncertain when this stopped working as intended as I have come back from summer holidays and updated to the latest version of Chat Portrait without checking what version I was on before(when it worked).

p4535992 commented 3 years ago

Should be fixed in 0.5.1 (remember if you are a GM the setting for use the image avatar is ignored)

Bryn1701 commented 3 years ago

Hmm it doesn't seem to be fixed my end. I hope I made it clear what is broken. I shall try again. When "Use Avatar Player image" is selected in Chat Portrait Configuration and you roll Initiative, the picture in the combat tracker is supposed to change to the players Avatar. It's done that for a good few iterations of Chat Portraits. It allows me to have a splash screen with blank PNG's and still have their portraits show up in the combat tracker, but recently one of the updates broke this. Hope that makes things a bit clearer.

P.S I am logged in as players for testing with no other modules enabled.

p4535992 commented 3 years ago

Did you just say "Combat Tracker"? Because if so, you are confusing, my module has never made the change of icons on the combat tracker, but only on the chat.

It was probably another module.

I redid the tests and for me it is fine. Here some screenshot:

With "Use Avatar Image" enabled and "Use Token Image" disabled i get the Player Avatar Image:

img1

With "Use Avatar Image" disabled and "Use Token Image" disabled i get the Actor Avatar Image:

img2

but in both case on the combat tracker (which i never touched) you get or the Avatar or Token image , based on the default mechanism of foundry

img3

Bryn1701 commented 3 years ago

Apologies. I think I must be mistaken then. Before I was sure I checked the Use Avatar option and it rolled the avatar into the combat tracker. As I said before my splash screen for ToTM uses an art piece I made with all my players, then I bound them with a blank PNG token to give the illusion of the actual picture centered on their characters as their token. And before when I rolled with avatar enabled it would replace the blank PNG in Combat tracker with their Avatars. Also would look nicer in the combat tracker while on a battle map to give a clearer view of their characters rather than their top down tokens. Very odd indeed. I haven't used any other module that touches the combat tracker. I wonder what changed.

Apologies for wasting your time.

p4535992 commented 3 years ago

No problem. I'm sorry I didn't help you. Good luck.

p4535992 commented 3 years ago

Add this feature on version 0.5.3 , give a try (details on the readme.md on the "Apply chat portrait on combat tracker" paragraph). Any feed back is welcome.

Bryn1701 commented 3 years ago

I was very surprised and happy to get this message this morning. Fantastic! You have gone above and beyond, and for that I thank you. I did get to do some testing and it does indeed work. However it does come with a heavy toll on the amount of time it takes to roll with the Chat Portrait enabled for Combat Tracker. I have done some tests with no modules bar Chat Portrait enabled and with modules enabled and have done a quick video to highlight the lag that comes with the process. I have a fairly decent PC, albeit a bit older these days(1080 TI full water block with a I-7 6900k also in the water loop and overclocked)

https://www.youtube.com/watch?v=RmIkqOP-UJY

p4535992 commented 3 years ago

Strange .... i will analyze the code, but i just rendering the html it shouldn't be so heavy on the process.... i'll let you know

p4535992 commented 3 years ago

Sorry can't replicate, tested on my virtual machine (2GB RAM), with 90 module active, it's not slow like on your video. Maybe some connection isssue ? For example, are the images all remote or local? Are you using a forge server? Or some collision between modules that escapes me.

Bryn1701 commented 3 years ago

Very odd indeed. Never had that issue before with any module. But yes I am running it all on the Forge server. No connection issues as you can see when the option is disabled in Chat portraits it immediately runs fine, so the connection isn't at fault. But very odd indeed. Also as the video shows, I tested with no modules running and all. Same stutter/lag.

p4535992 commented 3 years ago

Made some performance on version 0.5.4, now i cache the reference to the images, so it should be slow only the first time you load the images on the combat tracker.

Bryn1701 commented 3 years ago

Thank you for working so hard on this issue. It has indeed improved, performance wise. The very first time I tested it there was a crash to two modules(Dice so nice and Dice Tray) I have been unable to reproduce this error or crash to these modules since, so unsure if its even related to your module(although that was the only module I updated). Having said that there is still a delay of around 8-9 seconds(with modules enabled) each time the group roll as one for testing(but it was 15-16 seconds before) so it has indeed improved. Without any modules enabled, this is reduced to 7-8 seconds. But it was up in the 12-13 seconds before hand, so again an improvement.

p4535992 commented 3 years ago

Even more performance on version 0.5.6

Bryn1701 commented 3 years ago

You crushed it! It works very well now! Thank you for persevering towards a better world heh.

p4535992 commented 3 years ago

I close the issue then ^^, only one note if there are many animated token on the combat tracker (webm file) the slowness can show up again.