Chat Scrubber - Keep Chat Log to a Minimum (improves peformance)

Problem: I am experiencing a severe load/freezing issue in V10 with a heavily modded, heavy CSS PF2 system where the Chat log will take 2-8 seconds to redraw upon returning to it from any other sidebar tab (ex: Combat, or Actors), as well as 2-8 seconds of freezing when players generate a new message. Players do not experience this since their posts are limited in info and complexity, but as a DM this destroys my pacing. The freezing will result in the browser or Electron server displaying the “want to kill this application due to unresponsiveness” dialog if clicked multiple times during the freeze, but it will unfreeze on its own. The issue was identified as the chat log, which appears when the chatlog fills in with 40-50+ very complex system messages (attacks, damage rolls) in the PF2 system. Not a mod conflict: tested with zero mods with and without Dorako UI. With Dorako UI the problem is considerably worsened, but I want to keep using this mod. The only solution I could find for the problem is regularly cleaning the chat log, but I want to automate this, so I don’t have to do it manually when I start experiencing slowdowns. This mod would help me with it. Settings - Maximum Chat to Retain [default: 50] - Exclude Message Chats [default: on] - Maximum Chat to Reload [default: 10] Functionality - The mod scans the chat every X seconds on every chat message generated and deletes any messages in the Chat Log older than the most recent X [default: 50]. - If Exclude Message Chats is on, exclude chats that are messages or whispers from players or DM. - When the user switches to another tab in the sidebar and returns to chat, behavior separate from loading the chat after world load or F5 refresh only renders a few messages (default: 10). The rest will only load in the chat if the user scrolls up and browses to the top of the list, in batches of 10. The code for this may be found in DF Chat Enhancements, but I could not hack the mod to limit the minimum batch of 100 messages to a limit of 10. Any tricks that could help speed up rendering chat would be welcome and can expand the budget of the mod. Budget : 50$
16 Replies
Apostol Apostolov
Taken by @Magus! Thanks for the very quick response.
Leo The League Lion
@Apostol Apostolov gave :vote: LeaguePoints™ to @Magus (#118 • 11)
Magus
Magus2y ago
Exclude Message Chats Im having some confusion on this setting Its meant to only toggle whispers deletion? Or does it control wether the first setting is active or not?
Apostol Apostolov
@Magus It excludes chat messages that are whispers or speech from GM and players the first setting is always active when set to a value, but excluding speech and whispers guarantees it won't remove single small messages from DM that may be important to game.
Magus
Magus2y ago
"from GM and players".. so any whisper or speech?
Apostol Apostolov
any whisper and speech, yes
Magus
Magus2y ago
there are no messages wich are not from GM or players
Apostol Apostolov
so it should scrub attacks, damages, spells, items, etc. but if the GM posts the exact name of a character, it won't get scrubbed if the second setting is on
Magus
Magus2y ago
Im gonnah ave to investigate the best way to address this because the game doesnt really differentiate those messages an attack message is just the same as any message
Apostol Apostolov
if this cannot be done immediately, this is a nice to have, not a must-have.
Magus
Magus2y ago
Well, if the message has a roll in it, maybe I can treat it as a 'non important message'
Apostol Apostolov
btw i will check if the messages have special css in PF2 jut to clarify the game breaking issue is most prevalent in PF2 so it is the focus of this mod, though agnostic in general so let me see if I can give you useful CSS The only thing I found is Normal chat messages content is
<div class="message-content">
Content blah blah
</div>
<div class="message-content">
Content blah blah
</div>
Chat cards (all other content) has a nested chat-card class
<div class="message-content">
<div class="pf2e chat-card item-card" data-actor-id="5YCNP4CvPp6hw7WN" data-item-id="W3i9rRrnkvwCpdf8">
<header class="card-header flexrow">
<img src="systems/pf2e/icons/features/classes/revelation-spells.webp" title="Revelation Spells" width="36" height="36">
<h3>Revelation Spells</h3>
</header>
<div class="tags">
<span class="tag tooltipstered" data-trait="" data-description="PF2E.TraitDescriptionOracle">Oracle</span>
</div>
<div class="card-content">
<p>The powers of your mystery manifest in the form of revelation spells, which are a type of focus spell. Casting a revelation spell costs 1 Focus Point and increases the effects of your <a class="content-link" draggable="true" data-uuid="Compendium.pf2e.classfeatures.ibX2EhKkyUtbOHLj" data-id="ibX2EhKkyUtbOHLj" data-type="Item" data-pack="pf2e.classfeatures" data-tooltip="Feat/Feature Item" data-args=""><i class="fas fa-suitcase"></i>Oracular Curse</a>. You start with a focus pool of 2 Focus Points. You refill your focus pool during your daily preparations, and you can regain 1 Focus Point by spending 10 minutes using the Refocus activity to reconcile the conflicting or unconventional nature of your divine mystery.</p>
<p>Focus spells are automatically heightened to half your level rounded up. Focus spells don't require spell slots, and you can't cast them using spell slots (see <a class="content-link" draggable="true" data-uuid="Compendium.pf2e.classfeatures.7AVspOB6ITNzGFZi" data-id="7AVspOB6ITNzGFZi" data-type="Item" data-pack="pf2e.classfeatures" data-tooltip="Feat/Feature Item" data-args=""><i class="fas fa-suitcase"></i>Divine Spellcasting (Oracle)</a>). Taking feats can give you more focus spells and increase the size of your focus pool, though your focus pool can never hold more than 3 Focus Points.</p>
<p>Revelation spells have the cursebound trait, unlike other focus spells. This trait means they increase the severity of your oracular curse (see below) when cast. You can't cast a cursebound spell if you don't have an oracular curse.You learn two revelation spells at 1st level. The first is an initial revelation spell determined by your mystery. The second is an initial domain spell you select from one of the domains associated with your mystery, which you cast as a revelation spell, causing it to gain the cursebound trait.</p>
</div>

<footer class="card-footer">
<span>Level 1</span>
<span>Passive</span>
</footer>
</div>
</div>
<div class="message-content">
<div class="pf2e chat-card item-card" data-actor-id="5YCNP4CvPp6hw7WN" data-item-id="W3i9rRrnkvwCpdf8">
<header class="card-header flexrow">
<img src="systems/pf2e/icons/features/classes/revelation-spells.webp" title="Revelation Spells" width="36" height="36">
<h3>Revelation Spells</h3>
</header>
<div class="tags">
<span class="tag tooltipstered" data-trait="" data-description="PF2E.TraitDescriptionOracle">Oracle</span>
</div>
<div class="card-content">
<p>The powers of your mystery manifest in the form of revelation spells, which are a type of focus spell. Casting a revelation spell costs 1 Focus Point and increases the effects of your <a class="content-link" draggable="true" data-uuid="Compendium.pf2e.classfeatures.ibX2EhKkyUtbOHLj" data-id="ibX2EhKkyUtbOHLj" data-type="Item" data-pack="pf2e.classfeatures" data-tooltip="Feat/Feature Item" data-args=""><i class="fas fa-suitcase"></i>Oracular Curse</a>. You start with a focus pool of 2 Focus Points. You refill your focus pool during your daily preparations, and you can regain 1 Focus Point by spending 10 minutes using the Refocus activity to reconcile the conflicting or unconventional nature of your divine mystery.</p>
<p>Focus spells are automatically heightened to half your level rounded up. Focus spells don't require spell slots, and you can't cast them using spell slots (see <a class="content-link" draggable="true" data-uuid="Compendium.pf2e.classfeatures.7AVspOB6ITNzGFZi" data-id="7AVspOB6ITNzGFZi" data-type="Item" data-pack="pf2e.classfeatures" data-tooltip="Feat/Feature Item" data-args=""><i class="fas fa-suitcase"></i>Divine Spellcasting (Oracle)</a>). Taking feats can give you more focus spells and increase the size of your focus pool, though your focus pool can never hold more than 3 Focus Points.</p>
<p>Revelation spells have the cursebound trait, unlike other focus spells. This trait means they increase the severity of your oracular curse (see below) when cast. You can't cast a cursebound spell if you don't have an oracular curse.You learn two revelation spells at 1st level. The first is an initial revelation spell determined by your mystery. The second is an initial domain spell you select from one of the domains associated with your mystery, which you cast as a revelation spell, causing it to gain the cursebound trait.</p>
</div>

<footer class="card-footer">
<span>Level 1</span>
<span>Passive</span>
</footer>
</div>
</div>
Magus
Magus2y ago
Dont worry about it I will investigate the best way
Magus
Magus2y ago
GitHub
GitHub - elizeuangelo/fvtt-module-chat-cleaner
Contribute to elizeuangelo/fvtt-module-chat-cleaner development by creating an account on GitHub.
Apostol Apostolov
Many thanks to @Magus for saving my games with this excellent mod, it helps people with lower memory handle chat log without suffering too many freezes or slowdowns.
Leo The League Lion
@Apostol Apostolov gave :vote: LeaguePoints™ to @Magus (#109 • 12)
Want results from more Discord servers?
Add your server