Includes support for the CC Fishing spawner script, it doesn't require CC Fishing. This mod is compatible with all versions of the game : LE SSE AE VR ... (well except for that toaster one)
This mod doesn't alter Critter records, Ingredients, Spawner placement or configuration, Critter behaviour. It only changes the internal work of the CritterSpawn script and the fishing equivalent.
I highly recommend Butterfly Unchained as it optimizes the critter scripts which this mod doesn't touch, it also incorporates the fixes that were included in the [Critter - Simply script fixes] mod without altering the spawning mechanism.
This mod is compatible with: Butterflies Land True Butterflies Unchained Complete Alchemy and Cooking Overhaul Catch Critters in Jars
And every mod that just reskins critters, adds new ones, or add more spawners in the world like : Butterfly Improved by zzjay - SE Rally's Butterflies Moths and Torchbugs Lepidopteran Invasion Picta Series - A Critters Life - Additional Insect Spawns That nsfw bugs mod Critters the NFT collection ( technically everything is compatible with those except your bank account, they're useless)
It's safe to override the Vanilla Script Optimizations version, that one is my very early attempt at fixing that script without rewriting it.
It is (as of 1.3) safe to install and update on an ongoing save.
I would like to add this to my playthrough, Not many mods, Mostly Vanilla with a few enhancements
I read to make sure I do not have active scripts of critterspawn . . Ive had 3 with the CC that you warned against - - I go into breezehome, Mess around, Save - - Check in resaver.....still active (3) - - - same thing in dragonsreach, same thing bannered mare . . still active (3)
This shouldn't be a problem since 1.3, those are most likely stuck instances from the vanilla script. Those can be safely terminated using the Resaver.
However I just recommend having Papyrus Tweaks which helps handling cleanup on such stragglers and Butterflies Unchained to cover the critter side of the scripts
ok, I have papyrus tweaks installed already . . but never used unchained . . . on my way to High Hrothgar, once I get there I will look into everything
thank you for the knowledge !!!
I Entered Hrothgar, waited 15 seconds, saved. . active scripts gone. . . your mod now installed . . thank you
for whatever reason in my load order in a fresh save I don't have any bugs spawning. I updated this mod in hopes it would fix it, but it doesn't. It happens regardless of whether this mod is enabled or not. Has anyone heard of this issue and know a fix?
Before doing any xedit prodding, we should try to see if the bugs themselves aren't broken, try downloading butterflies unchained along with this mod, it should override anything that may alter critter scripts, my mod only manages spawners.
Load your entire load order on xEdit
find 0006B45C <critterSpawnDragonflies24x7> (top left text field you can enter 0006B45C )
check if there are entries for it in the "referenced by" tab in the right pane , and note the RefID of one of them, preferably one that is defined in Skyrim ESM (ex : 000AAC47)
Now go back to the main view tab and check if a script called "critterspawn" exists
check if it has an entry under Critter Types and note it (ex: critterDragonflyTypes [FLST:0006CD3A])
got to the same for the RefID from earlier and make sure its last override isn't deleted or disabled, and if it has scripts attached to it do the checks from 3 & 4
Lastly go to the formlist from critter types and check if it has entries.
If all checks out, and this mod is loaded at the end of your order (left pane in MO2), if you open your game, and type the following commands: coc whiterun Player.Moveto 000AAC47 (or the RefID you recorded from earlier)You will be teleported on top of this spawner, this spawner is 24x7 so it should be spawning all day long. If nothing is spawned, make a save and PM it to me.
0006B45C is an invisible spawner for spawning dragonflies 24/7
references to it are instances of it placed around the world, a mod seeking to disable bug spawns may disable those
the script critterspawn is what handles spawning, and it's assigned to the form along with parameters
of these parameters is a formlist which defines the selection of bugs to spawn, if it's not assigned or the list itself is empty, nothing will spawn
Please help me, Im desperate. lol Alright, I have a reference handle problem. Checked my save and saw a folder called REFR it has 800k plus references in there. Checked a lot of them and almost all that I checked were these. Since Resaver keeps a backup anyway, I deleted all of them. The save worked fine and enginefixes no longer gave a warning about ref handle limit. The problem now is, after just a few minutes of playing, the save immediately generates upwards of 30,000 refid's like the one in the screenshot. Less than an hour of playing later and they have already accumulated to 100k plus entries. I checked these refid's in the command console in-game and the name of ALL of them is "DoNotPlaceSmallCritterLandingMarker". Is this in any way related to this mod? Perhaps there's something I didn't do right? I did have this mod installed from the very beginning, though.
pm me a save file, I'll look inside it. Critter behaviour scripts (like crittermoth.pex) spawn landing markers as they fly around, this mod doesn't alter those scripts however . Have you installed anything else that alters critter behaviour ?
You had an older version of this mod that had a race condition bug. For posterity, reverting to before the onset as you did and updating the mod will prevent the issue from happening again. Otherwise the only recourse is to do as you did the first time but also terminate the active spawner script. I apologize for that :/
That is a stack dump. That's when the script engine decides to dump all running scripts at the time after it either was overloaded or the game froze for a bit for reasons that can be unrelated to scripts.
The part you copied here is a list of the stacks being dumped (and their state) and it should be quite longer than that. My scripts were running at the time and they just happen to be on the top of the list.
I can't tell anything from this, I'd need the whole log file, and if possible a save file before or after that.
More importantly I need to know what was happening in the game (large combat ? just loaded in ? just entered a city ? your character died ?) And you've experienced when this happened ? game froze ? script lag ?
Right...this does not contain too much information.I think it's due to bad condition of my CPU that time,'cause after that I haven't notice this any more. Directly answering,no combat/entering event/death,just around Riverwood.I just experienced script lagging. I also notice that there's a fix in bug comment of Butterflies Unchained,which explaining why there's still stack dump in CritterMoth.pex and given fixes on that.Would you mind telling me if you have similar patching? That'all.Thanks and sorry to bother you.
USSEP Already does a good job of optimizing it. Chances you have something else messing with the records. check if FCAmbWaterfallSalmon01 "Salmon" [ACTI:0010B035] or FCAmbWaterfallSalmon02 "Salmon" [ACTI:0010C3BA] are being overridden in xEdit
also if Effects\FXAmbWaterfallSalmon02.nif file is being replaced in the data tab if on MO2
The script only handles what happens if you pick it up or hit it. Doesn't interfere with the spawning in the first place.
FCAmbWaterfallSalmon01 and FCAmbWaterfallSalmon02 are found in Skyrim.esm, HearthFires.esm and ccBGSSSE001-Fish. FXAmbWaterfallSalmon02.nif file are not replaced.
I have two more problems with respawning. Bandits do not appear in Helgen. They appeared there once, I killed them and they are no longer there. Same thing in Karthspire.
I use the game settings for fast spawn: iHoursToRespawnCell = 24 iHoursToRespawnCellCleared = 72 Could this be the cause of the problem?
you could try to spawn (place at me) one of the activators to check if it's visual or a respawn issue. If you have access to Discord, the Skyrim Mods Discord can be of better help otherwise the reddit.
https://easyupload.io/m/cbw0wg - two logs that you can look at with https://www.speedscope.app/. Any way to just stop critters in general? lol. Seems like they're just chewing up things.
When there isn't much going on except for spawners checking every 3 to 4.5 seconds whether to spawn or not, your graph will naturally show their activity as most of the activity. effectively rendering it just a measure for frequency of calls.
Now why do you want to stop critters ? to make room for the rest of the stuff ? but the graph isn't showing the activity as a % of a total capacity. And you don't have enough stuff in there to reach that limit. You'll need to make an other recording with some real script heavy mods to see that. and the only impact you'll notice is Script Lag.
Are you experiencing script lag ? Script lag is when actions related to scripts like dialogue/scripted spell effects/scripted interaction are delayed while every thing else seems to run smoothly.
And the reason everything else runs smoothly is because papyrus runs separately from the rest of the game on a preset per-frame budget, so it doesn't affect your FPS.
So in the end, even if you remove all the critter scripts, it won't improve your fps unless maybe if you're running on an underpowered CPU by 2011 standards.
I do wonder if this is supposed to help in my case. I ran Papyrus Profiler to see what papyrus script's are constantly running in background. When uploaded to speedscope.app I saw that a lot of critterspawn.OnUpdate, critterdragonfly.OnUpdate etc. are constantly running and could potentialy reduce my game performance, so I've searched on google about the critter scritps and came along your fix. Ultimately it did not stop or reduce the calls from critter-like OnUpdate functions. I wonder if anything else can I do to reduce their calls... First papyrus profiling run without Critter Congestion Fix Second papyrus profiling run with Critter fix
Papyrus profiler only shows call frequency, it doesn't show how much time or resources a call consumes. Not all calls weigh the same and it's normal for critter stuff to be frequent.
What this mod does in contrast to vanilla is explained on the mod description but to go over it again:
On a single flora item, there could be up to 4 spawner instances on average placed by the level editor. The game has to decide for each spawner instace that loads in your draw distance whether it should be spawning or not based on
Distance from you
Time of the day
Weather etc ...
These things will change as time advances and as you move around. and the frequency measured will vary a lot depending on how many spawners are around you.
The only latent calls done by the spawner are in the act of spawning itself, checks contain no slow latent calls.
Each spawner will do one check and schedule a delayed update (a randomized number of seconds), Spawners aren't calling on update every frame. Each spawner will do its checks from the fastest to the slowest, so that if the check fails it fails. Each spawner will cache everything it fetches, Spawners will only request information when needed.
These calls do not weigh much, they're fast in fast out, and unlike the vanilla script, you can rarely catch more than 3 consecutive active stacks on one save file. The only way to reduce their calls in any significant manner is to disable the critter system entirely.
vanilla spawners spawn a number of critters initially (or attempt to ..) then stop. if you catch them all and don't leave the area they wouldn't respawn. it would take for you to leave and come back for the spawners to reset.
The standard version of this mod makes it so after sometime a new batch is spawned: you're likely in the wilderness so more bugs will surely come around :D
The no respawn version mimics the vanilla behaviour.
The old respawn version does what the standard version does except with no delay subtlety (like not waiting for you to be looking away to sneakily spawn more bugs )
The description seems pretty clear on having to get rid of certain running scripts if installing on an ongoing save, but then the pinned post says "It is (as of 1.3) safe to install and update on an ongoing save. "
While the changelog to 1.2 says something like:
Added measures to prevent runaway spawners when installed one saves with active critterspawn stacks.
I am pretty sure there's something I am not understanding from the last quote correctly, or is it really about this being installed midsave where the scripts are already running?
With the newer versions, old stacks from the vanilla script should resolve in time. If you want to be sure about it, load your save in the Resaver, look in the hierarchy under Active scripts and Suspended Stacks and select all instances of CritterSpawn , right click and Terminate.
Make a backup just in case. And also consider getting Papyrus Tweaks.
*The game freezes the script VM when saving, and actually saves the interrupted stacks with their state and the actual code that was running function. So even if the script file changes, some old functions will keep running. Usually they would error out and clear away in time, but the vanilla critterspawn script is prone to go on an infinite loop. The newer versions of this mod detect that behaviour and diffuse the loop.
Just a quick question! How many critterspawn scripts are normal? When do I need to be concerned? I'm trying to troubleshoot/fix my 100hr save that keeps freezing/infinite load screening on me and I'm unsure if I need this or not.
with is mod ? on average you should catch 0-3 active instances in the same frame . the vanilla script tends to get stuck in loops in modded load orders and overtime irrelevant instances from hours of gameplay ago loiter on and start clogging the quota of processing the script engine is allocated each frame.
vanilla usually starts snow balling once you start seeing recurrent 6+ stacks and a couple of suspended ones. if you're seeing something like in the screenshots above, you're in trouble. you can clear them manually by terminating them from the resaver. And install this to prevent that from happening again.
349 comments
This mod is compatible with all versions of the game : LE SSE AE VR ... (well except for that toaster one)
This mod doesn't alter Critter records, Ingredients, Spawner placement or configuration, Critter behaviour. It only changes the internal work of the CritterSpawn script and the fishing equivalent.
This mod is reliant on vanilla compatible Critter.pex and Firefly.pex so make sure to uninstall Critter - Simply script fixes - DELETED at Skyrim Nexus - Mods and Community (nexusmods.com) if you still have it (the only incompatibility so far)
I highly recommend Butterfly Unchained as it optimizes the critter scripts which this mod doesn't touch, it also incorporates the fixes that were included in the [Critter - Simply script fixes] mod without altering the spawning mechanism.
This mod is compatible with:
Butterflies Land True
Butterflies Unchained
Complete Alchemy and Cooking Overhaul
Catch Critters in Jars
And every mod that just reskins critters, adds new ones, or add more spawners in the world like :
Butterfly Improved by zzjay - SE
Rally's Butterflies Moths and Torchbugs
Lepidopteran Invasion
Picta Series - A Critters Life - Additional Insect Spawns
That nsfw bugs mod
Critters the NFT collection ( technically everything is compatible with those except your bank account, they're useless)
It's safe to override the Vanilla Script Optimizations version, that one is my very early attempt at fixing that script without rewriting it.
It is (as of 1.3) safe to install and update on an ongoing save.
Thank you for the mod / modding work
I would like to add this to my playthrough, Not many mods, Mostly Vanilla with a few enhancements
I read to make sure I do not have active scripts of critterspawn . . Ive had 3 with the CC that you warned against - - I go into breezehome, Mess around, Save - - Check in resaver.....still active (3) - - - same thing in dragonsreach, same thing bannered mare . . still active (3)
Any idea what is going on or a suggestion >?
However I just recommend having Papyrus Tweaks which helps handling cleanup on such stragglers and Butterflies Unchained to cover the critter side of the scripts
thank you for the knowledge !!!
I Entered Hrothgar, waited 15 seconds, saved. . active scripts gone. . . your mod now installed . . thank you
Load your entire load order on xEdit
If all checks out, and this mod is loaded at the end of your order (left pane in MO2), if you open your game, and type the following commands:
coc whiterunYou will be teleported on top of this spawner, this spawner is 24x7 so it should be spawning all day long.Player.Moveto 000AAC47 (or the RefID you recorded from earlier)
If nothing is spawned, make a save and PM it to me.
Critter behaviour scripts (like crittermoth.pex) spawn landing markers as they fly around, this mod doesn't alter those scripts however .
Have you installed anything else that alters critter behaviour ?
For posterity, reverting to before the onset as you did and updating the mod will prevent the issue from happening again.
Otherwise the only recourse is to do as you did the first time but also terminate the active spawner script.
I apologize for that :/
But received this today:
[11/29/2024 - 03:14:47AM] Dumping stack 78226:
[11/29/2024 - 03:14:47AM] Frame count: 3 (Page count: 3)
[11/29/2024 - 03:14:47AM] State: Running (Freeze state: Frozen)
[11/29/2024 - 03:14:47AM] Type: Normal
[11/29/2024 - 03:14:47AM] Return register: 3282.747559
[11/29/2024 - 03:14:47AM] Has stack callback: No
[11/29/2024 - 03:14:47AM] Stack trace:
[11/29/2024 - 03:14:47AM] [ (A39402F6)].critterspawn.GetPlayerDistance() - "CritterSpawn.psc" Line 247
[11/29/2024 - 03:14:47AM] IP: 540Instruction: 13Line: 247
[11/29/2024 - 03:14:47AM] [::temp32]: False
[11/29/2024 - 03:14:47AM] [::temp35]: [critterspawn < (A39402F6)>]
[11/29/2024 - 03:14:47AM] [::temp36]: 3282.747559
[11/29/2024 - 03:14:47AM] [::temp33]: 0.000000
[11/29/2024 - 03:14:47AM] [::temp34]: None
[11/29/2024 - 03:14:47AM] [ (A39402F6)].critterspawn.shouldSpawn() - "CritterSpawn.psc" Line 265
[11/29/2024 - 03:14:47AM] IP: 637Instruction: 24Line: 265
[11/29/2024 - 03:14:47AM] [::temp37]: False
[11/29/2024 - 03:14:47AM] [::temp38]: 30
[11/29/2024 - 03:14:47AM] [::temp39]: True
[11/29/2024 - 03:14:47AM] [::temp40]: [Cell <Riverwood (00009732)>]
[11/29/2024 - 03:14:47AM] [::temp41]: None
[11/29/2024 - 03:14:47AM] [::temp42]: 0.000000
[11/29/2024 - 03:14:47AM] [::temp43]: False
[11/29/2024 - 03:14:47AM] [Distance]: 0.000000
[11/29/2024 - 03:14:47AM] [::temp44]: False
[11/29/2024 - 03:14:47AM] [::temp45]: None
[11/29/2024 - 03:14:47AM] [::temp46]: False
[11/29/2024 - 03:14:47AM] [ (A39402F6)].critterspawn.OnUpdate() - "CritterSpawn.psc" Line 131
[11/29/2024 - 03:14:47AM] IP: 171Instruction: 4Line: 131
[11/29/2024 - 03:14:47AM] [::temp7]: True
[11/29/2024 - 03:14:47AM] [::temp8]: 30
[11/29/2024 - 03:14:47AM] [::temp9]: False
[11/29/2024 - 03:14:47AM] [::NoneVar]: None
[11/29/2024 - 03:14:47AM] [::temp10]: 0.000000
May I ask if you can explain this.I am still new to this part.
The part you copied here is a list of the stacks being dumped (and their state) and it should be quite longer than that.
My scripts were running at the time and they just happen to be on the top of the list.
I can't tell anything from this, I'd need the whole log file, and if possible a save file before or after that.
More importantly I need to know what was happening in the game (large combat ? just loaded in ? just entered a city ? your character died ?)
And you've experienced when this happened ? game froze ? script lag ?
Directly answering,no combat/entering event/death,just around Riverwood.I just experienced script lagging.
I also notice that there's a fix in bug comment of Butterflies Unchained,which explaining why there's still stack dump in CritterMoth.pex and given fixes on that.Would you mind telling me if you have similar patching?
That'all.Thanks and sorry to bother you.
Oh, and... your mod works correctly.
check if
FCAmbWaterfallSalmon01 "Salmon" [ACTI:0010B035] or
FCAmbWaterfallSalmon02 "Salmon" [ACTI:0010C3BA]
are being overridden in xEdit
also if Effects\FXAmbWaterfallSalmon02.nif file is being replaced in the data tab if on MO2
The script only handles what happens if you pick it up or hit it. Doesn't interfere with the spawning in the first place.
FXAmbWaterfallSalmon02.nif file are not replaced.
I have two more problems with respawning.
Bandits do not appear in Helgen. They appeared there once, I killed them and they are no longer there. Same thing in Karthspire.
I use the game settings for fast spawn:
iHoursToRespawnCell = 24
iHoursToRespawnCellCleared = 72
Could this be the cause of the problem?
you could try to spawn (place at me) one of the activators to check if it's visual or a respawn issue. If you have access to Discord, the Skyrim Mods Discord can be of better help otherwise the reddit.
I will try everything you suggested.
Now why do you want to stop critters ? to make room for the rest of the stuff ? but the graph isn't showing the activity as a % of a total capacity. And you don't have enough stuff in there to reach that limit. You'll need to make an other recording with some real script heavy mods to see that. and the only impact you'll notice is Script Lag.
Are you experiencing script lag ? Script lag is when actions related to scripts like dialogue/scripted spell effects/scripted interaction are delayed while every thing else seems to run smoothly.
And the reason everything else runs smoothly is because papyrus runs separately from the rest of the game on a preset per-frame budget, so it doesn't affect your FPS.
So in the end, even if you remove all the critter scripts, it won't improve your fps unless maybe if you're running on an underpowered CPU by 2011 standards.
First papyrus profiling run without Critter Congestion Fix
Second papyrus profiling run with Critter fix
What this mod does in contrast to vanilla is explained on the mod description but to go over it again:
On a single flora item, there could be up to 4 spawner instances on average placed by the level editor.
The game has to decide for each spawner instace that loads in your draw distance whether it should be spawning or not based on
These things will change as time advances and as you move around. and the frequency measured will vary a lot depending on how many spawners are around you.
The only latent calls done by the spawner are in the act of spawning itself, checks contain no slow latent calls.
Each spawner will do one check and schedule a delayed update (a randomized number of seconds), Spawners aren't calling on update every frame.
Each spawner will do its checks from the fastest to the slowest, so that if the check fails it fails.
Each spawner will cache everything it fetches, Spawners will only request information when needed.
These calls do not weigh much, they're fast in fast out, and unlike the vanilla script, you can rarely catch more than 3 consecutive active stacks on one save file. The only way to reduce their calls in any significant manner is to disable the critter system entirely.
The standard version of this mod makes it so after sometime a new batch is spawned: you're likely in the wilderness so more bugs will surely come around :D
The no respawn version mimics the vanilla behaviour.
The old respawn version does what the standard version does except with no delay subtlety (like not waiting for you to be looking away to sneakily spawn more bugs )
While the changelog to 1.2 says something like:
I am pretty sure there's something I am not understanding from the last quote correctly, or is it really about this being installed midsave where the scripts are already running?
Make a backup just in case. And also consider getting Papyrus Tweaks.
*The game freezes the script VM when saving, and actually saves the interrupted stacks with their state and the actual code that was running function. So even if the script file changes, some old functions will keep running.
Usually they would error out and clear away in time, but the vanilla critterspawn script is prone to go on an infinite loop.
The newer versions of this mod detect that behaviour and diffuse the loop.
And install this to prevent that from happening again.