Jump to content

CreateFullActorCopy bloating savegames


grmblf

Recommended Posts

I'm pretty confused with this. The wiki states this function creates a copy of a reference and makes a new base object, and that deleteFullActorCopy deletes both the base object and that reference, so in theory if used carefuly this function should be safe to use, right? But something is bloating my savegames and I fear it's this. I tell you what I'm doing and if someone could lend a hand or give a clue on what's wrong with this process then please tell me, it'd be much appreciated!

 

Currently, scriptA:

- createFullActorCopy on a permanent reference

- waits a frame

- places it in position

- setScript scriptB to the copied actor

- addItem to the actor, wich makes scriptB runs

 

ScriptB (attached to the actor) is where I deleteFullActorCopy, and it seems it does so (the actor disappears, and no disable function has been used) but I don't know if the base object persists or maybe it's the item I add to them, ?? Any clue ??

 

:thanks: !

Link to comment
Share on other sites

The problem is likely due to adding a script to the actor in that manner. Scripted objects and scripts which become isolated from their references can create bloating.

 

If the actor you are making must be scripted, it will probably work best to use either a scripted token which is moved to/from a container (as opposed to being created/removed), or a scripted ability which is removed from the copy before being removed.

 

But really, createfullactorcopy can be a source of many complications and shouldn't be used to excess.

 

As for bloating, simply by having the game run, or loading a new area your save file size can increase. Having a longer cell reset time, or a low timescale can make this normal increase much worse since cells aren't being cleared as often (play time).

Link to comment
Share on other sites

Scripted objects and scripts which become isolated from their references can create bloating.

Ah thanks I didn't know it. So you mean that maybe the object script that runs on the copied actor is somehow "stored" even if the actor and it's base object have been deleted?

 

I tried before with a token script, but I can't DeleteFullActorCopy the creature while the token is in it's inventory. I guess I have to make them drop the item and then dfac'em. Is it removeMe to delete the object once outside any inventory? I'll give it a try.

 

I really need it to be safe, I want to make a multi-summoning system that can deal with an unknown number of simultaneous summons. It's all working pretty well, creatures behave correctly, they last what they have to last, but they're leaving a trace somewhere in my savegames... :(

Link to comment
Share on other sites

I really need it to be safe, I want to make a multi-summoning system that can deal with an unknown number of simultaneous summons. It's all working pretty well, creatures behave correctly, they last what they have to last, but they're leaving a trace somewhere in my savegames... :(

If you're working with creatures which can be edited directly, why are you using createfullactor copy or fooling around with token scripts? Createfullactorcopy is really only a good idea in the case of NPCs, like the player, who have specific facial or race traits that you want to duplicate. For any multi-use script, it's really just a bad choice.

 

Instead, you might just want to script the creatures directly to remove themselves after a certain duration, and use placeatme. As long as the creatures don't have any scripted items, there shouldn't be any bloating. My halloween mod makes use of such a system, except in a limited and controlled way. One script to create the spawn, and a script on the spawned thing to remove itself upon death, some trigger, or after a certain period of time. My shephards ring mod had a similar system too, but still had a few issues here and there if you happened to move through a load door while wearing the ring (summons would get stuck on other side and remain there until that cell was reset (making summons have more than 30 int would solve this though)).

Link to comment
Share on other sites

This stuff starts to drive me crazy... How can I make sure my mod doesn't bloat save games?

 

I've tried with placeAtMe and then removeMe from the script attached to each actor, but it seems that my savegame increase it's size. I've noticed that after saving, loading a different cell reduces again the size of the file (I assume they are stored while in the same cell they were created) but it never reaches it's previous size, it always stays a bit greater. But, how can I know if this increase is due to my mod? Is there any way I can open the .ess and check the entries or something similar?

Link to comment
Share on other sites

This stuff starts to drive me crazy... How can I make sure my mod doesn't bloat save games?

 

I've tried with placeAtMe and then removeMe from the script attached to each actor, but it seems that my savegame increase it's size. I've noticed that after saving, loading a different cell reduces again the size of the file (I assume they are stored while in the same cell they were created) but it never reaches it's previous size, it always stays a bit greater. But, how can I know if this increase is due to my mod? Is there any way I can open the .ess and check the entries or something similar?

Well, how large of a size change are we talking? How long after testing did you wait before saving?

 

Have you tried comparing the length and filesize against one of similar length without the mod active?

 

Easiest way to do this would be to load up the game with your mod active, use the spell or whatever 20-30 times (keep track of how long you do this for), fast travel to a different town, go to mages guild, fighters guild, blacksmith, then inn without leaving the town worldspace. Inside the inn, rent a room, and sleep for as many days as your idaystoreset is. Then save the game. Then reload from the same save that you loaded from before, except without the mod active. Cast another spell (non-summoning) or whatever for roughly the same amount of time, fast travel to the same town worldspace, visit the cells in the same order, enter the inn, sleep for the same amount of days, and save in a different slot. Post the two file sizes here, along with the size of your mod and number of persistent NPCs in your mod.

 

Save file sizes tend to fluctuate quite a bit when you look at the small picture, what is important is the long-term effect. A save size can increase by 20-30kb just because a mod has been turned on, and can decrease by 20-30kb just because you've moved from one cell into another. It's quite normal to have saves as high as 3-4mb just from having played the game for 40 hours and completing many quests, with or without mods present. Getting too sensitive of it can just make you go crazy... which is why much of the discussion about placeatme with actors and inventory objects and createfullactorcopy tends to take a rather extreme or conflicted view. Most people really just don't know what bloat looks like compared to the normal size changes that come from playing.

Link to comment
Share on other sites

Hey, thanks for your advices, I won't let it drives me crazy. As you've said, there's a lot of people, like me, that doesn't know how much bloating is produced by normal actions like loading a new cell, sleeping, loading a mod, etc, neither how much bloating could produce 100 'placed at me' actors, so I really have no reference to actually test my mod, that's why I was asking some assertive way to check it, like reading the savegame or so, but if that's not possible then I'll perform that long-term testing you say.

 

By now it doesn't seem to produce bloating but I've got some CTD I didn't had with fullActorCopy, I think it's the moment they die, maybe when objects are removed or the actor erased. Btw, there are two things I'm unsure about, regarding objects in their inventory and that may affect both bloating and crashes. I use a removeAllitems two frames before removeMe the actor, is it enought to "clear":

- token scripted items added by other mods and checked as unplayable? The wiki says those "unplayable" items aren't removed, so what happens then to the items? Is removeItem safe in those cases?

- items from leveled lists that are present in the base object?

 

I'll keep trying...

Link to comment
Share on other sites

- token scripted items added by other mods and checked as unplayable? The wiki says those "unplayable" items aren't removed, so what happens then to the items? Is removeItem safe in those cases?

- items from leveled lists that are present in the base object?

Token items can't be completely removed, even with removeitem once their scripts have been started. It's one of those main drawbacks of using tokens that most don't realize. But, the severity of this drawback depends on the size of the script and how often it needs to be done. This can be alleviated to some extent by moving used tokens to a container that resets and disables their actions, and then only using the tokens in that container for actors (essentially limiting the number of tokens which exist).

 

Items from leveled lists are safe to use without having to remove them as long as the item itself isn't scripted. Leveled list items only create issues in those cases where an actor or inventory containing them has been duplicated, and even then they can be cleared out.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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