top of page

Tools: Unity Auto Saver

jwkheirjobs

Introduction

Short & sweet post coming in hot off the press. I haven't done much in the way of tools in Unity in a while as it has mainly been in Unreal. So, I saw an opportunity (well it was kind of needed urgently) and I took it!




Problem

Whilst working in Unity 2021 LTS I had a scene open working away on UI and other things when BAM the scene I was in and the scene I duplicated this from both got corrupted. Even now after lots of investigating I can't see why that happened.


Luckily we were able to revert it back to a previous commit and with some git magic cherry pick certain files and apply those. But it still meant we lost a fair bit of work.


Note: Before I continue I feel it wise to give my two cents on something I didn't think would be the case. So, whilst investigating the issue, I also looked in to an issue I was having with the editor in unity being very laggy. I profiled the editor and found some interesting results and out of curiosity I installed a alternate versions of Unity but this time 2019 LTS & 2022 Non LTS and to my surprise both had no lag or editor issues. When I say lag amongst other things I mean after every scene change and every code change it would take a good few minutes before I could touch the editor again not to mention the amount of time it took to play.




A sign of a good tool is a tool that you yourself (the creator) would use.

Solution

The AutoSaver 3000 (minus the 3000). I know there are a few solutions out there but they all seem a little outdated and each lack certain functionality, UX and other things that I want in an auto saver. That isn't to say they aren't good or even maybe better but more likely just different.


Features


I must admit I went a little overboard with the features but I just kept seeing opportunities for more efficient and productive workflows.


A tools' UX & UI is just as important as its functionality and features.

Here are some of the features it includes:

  • Current User config (json or enum)

  • Extensive Debug & Information boxes that can be enabled or disabled

  • Save Assets that can be enabled or disabled

  • Clear debug logs linked to the autosaver

  • Save untitled scenes

    • This will disable the editor with a prompt and a save button

  • AutoSave

    • Enable or disable countdown progress bar

    • Save every set amount of minutes

    • Save backups as well as traditional save

      • Specify a backup path (if none will default to the path of the active scene)

        • Overwrite saves

      • Limit the number of backups made

      • Limit the number of file versions made

        • Functionality will be disabled until the limit is increased or the files are deleted

    • Reset the auto save timer

    • Stop the auto save timer

    • Auto save paused upon playing the scene

    • Input notes to attach to the scene in the history

  • Traditional/Normal save

    • Save backup

      • Specify a backup path (if none will default to the path of the active scene)

        • Overwrite saves

        • Limit the number of backups made

        • Limit the number of file versions made

          • Functionality will be disabled until the limit is increased or the files are deleted

    • Save on play

      • Editor disables any features when in this mode

    • Input notes to attach to the scene in the history

  • Save history

    • Enable save history

      • If enabled every save either auto or traditional will be logged/saved

    • Dedicated Save History Window

      • Loads from local json

      • Auto updates upon save

      • Shows

        • Save type (auto, manual)

        • Timestamp

        • Scene name

        • Scene path

        • User

        • Notes

        • Open scene

        • Save over scene (must be enabled)

      • Ability to search by

        • Scene type

        • Scene Name

        • Timestamp

        • Scene Path

        • User

        • Notes

        • amongst other types such as fuzzy search etc

    • Match User saves

      • Ctrl + S or File -> Save


Next Steps


With everything there is always room for improvement and if you've read any of my previous posts you know I try and always end them with a 'Next Steps' section.


I would like to add the ability to make a save upon when a set number (by the user) of changes in the scene have been made. Which, wouldn't be too hard. Lastly, it may be nice to have a save feature on exiting play mode that saves the changed components as well maybe?






54 views0 comments

Recent Posts

See All

Comments


bottom of page