Psychic Harmonizer Lag Fix

If you liked this item, please rate it up on Steam Workshop page.

Author: avil

Last revision: 29 Jul, 2021 at 17:43 UTC (1)

File size: 26.62 KB

On Steam Workshop

Description:

Fixes the reason why psychic harmonizer slows down the game when looking at a mood tab.

Possible to add mid game. If you do, you have to clear all the old harmonizer memories for a mod to take effect (i. e. isolate harmonizer carriers from the rest of colonists once).

So why exactly vanilla harmonizer creates a lag?
If you look at why harmonizer slows the game, the whole thought mechanic could use an update. While thoughts are USED and UPDATED only each 250 TICKS, mood tab tries to do it every FRAME. Harmonizer uses difficult rules for it to work, one of them is proximity, so in combination it takes sizable amount of time to calculate. But when it’s done only each 250 ticks it’s not noticeable, that’s why it’s usually fine as long as you don’t look at a mood tab.
What I did is cached a thought value. Value is updated only at slow ticks (when it’s checked if thought should be removed or not), and used everywhere where it’s needed. That’s why difficulty of the calculation doesn’t matter for GUI, especially when game is paused.

Download
Required DLC:

These DLC should be installed in order to use this item.


RimWorld - Royalty
Revisions:

Old revisions of this mod are available below. Click the link to download.