Feu-Secret / Tokenmagic

A Foundry VTT module that allows you to add animations and graphic effects to tokens, tiles, templates and drawings.
GNU General Public License v3.0
51 stars 36 forks source link

Low performance mode w stretched static template textures #236

Open Jefferydo opened 1 year ago

Jefferydo commented 1 year ago

I'm hoping to set up Foundry to look awesome without animation, and I started by looking into static template textures.

Core Foundry repeats a tile. That's the seamless pattern approach. Token Magic FX can expand a still frame from JB2A, a .webp sitting beside the .webm in the folder. It looks amazing! But simply having Token Magic FX enabled drops me from 50-55 fps to 10-20 fps. No other modules enabled, map open, no players logged in.

A Discord member suggested extracting just the code that affects template texture rendering and putting it in a world script, but I don't know JS well enough. He pasted a prototype script.: https://discord.com/channels/170995199584108546/513918036919713802/1068889724799942656

Is adding a low performance mode feasible? Would you guys be interested in developing it?

Feu-Secret commented 1 year ago

I could take a look. I need some informations about you hardware specifications. This drop of fps is strange. You said that just enabling TMFX provokes this? Without any special effects active?

Jefferydo commented 1 year ago

I'm recreating the FPS drop right now. With 80+ modules except TMFX enabled, it's around 58-59 FPS. Using Find the Culprit with only TMFX enabled, FPS drop to around 12-16. I've stripped the scene of all actors, drawings, walls and lights but there are still 61 tile objects. When I delete those, FPS jumps to 59. Loading Baileywiki's Alchemist Tower scene drops FPS to 15-20.

I ran the pixi.js stress test, PixiS Bunny Mark, and I'm getting 15-18 FPS with 100,000 animated bunnies and all options checked.

The laptop's a Lenovo X1 Carbon 9th Gen ... CPU: i7-1165G7 @ 2.80GHz, on high performance (runs warm to hot) iGPU: Intel Iris Xe (supposed to be good for an iGPU) RAM: 32GB (Lenovo made it impossible to overclock)

Since posting I've discovered JB2A runs smoothly. It will occasionally run down to single digit FPS, but it rebounds immediately. I'm guessing that's garbage collection to free memory.

TMFX isn't a gradual loss of resources. Having it enabled with those 61 tiles set the laptop on fire. FPS drops after a few seconds and stay there until the game freezes, about once an hour.

I'm happy to run more tests. Please let me know how I can help.