How to CLEAN your SAVEGAMES from BROKEN SCRIPTS - Tutorial - Solving C
Posted 19 February 2013 - 10:18 PM
It didn't solve my problem, but it ruled out a script-based cause of the issue. Reverted my savegame and no harm done.
At absolute worst this is an extremely useful diagnostic tool. At best, well, I'm planning on hitting my endgame save with it, which I only load up anymore because a certain five year old loves riding horses around in the game. Maybe I won't spend so much time booting the game back up after it inevitably crashes. (A tendency which existed before I installed -any- mods, and which I suspect originates with vanilla scripts. The savegame has been around since Skyrim was released, and the patches made a lot of script-related stuff break, such as my weapon plaques.)
And as a programmer whose job duties include parsing deliberately obfuscated data formats, I suppose it couldn't hurt to look at the Papyrus data. I'm not familiar with making mods, though, and the first step would be to produce several savegames with slightly different Papyrus scripts.
Any mod-makers familiar with the scripting engine out there willing to team up on this issue? It will include copious amounts of busywork on your part.
Posted 19 February 2013 - 10:30 PM
@Arthmoor, What you're doing isn't really doing that though. You're erasing all of the data. While the game will replace it with what it finds as it loads, that data has been reset and is no longer valid for the state of your game.
You are absolutely right, i'm not doing that. Forget about me and my tutorial. Let's talk abstract.
So do you think that the problem is with data only? If we manage to restore the data somehow, what other issues can we face?
You appear to be approaching this reasonably.
The largest problem with script issues are scripts that left behind update events that haven't been properly unregistered. While what this procedure outlines will remove that problem, it is doing so by removing every single scrap of script data in the save. It's not a viable approach.
What should be done instead is to work with someone (in this case, Trira on the official forums) to help decode the actual save game format to a point where it becomes possible to remove individual script items safely. It's an effort that will take time to get done right, but it will never happen if people don't start working together to solve it.
That said - SKSE is soon to issue an update where these abandoned update events will be killed and thus dropped from the save. Their approach is perfectly safe since they've hooked the underlying engine code in a way that lets them kill only what actually needs killing. They've also said it would be unlikely to be safe for them to try and remove abandoned data from ALL scripts.
Still, removing abandoned update events is a huge thing, and is easily 90% of the problem with why people are flocking to this tool and then breaking their games after using it.
Posted 19 February 2013 - 10:44 PM
It is similar to this
Same codes for operations and types. BUT there are major differences in structure. Compiled scripts are stored another way inside savegames. For example, there is no difference between property and common variable when they are located in savegame.
My priority is values, so I started with building different temporary plugins and assigning marker values to variables. Then I just search the marker values inside the binary and try to measure things. Still need to handle the string variables and arrays, but I'm very close.
The thing that is really bother me is the large section between the ending of the second structure (where scripts are linked with members) and the beginning of values definition. It can be the bytecode, I looking a way to skip this scary thing without parsing, but I'm afraid it's not that simple.
Again, will appreciate any advice about this particular case or about methodology in general.
Posted 19 February 2013 - 10:50 PM
Edited by Twitch2026, 20 February 2013 - 12:07 AM.
Posted 19 February 2013 - 11:15 PM
Edited by M0rningLightM0untain, 19 February 2013 - 11:18 PM.
Posted 19 February 2013 - 11:33 PM
Thanks, @flexcreator, for dragging this issue out into the light. At the very least you've motivated people.
Posted 20 February 2013 - 12:03 AM
I loaded my save (which was made inside that starting room from Alternative Start mod) and ASSAULT mode activated from DeadlyDragons and there was a freaking dragon flying there!!!
Posted 20 February 2013 - 12:52 AM
Edited by adamlevin, 20 February 2013 - 12:53 AM.
Posted 20 February 2013 - 12:55 AM
Posted 20 February 2013 - 01:07 AM
I went hunting for the source myself in the Bethesda SKSE thread, but couldn't find it.