Jump to content

[LE] Question about stringcount/baking into save


Recommended Posts

Hi people,

i have a quick question about scripts in regard to the string count in the save game.

 

Now as far as i know functions and properties (apart form AutoReadOnly) will bake into the savegame and increase the stringcount.

What about the scripts themselves?

If i say add an empty dummy script to an object will that bake and increase the count?

 

Link to comment
Share on other sites

For Skyrim (32-bit) exists a tool called "TESVESSE.exe" TESV Savegame Editor made by fubrus. https://www.nexusmods.com/skyrim/mods/27119/
You are able to open a savegame ".ess file" and look what is happen inside.

Under Global data table 3
> 2 Papyrus
> Strings (string count)
you'll see what kind of strings are stored in the savegame.

Every loaded script name, as well as properties and variables inside, is baken. At the end of the stored strings you can find the strings of active scripts like temp0, temp1, GotoState etc.

That means: "What about the scripts themselves?"

Yes, depends on this object is loaded in Skyrim, the name of an attached script is baken to savegame.

Edited by ReDragon2013
Link to comment
Share on other sites

So i looked into it a bit and id like to conclude a little summary in the way i understand it.
--

Inside the save's papyrus sections we have to sections that are of importance:
- The saved/baked strings, called stringList from here on
- The saved/baked script instances, called instanceList from here on

For the sake of this writeup i will from here on refer to the count of stringList as stringcount and to the count of instanceList as instancecount.

We(i) already know that stringList is limitied to a reach of an uInt16 which stops at 2^16-1 meaning ~65k entries
So we could assume that instanceList is also limited to about ~65k entries.
Question: Yes/No ?
Question2: Does breaking the limit of instanceList also break saves or is this exlusive to breaking stringList's count?

Lets first examine stringList
-----------------------------
One thing i immediately noticed is that stringList does not contain any duplicates.
Meaning vars/props get stored in stringList as a per string and not per script basis.

So if 2 or more scripts contain a variable like

int iVarSomethingSomething = 1

then the name of "iVarSomethingSomething" will only be added once no matter how many scripts use the same variable name.

The same rule applies if the same script is instanced to multiple objects.
And the same rules also apply to the script names themselves.

So to answer OP's (my) initial question: when using a dummyscript like

ScriptName SomethingScript extends Form

you increase the stringcount by exactly 1. Doesn't matter where or how often it is attached or instanced.

Another important info i gathered is that literals can also bake.
In my testing i found several string literals (and even some integer literals)
A little string array init like

Pages = new string[3]
Pages[0] = "$General"
Pages[1] = "$Favorite Groups"
Pages[2] = "$Advanced"

can increase the stringcount up to 4.

The array itself uses 1 entry but initialising every entry can quickly rile up stringcount.

 

I guess this is what @ReDragon2013 refered to in an earlier post when he mentioned active scripts
Question: Is this behaviour limited only to active scripts ?
Question2: Do editor filled arrays behave the same? Time to test...later


Now lets look into instanceList
-------------------------------
As the name instanceList suggest this list stores the script instances in the save.
This goes per script
Example: If you create 2 ObjectReferences that contain the same script you will increase the instancecount by 2.
If you create 2 ObjectReferences and add 2 scripts each you increase the count by 4 etc.
Going by this extending ObjectReference and Actor (both which are Instances of base forms by design) should be used with care.

Baseforms should increase the instancecount on a per Formid/EditorId basis.
Example if you add a script that extends a baseform class you increase the count by 1 no matter how many instances of it you create.
Question: Does the same script that is attached to objs with different Formids increase count further? Time to test...later

--
The above summary just mirrors my findings from playing around with save editors a bit and may not be accurate.
If you have more in-depth info on this topic please chime in and correct me where my observations are wrong or add into it.

Edited by testiger2
Link to comment
Share on other sites

" i will from here on refer to the count of stringList as stringcount and to the count of instanceList as instancecount."
They are variables, be it whatever type ... You could bloat a save with many long strings in variables and even multi-arrays filled with very long strings.

It's like I said .. "The saves should just hold script variables and a reference to where the script is. Not the script itself."

and "I'd assume a bugged script may eat up string space as it will bloat saves." ... This isn't unique to Skyrim. It's how compliers set things up.

Actually the mod holds the "reference to where the script is" Until it is loaded in memory ... then it's reference links to that location.

 

Edit: Some of the strings saved as variables are actual script snips themselves and are used for interrupts.

Edited by NexusComa2
Link to comment
Share on other sites

Well maybe i could have worded my initial question a bit better.

Of course the savegame will not contain the actual scripts.

The question could have been better worded this way:

If you have an emtpy dummy script(meaning no vars/props whatsoever) will the script's reference still be baked into the save?

If we we assume an unbugged script.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...