dev7355608 / perfect-vision

Foundry VTT Module: Lighting Drawings and Vision Limitation.
https://foundryvtt.com/packages/perfect-vision
MIT License
53 stars 10 forks source link

Overall performance issue & Sight Limit Standalone #319

Closed RudeCanine closed 1 year ago

RudeCanine commented 1 year ago

Description

Sorry if this should be labeled differently, not really used to Github.

Since updating to V10 I've been having a lot of performance issues with Perfect vision, mainly since I play with 150 degree vision, whenever my players need to turn the game stutters and adds overall lag to foundry. I realize this is because Foundry itself has a bunch of new shit from V9 and V10 that perfect vision essentially has to work around, that was not in previous versions.

Is there anyway to improve overall performance? I've checked with all of my other modules turned off, and it's only perfect vision stuttering. My computer is a beefy rig and Foundry runs cool, even with 5 players connected, it's just perfect vision.

For the record, I love perfect vision and what it did for me in the previous iterations. Limiting Vision is mainly what I use it for now, so it would be wonderful if there was just a standalone module for that. Thank you!

Context

No response

dev7355608 commented 1 year ago

Could you export one of the scenes where you experience this lag and share it with me to help me find the source of the lag?

What game system do you run?

RudeCanine commented 1 year ago

By exporting one of the scenes, are you referring to the "Export Data" feature, or are we talking a bite-sized adventure import? Also I'm running 5e.

Sorry for slow response :-)

dev7355608 commented 1 year ago

The .json file you get from Export Data.

RudeCanine commented 1 year ago

For sure, here's a zip; I ran some 50 modules in my campaign but I'm still having issues with all of them inactive.

There'll be some tokens to the north of the map, and when I spin them around that's when it stutters; especially in that location. fvtt-Scene-death-house.zip

dev7355608 commented 1 year ago

Try 4.1.8, and let me know if it's any different. I couldn't observe any stutters on my end. Without PV I got larger FPS drops while turning tokens. How large are your FPS drops? If 4.1.8 doesn't help, please compare Fog Exploration on vs off, and let me know the results.

RudeCanine commented 1 year ago

Updated to latest version, I was apparently running 4.1.7, which might've been the issue (with foundry 10.288 & and 10.291) and apparently that fixed it. Most likely just an issue with foundry rather than the actual module, strange enough.

FPS drops with PV are still happening, the game runs at 165FPS and when turning in that area it drops about 20-40FPS, but that's not that bothersome since it still runs well above 60fps; whereas with regular foundry it doesn't drop more than 10FPS.

Could be my machine, but I don't really tend to have any particular issues with performance lest I try running AAA games on ultra. Thank you for the chat though, it's been enlightening haha

dev7355608 commented 1 year ago

Have you compared Fog Exploration On vs. Off both with PV enabled and disabled?

To measure the FPS more reliable, instead of rotating the token just select it and execute this script-macro. Keep the rotation the same for all benchmarks.

globalThis._updateVisionTicker ??= canvas.app.ticker.add(() => {
    if (!_token) return;
    _token.updateVisionSource({ defer: true });
    canvas.perception.update({
        forceUpdateFog: _token.hasLimitedSourceAngle,
        refreshLighting: true,
        refreshVision: true
    }, true);
});