Jump to content

Photo

How to CLEAN your SAVEGAMES from BROKEN SCRIPTS - Tutorial - Solving C


  • Please log in to reply
1120 replies to this topic

#521
flexcreator

flexcreator

    Resident poster

  • Premium Member
  • 3,139 posts
In response to post #7706071. #7706405, #7707030 are all replies on the same post.

OMG, this is very valuable information! Thank you!

Do you have any idea how to transfer the data if arrays have different sizes?

#522
Tossapon

Tossapon

    Newbie

  • Members
  • Pip
  • 18 posts
In response to post #7706071. #7706405, #7707030, #7707706 are all replies on the same post.

I'm afraid it impossible to transfer data correctly to the array with different size. Those arrays have unpredictable nature because they can change their size arbitrary number of times according to script algorithm. However if we analyze the byte code of script which array is bound to, it may be possible to achieve nearly prefect dynamic array transfer. So far i skip data transfer for arrays with difference size since they're unsafe to do and present only very small number of total arrays. Even the array with same size, it still not entirely possible to transfer correctly if the script has strange algorithm to handle the said array. For example, they use some other variable to mark an array index as data identifier though they're very unlikely but possible. Example. Old script int nSomeArray[10]; int nState1index = 4; <-- This points to the nSomeArray[]; int nState2index = 5; New script int nSomeArray[10]; int nState1index = 2; int nState2index = 4; Feel free to look at link provided in my original post, I wrote everything I know to that page already. Byte code and internal script state probably in unknown section after ArrayData section. Edit: Some arrays do not present in new save game because they're initialize within a script which may not run yet. I might try to copy the whole array to new file and see if it works... (This happen with price array of Economic of Skyrim mod.)

Edited by Tossapon, 31 March 2013 - 06:28 AM.


#523
flexcreator

flexcreator

    Resident poster

  • Premium Member
  • 3,139 posts
In response to post #7706071. #7706405, #7707030, #7707706, #7711943 are all replies on the same post.

> Some arrays do not present in new save game because they're initialize within a script which may not run yet
That is the main problem, I think. Sometimes, when you change the size of the papyrus section, the game will recognize the save as corrupted. Maybe you also need to recalculate the offsets in the root ESS container.

I still can't catch the beginning of the bytecode, I'm sure it's located after the array data.

Here is what I know about it:
First, script is defined, ScriptName mentioned twice. After that you will see the function name.

(02 00 - always for objects?) (3D 09 - StringIndex, ScriptName ) ( 3D 09 - ScriptName ) ( 7C 76 - OnUpdate ) (00 00 03 02) (A8 0B -None ) (61 76 - "" ) 00 00 00 00 00 00 00

Then you will see the bytecode, method calls looks like in PEX:

(19 - callstatic) [02-String?] (67 76 - Debug ) [02] (CE 76 - MessageBox) 01 (64 76 - ::nonevar ) [03-int?] (01 00 00 00) [02] ( CF 76 - "UPDATE_BEGIN" )
( 17 - callmethod) [02] (D0 76 - Kill) [01] ( 3E 09 - ::SeranaReference_var )

Then script instance is defined. Script state has unknown format to me, but it has the same data types as in ObjectData.
[01] ( 3D 09 - ScriptName ) ( 70 D5 0A 26 - scriptID ) ( SCRIPT STATE ) (UKNOWN DATA) (NEXT SCRIPT)

I have also noticed that not all script bodies are stored in the savegame. The game stores only those functions that were working at the moment of saving. The only reason for game to keep the bytecode from the old mods in the Papyrus section is that their functions is probably bugged and keep working forever.

#524
Tossapon

Tossapon

    Newbie

  • Members
  • Pip
  • 18 posts
In response to post #7706071. #7706405, #7707030, #7707706, #7711943, #7714172 are all replies on the same post.

> Maybe you also need to recalculate the offsets in the root ESS container. That's not the case since I tried to import script from another save which largely different in size and the it does not report the save as corrupted. EDIT: I found something interesting about array. When I appended an array to the file, game works fine if I copy everything from an already existing array but if I increment the ID of the copied array by 1, my MCM menu got broken. There must be some rule about assigning new IDs to new script objects but I don't know it yet. EDIT 2: Just my guess but when I assign new ID which is largest ID + 0x20, no problem was found. EDIT 3: Found the cause of previous corrupted save. Due to reference in the restored reference array is invalid or no longer exist in new save (Including string reference) thus corrupts the save game.

Edited by Tossapon, 01 April 2013 - 05:31 PM.


#525
Rotaur

Rotaur

    Newbie

  • Members
  • Pip
  • 11 posts
