Skip to content

[REQUEST] Add prefix for persistant data to improve sorting in savegame folder #511

Description

@Darxo

Is your feature request related to a problem? Please describe.

Persistant Data is saved by serializing it into .sav files, which land in the Battle BRothers/savegames folder next to actual savegames.

As more mods use this feature, the savegames folder will become very cluttered.
This will increasingly confuse regular users, who wants to backup their saves, or are asked to provide one of their savegames.

Describe the solution you'd like

Add an additional consistent prefix in front of every persistant .sav file, which causes them to always be sorted to the end, when viewing the folder in alphabetical order.

A simple examples would be zz_

function __getFilenamePrefix()
{
	local sortingPrefix = "zz_";
	return format("%s%s%s#", sortingPrefix, ::MSU.System.PersistentData.FilePrefix, this.Mod.getID());
}

When sorting alphabetically, savegames are now separated cleanly from persistant data.
A user that is tasked to delete all persistant data, to debug some problem, can now do that much easier.

Problems with this solution

If a user sorts their folder in any other way, then this change will have no effect. For example sorting by date (which is useful to get the newest savegame to the top

This change by itself will be a breaking change. It invalidates past persistant data, as those would not be identified correctly.
This can be fixed by implementing a compatibility layer, where during startup any detected persistant data in the old format is converted to the new one

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestA feature requested by the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions