Help me fixpatch SkyBirds? Breakdown within (long)

Post » Sun Apr 05, 2015 7:29 pm

First of all, I do not claim to be an expert, which is why I'm calling for some assistance. The only reason I even care to look into this is because I believe a simple solution may be possible, and I would love some feedback as to whether or not my investigation is accurate, or off-track, for my own personal knowledge.
Anyway, this mod has been pleasure and pain. It brings so much life to the game, but as many of you know, over time it causes lots of problems.
I've removed, cleaned, and re-installed it twice after it broke my game (happened again yesterday), because I just love it so much. But this time around, knowing way more than I did even a couple months ago, I think I know what the issue with it is, and I think a solution may be possible without need for the source code.
Because modding is a free community effort, and the engine is so fragile, I feel like packaging source code with your mod is a responsible thing to do, but some mod authors don't feel this way. It's the only tiny thread of Intellectual Property available when modding this game, so I guess I sort of understand. SkyBirds is this way, and despite it being well-known for being problematic, and for some, game-breaking, the author has chosen not to release the source. That's their choice, not going to judge them for that.
HOWEVER...
After cleaning it this time, I think I may have found some of what it tends to bloat. If you aren't an experienced modder, or mod author, this might be a little jargon-y, but bear with me. In fact, I'm not claiming that I know enough to make an expert decision either, which is why I'm calling on any available mod authors to help me, and see if it's possible to make a patch that at least alleviates some of the problems.
STRUCTURE & PROBLEMS (as I understand them)
The inner workings of Skybirds aren't 100% apparent, as all of the markers, animation cues, and spawning are handled within its scripts. The way these are broken apart and named, gives some clue as to how it operates. At its core, it has a primary spawner script, which uses values provided in the MCM to control how many birds can spawn "per-spawner", and what the total maximum is. This is all fine (again, can't verify the actual implementation.)
However, over time (even just 10-20 levels in-game) the number of script instances skyrockets, to the point where the script engine begins to fail, barfing MASSIVE stack-dumps from every running script, which usually throws people on a wild goose-chase for things that aren't actually breaking.
Back to the point, NO OTHER scripted mod I've used -- and granted, I keep them very light -- ends up with more than a handful of script instances/references. Enhanced Blood Textures, which I used for probably 200 hours, has maybe 50 instances in the save. Wet and Cold almost none (because Isoku is a bloody professional!)
After about 40 IRL hours, SkyBirds had nearly **25,000** script instances. Once the problem started, upon loading any saved game, I would get immediate stack dumps of 300,000+ lines in the logs, and any in-game script would take upwards of 10 seconds to respond, even dialogue would freeze up and glitch, and I would crash soon after.
BUT WHY? Well digging through the Papyrus logs, I noticed that all of the mods I am using that use the "cloak" effect to apply things to NPCs -- Wet and Cold, Enhanced Blood Textures, Footprints, etc. -- were being attached to the birds, or at least were attempted to. Most of the time the stack dump records referred to other mods, they were instances where they were attaching to SkyBirds.
Using Saved Game Script Cleaner and Saved Game Scalpel I dug further into my save, and the mod itself and that's when I noticed that the way it attaches itself is likely what is causing these problems.
BREAKDOWN / THIS IS WHERE I NEED SOME HELP
To get itself into the game world, SkyBirds attaches its main set of scripts to many random things, which is the only time I've seen a mod do this, and I assume was done in an effort to keep the spawners working. It's bizzare to me. The items it attaches itself to are:
ACTIVATORS
  • FXcameraAttachEffectsACT [ACTI:0002F245]
  • critterSpawnInsects_Few [ACTI:000C51FF]
  • critterSpawnInsects_Many [ACTI:000C5209]
  • critterSpawnFirefly24x7 [ACTI:000DDF4C]
  • TreeFloraNirnroot01 "Nirnroot" [ACTI:000E1FB2]
  • FXbirdOPreyACT [ACTI:0010581F]
  • FXbirdOPreyNoNestACT [ACTI:00105824]
FLORA
  • BirdsNest02 "Birds' Nest" [FLOR:00023CFF]
  • TreeAspenStump01ScalyPholiota "Scaly Pholiota" [FLOR:0006F94D]
  • TreeAspenLog01ScalyPholiota "Scaly Pholiota" [FLOR:00070E42]
  • FloraSwampFungalPod01 "Swamp Fungal Pod" [FLOR:0007E8B8]
  • FloraGiantLichen "Giant Lichen" [FLOR:0007E8C2]
  • BirdsNest "Birds' Nest" [FLOR:0007E8C9]
  • FloraCreepCluster "Creep Cluster" [FLOR:000B03AF]
  • FloraCreepClusterRock "Creep Cluster" [FLOR:000B202C]
  • TreePineForestStump01MoraTapinella "Mora Tapinella" [FLOR:000EC7E7]
  • TreePineForestStump02AMoraTapinella "Mora Tapinella" [FLOR:000EC875]
  • TreePineForestStump02BMoraTapinella "Mora Tapinella" [FLOR:000EC876]
  • TreePineForestLog01MoraTapinella "Mora Tapinella" [FLOR:000ECE21]
  • TreePineForestHollow01BMoraTapinella "Mora Tapinella" [FLOR:000ECE9A]
  • ChickenNest "Chickens' Nest" [FLOR:001062D1]
  • TreeReachTreeStump01MoraTapinella "Mora Tapinella" [FLOR:00108EE2]
Again, I have never seen another mod do this, and I truly do not know why this is the method used to execute the spawners. Every time a new instance of any of these objects is created, a new instance of the SkyBirds scripts are created and associated to those objects. There is apparently no control happening under the covers to ensure singular instances of the scripts (is that even possible?)
That means -- and please correct me if I'm wrong -- any time Mora Tapinella appears in the game world, hey guess what, the SkyBirds spawner gets a whole new instances of the script. Any time Creep Cluster shows up in the overworld, another instance of the spawner is created and running. The values in the MCM keep the number of birds to a maximum, but the instances of the script-to-object association run out of control and have no limits. This would explain why thousands and thousands of script instances grow over a relatively short period of time.
As you can guess, in a matter of 30-40 in game hours, you will run across a LOT of these items/objects, and that's why it spirals out of control and ends up with so many script instances.
HOW CAN THIS BE FIXED?
Well, without access to the source code, I can't say for certain exactly what is going on under the surface, however it seems fairly obvious to me that instead of attaching the script over and over and over to objects that spawn, there could be some sort of quest, or even a spell on the player or something that continues to make the birds spawn wherever they go, if that was the intention.
I'm not versed enough with Papyrus (specifically scoping/instances/etc.) to know whether this can be fixed simply, but it seems like it could have a somewhat simple solution. I'm going to experiment a little bit with this, but really need someone who is well-versed in quests/scripting to help me out. It seems like the idea was to associate it to those objects, so birds appear wherever they do, but I don't know why they didn't just make static markers through the world and associate them to that, or any other number of methods.
WHY DO I CARE?
I like to fix stuff, I can't help it. And besides having this strange implementation that inevitably breaks, SkyBirds is an incredible mod. If it can be patched with a simple ESP, I think the community would love it, as would I.
OKAY I'M DONE TALKING NOW BYEEE :D
User avatar
Roanne Bardsley
 
Posts: 3414
Joined: Wed Nov 08, 2006 9:57 am

Return to V - Skyrim