I can confirm the great efficiency of SKSE cleaning procedure method. It really WORKS! However the process requires PATIENCE, for it may take several hours. In my case it took practically the entire day. Nonetheless, the method is perfectly safe and simple and serves people with older Windows (read below). Before that, I reached the point that my game became unplayable due to constant CTD's; my save file grown to the size of almost 88Mb! Earlier running game freezed every minute for 5-6 seconds and finally every freeze becomed CTD. In my desperation, I was about to use the Flexcreator's drastical method. Unfortunately I've come across unpleasant surprise: the Flexcreator's bat files don't run on WinXP. Happily, some people (Talos bless them) mentioned on this very thread about new SKSE version incoming, which offers salvation - Talos bless SKSE creators! I hope you don't mind the reminder of the procedure: 1. Get at least the 1.06.08 version of SKSE http://skse.silverlock.org/ and install it 2. Go to your Skyrim "Data" folder and create the SKSE folder (if you don't have one already) 3. Open your Data\SKSE folder and create SKSE.ini file (if you don't have one already) 4. Write (or paste) the following lines to opened SKSE.ini file and save changes (close the file): [General] ClearInvalidRegistrations=1 5. Run the game using skse_loader.exe (it should be located directly in your Skyrim folder) 6. Load your saved game you wish to cleanse and the process should start automatically (don't expect any notification - this is shy work) 7. You may open console and type: ClearInvalidRegistrations This command is not necessary, but can ensure you that you have the value of 0 8. DISABLE YOUR AUTOSAVE options and DO NOT USE QUICKSAVE during the cleaning process 9. It is recommended to move immediately your character to the safe interior location, like Breezehome or Test Hall ("coc qasmoke" console command) and make new save at once THROUGH CONSOLE COMMAND "save nameyourfile" (for example: save washmydirt) 10. Make sure you have disabled or uninstalled any survival mods which could kill your hero over time (hunger, thirst etc.) 11. Let your hero stay and do nothing (Yes, just leave him/her be standing still) - you should probably turn off your monitor and go on with your everyday activity It is also a good idea to release your followers and remove all equipment from Dovakhiin's body. It is also up to you how many mods you wish to uninstall prior the entire process. The point is to feed the game with as few data as possible. How to check it works? Just make another save after few (or several) minutes (REMEMBER TO SAVE ONLY VIA CONSOLE COMMAND). Exit the game also via console command (qqq). Compare the size of older and newer save.ess file - the newer one should be a little smaller. Run the game again (ALWAYS VIA SKSE) loading last save (just hit "continue") and make new save (VIA CONSOLE) after... let's say an hour of automatic floating of a camera around our poor bored hero. REMEMBER: do not move away with some menu opened! It only works during an "action" - in this case patient and humble standing still and letting the camera float around. Quit the game again (console "qqq") and compare: the newest save.ess file should be after an hour significantly smaller. And continue with larger intervals: the good solution would be leaving the game opened before you go to bed (just turn off your monitor and... sweet dreams). Check it up next day and continue procedures depending on your available home time until new save.ess cease to be smaller. Remember also TO NOT OVERWRITE THE SAME SAVE. Just make always a new one. I have managed to drop my save file size from 88Mb to about 6Mb! Yes, this is not some dumb advertising of loosing weight or such. The process is slow and gentle, yet consistent and effective. It took me approximately 20 hours of "live action" total. The final result? I can play the game normally and experience no freezing. And yes, it did not cleanse my dirt 100% I must admit. My papyrus script logs still contain some dramatical information, however of incomparable size. Previously I got log files of up to 15Mb each. Now they vary usually around of 100Kb. I suffered CTD few times, however it seems it happens after to often use of a quicksave function. And the great thing is, that this simple line in SKSE.ini file is constantly and subtly active somewhere in the background, like an invisible and patient guardian constantly watching the remaining dirt and not allowing it to overgrow. It also seems to not slow down the game performance. I'd like to thank wholeheartedly to the SKSE creators (did I say Talos bless you?) for this simple and light solution. I also thank you, Flexcreator, despite I did not use your method. Regardless your idea is safe or not, you faced bravely the problem and also initiated a creative discussion, which eventually can lead this serious game issue to be solved. Please, pick the divinity you wish to be blessed by and I'll look for a proper shrine to kneel before. Greetings

Edited by Rotaur, 01 April 2013 - 04:25 PM.


#526
Tarquine

Tarquine

    Newbie

  • Members
  • Pip
  • 14 posts
Dear Flexcreator,

You saved my skyrim life! After playing Skyrin for over a year now and with a large number of coming and going mods, the game had simply become practically unplayable. The saves were around 80 Mb in size and the papyrus logs would reach 10 Gb (yes, gigabytes!) after just 20 mins of playing.

As I had lost all hope and I was getting ready to sacrifice myself to Alduin, I used your tools and followed your procedure and, behold, life returned to normal in my Tamriel! The saves are now back to 10 Mb, the papyrus logs down to just a few Kb and the game runs as smoothly as ever! In fact, I haven't even experienced any of the issues in your warning (like spouse forgetting my house or display cases glitches). Everything seems to be working perfectly.

My most thankful appreciation for your work! You should be the new 9th Divine :-)

Best

Tar

#527
flexcreator

flexcreator

    Resident poster

  • Premium Member
  • 3,139 posts
In response to post #7706071. #7706405, #7707030, #7707706, #7711943, #7714172, #7714812 are all replies on the same post.

Well, maybe you have already noticed, but... please, note that the same scripts has different IDs in different saves. However, you can use two "unknown" DWORD's in the ScriptInstance as a Handle when you compare two scripts from different ESS (they are unique and it looks that they represent the object to which scripts are attached, multiple scripts can be attached to the same object, so better to check the name too)

Not sure about ArrayID

#528
Tossapon

Tossapon

    Newbie

  • Members
  • Pip
  • 18 posts
In response to post #7706071. #7706405, #7707030, #7707706, #7711943, #7714172, #7714812, #7725197 are all replies on the same post.

There was no problem with restore reference when it is still existing within the new save. But I'm currently unable to insert missing references into new save without corrupting the save.

Also when I attempt to restore string array, my MCM menu got broken. Maybe it's using strings as main state variable along with normal variable. No problem was found with normal string variables though.

#529
Skrimdroid

Skrimdroid

    Newbie

  • Members
  • Pip
  • 13 posts
In response to post #7718227.

Thank you for the description!

#530
Rotaur

Rotaur

    Newbie

  • Members
  • Pip
  • 11 posts
In response to post #7718227. #7748993 is also a reply to the same post.

You're welcome. Hope it helps.




Page loaded in: 0.943 seconds