Skyrim Special Edition
0 of 0

File information

Last updated

Original upload

Created by

Blackread

Uploaded by

Blackread

Virus scan

Safe to use

Tags for this mod

About this mod

Reduces the script load introduced by the barbasdialoguedetect script in 3DNPC.

Requirements
Permissions and credits
Changelogs
I recently did a quick check up on my papyrus load with the excellent Papyrus Profiler and noticed that the script barbasdialoguedetect from the mod Interesting NPCs SE (3DNPC) had quite a large number of OnUpdate calls. I investigated the script and found out that despite the name it actually has nothing to do with the eponymous dog, but rather is a general use script that detects if the player is in dialogue with an NPC that is not currently a follower. Apparently the script is used to prevent 3DNPC followers from talking while the player is in dialogue.

Every four seconds the script looks for NPCs around the player and checks if any of them are in dialogue with the player. If the player is not in dialogue this results in quite a lot of function calls. In my 5-10 minute test profile I racked around fourteen thousand, which was 11.2 % of my total function calls. You can see the results in this flamegraph:

Thanks to the new papyrus functions provided by SKSE and Rogue's Gallery I replaced the OnUpdate cycle with an event that fires whenever the dialogue menu is opened or closed. This coupled with a few other optimisation steps drastically reduced the number of function calls, in this new flamegraph they have been reduced to 0.0 % so practically nothing:


This of course means that Rogue's Gallery is a requirement for this change, and as such this can never be included in the original mod, which does not have it as a dependency.

Just a script file, no ESP. If you find a mistake in the new script or have other suggestions for improvements let me know!


Requirements:

Interesting NPCs SE (3DNPC)
Rogue's Gallery

Installation:
Mod manager recommended, overwrite 3DNPC.
Safe to install mid save.

Credits:
Kris Takahashi for Interesting NPCs SE (3DNPC)

Borgut1337 for Papyrus Profiler
Noah for Rogue's Gallery