[Utility] SavedVariables Manager - ESOUI
Thread Tools Display Modes
08/11/20, 01:04 AM   #1
Join Date: Jun 2019
Posts: 17
[Utility] SavedVariables Manager

Hi All,

This may or may not be a good idea, so I wanted to present it and see.

In my limited experience, cleaning up SavedVariables can make all the difference in game performance, addon issues/bugs, etc...

Stating the obvious here but Addons use SavedVariables in at least two major ways:
1) To store its configuration/settings.
2) To store collected data like items in your inventory/bank, price data, logs, character data, sales, node locations, etc...

I assume that the collected data is what most often overwhelms the game (if it gets to be too much) and/or gets corrupted. The addon configuration/settings most likely stays static. I will make the assumption that it is beyond most users to know which SavedVariables to keep or delete, and in a lot of cases deleting them requires you to reconfigure that particular addon's settings.

Knowing the above I present the following questions:

A) Is it possible and reasonable for addon authors to split their addon's SavedVariables files into Configuration/Settings.lua and CollectedData.lua?
B) Regardless of the answer above, would it be beneficial to have a utility that regularly manages/cleans/purges saved variables?
- Purges some SavedVariables that get to big and/or too old per the user's specifications.
- Only deletes the so-called CollectedData.lua files and not the so-called Configuration/Settings.lua.
- Purges SavedVariables of addons that are no longer installed.
- [Advanced scope] keeps the so-called CollectedData.lua files of known addons but selectively purges older data within per the user's specifications.
C) Minion already does this, but the utility could also make backups of SavedVariables.

There are some addons where the user generally would not want to delete their addon’s Configuration/Settings. AlphaGear 2 for example.

  Reply With Quote
08/11/20, 04:04 AM   #2
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,438
A) AddOns with huge amounts of data already do that. HarvestMap, Master Merchant, Arkadius Trade Tools. They all use more than one file to separate config from data and also offer ways to purge that data. For most other addons it just doesn't make sense as it is complicated to set up for no gain.
B) Purging data is not something that you can do from the outside without messing up the addon, or making it useless. As such I cannot recommend it. Even if you did make some tool that knows each addon well enough to delete parts of its data, it will most likely lead to issues in the future whenever the author decides to change the data format, so again not something that can be recommended.
Saved Variables of addons which are no longer installed don't have any effect on game performance. They are simply ignored as if they didn't exist.
C) That's the minimum functionality I'd expect of a tool that deletes data it doesn't own.

Overall I don't think it makes much sense, since the data is very addon specific. You cannot make any decisions about what to delete and what to keep from the outside.
https://www.imperialtradingcompany.eu/ - My Addons - The Vault (Early updates and experimental projects) - My patreon - My blog
>siri.exe MyAddon
Does your addon work? [y/n] n
There is a typo in there.

Last edited by sirinsidiator : 08/11/20 at 04:06 AM.
  Reply With Quote
08/11/20, 05:32 AM   #3
Baertram's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 3,101
Originally Posted by sirinsidiator View Post

Overall I don't think it makes much sense, since the data is very addon specific. You cannot make any decisions about what to delete and what to keep from the outside.
I agree here, the effort to keep this working would be too high, without a real gain.

Your best approach would be the manual way:
Always logout before changing SavedVariables.
Copy the folder "SaedVariables" for a backup.
Manipluate the \live\SavedVariables\<addonname>.lua file manually where needed, but you need to understand the lua table structues in it before.
Each { opens a table and got a relating }.
Due to several ways of addons storing the data in there it can be 1 table, or several in the same file. And either stored per @AccountName or for a specific character ["1234567890123456"].
Or even for all accounts the same ["AllAccounts"] (where this string "AllAccounts" could be any other string chosen by the addon dev for his/her/* addon.)
In addition the data can be saved for all servers the same, or there might be something like ["EU Megaserver"] or ["NA Megaserver"] and ["PTS"] to define which server the data was saved for. Again this could be chosen differentlky like just 1 2 3 or EU, NA PTS. It's the addon dev's decision how to create the file contents, maybe differently for each addon.

You see: Like sirinsidiator told you the effort to support them ALL, or also only a few, would be way to high and would need to checked and change each time any addon updates.

And corrupted files will only happen if maybe the client crashes (in most cases the files were not touched then and stay save, only if the crash happens during logout in the moment the files are written, it would happen).
Or if they grew too large which must be handled by the addons themselves, or by the user manually (in your example case with ESO Profiler).
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » [Utility] SavedVariables Manager

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off