Auto-save in Unity? About time...
HTML-код
- Опубликовано: 28 сен 2024
- How is auto save in unity not a thing?
Prevent hours of lost work with auto save. I built this after losing 2 hours of level design work and so far it's been wonderful... So I thought I'd share it with the world. Hope it can help you too!
Source: github.com/Mat...
❤️ Become a Tarobro on Patreon: / tarodev
=========
🔔 SUBSCRIBE: bit.ly/3eqG1Z6
🗨️ DISCORD: / discord
✅ MORE TUTORIALS: / tarodev
Amazing! New challenge: a checkbox on components to save all the changes during play mode (yes I know you can copy and paste as values, but that only works for one!)
Good idea
Actually this can be done with a scriptable object. There are some easy to follow tutorials on it. Add a scriptable object and you can save changes during runtime.
Love your videos Mark :). I'm rooting for you in the Unity awards.
@@ghostderazgriz this is a very bad advice imo. scriptable ocjetcs are not meant to be used as replacement for gameobjects. Scriptable objets cannot contain references to scene or execute unity loop methods like awake or update.
I'm quite sure it would require a lot of work with custom editor scripts. You have some implementations on the unity asset store but none of them are free.
Btw I love your content, keep up the good work Mark !
@@fredg697 This is true, but scriptable objects need only serve as an intermediary. Not to replace monobehavior. Flexible data can be stored in the SO while fixed or runtime updated data stays in the game object.
Never knew Unity didn't have this feature. I've been lucky enough to not lose hours of work
"more exciting" was good, no need to apologise.
I've never had an issue about losing scene progress, but I've scratched my head a lot about how to save assets and trying to figure out what the hell is a dirty asset. I'd love to see you tackle the asset thingies.
Also, loved the editing.
I was about to table this until I "needed it", but then you gave that damn warning at the end. Installing now...
haha.. that auto save anticipation cut is awesome
Not easy making an astrix disappearing interesting 😜
Hi, I set this up, but I don't hear the dramatic build up or dance music in my editor. I also don't see the screen shake on save. Please add these in the next version. /s
Haha 😂
I have the tic of keep pressing Ctrl + S but this is very useful indeed!
I lost 3 hours of work now, because the unity crashed on instal of Text TMP.
Thanks for this, it's currently working for me.
Love your work!
I did notice in your 'SaveInterval' task you have the following:
await Task.Delay( *_config* .Frequency * 1000 * 60, token);
if ( *_config* == null) FetchConfig();
So you're accessing '_config' before checking for null.
Oh shoot, let me swap those. Code review FTW
Awesome, I will definitely use it :). Great idea!
Bahahaha ok this post is pure gold!!!!! Tarodev you are a legend!
Oh you sweet, sweet man. I thank you so sincerely for this.
Another awesome video from you. Keep up the good work!
hey Tarodev love your work man btw i got inspired and switched my channel from a gaming channel to a game dev channel thanks
I watched your videos. Keep it up!
@@Tarodev thank you so much i will never forget this
@@Tarodev and please sub too thank you
Lol! I've never laughed so hard at an asterisk disappearing 😂
Mission accomplished
Bro That Song Kinda Hits Differnt At 1:33
Its one of the best things i've seen for unity
That's just great! Thank you so much!
So cool! Thanks for making this and sharing it with us all for free. Works great and will undoubtedly save me a load of time and energy. Looking forward to watching more of your videos.
Does it also save the project? I've lost work on s critical moment because I've edited an asset (I think a ScriptableObject) and didn't save the project.
The facial expression at "I can't believe i'm about to show you how Auto-Save works" - like you really hated life for a second 😂 - PMSL! - Amazing tool thanks for this!
iam a fan of your videos your videos helped me alot in many ways .just one request can you make one video on how to create 2d water and how to swim in it
God bless you, bro
Worst is when unity crash and even if you save scene, project before crash after load it's like nothing was saved except SO(?)
Can we change default hierarchy elements? For example I want specific prefab when creating a new slider. Possible?
Love it
Thank you so much!
Cool! I just made a simple script that saves the opened scene on Play
really useful, thanks!
After losing hours of my own work, I have a compulsive habit to hit Ctrl-S every time I change something. Auto-save is much better :)
Editing video in Sony Vegas is a great way to train up your CTRL+S game. That fucking program crashes all the bloody time.
Oh dude, premiere too. It actually crashes my entire pc. I get trigger finger in premiere
Thanks for this, really useful!
Sometimes i just try things without saving so i can revert back if i don't like the changes i made. (I can use git i know but im talking about small ui changes without ctrl+z)
Maybe a boolean for "enable " can be added to config.
Edit 0: (But then you can forget to "enable" auto saving after you disable it, that would be funny)
Edit 1: (Maybe you can then write a script that auto enables the auto saver after some time? (paradox?))
This sounds more like, you problem
This is getting deep
@@zbyszekkiebasa906 hahah
stonks!
I'm not able to look at the code in depth right now, but I'm curious how it handled having multiple scenes open? Does it only save the top-level scene?
EDIT: there it is: "SaveOpenScenes" - cool!
This is both a boon and a curse. I'm just imagining a multi scene workflow with 15 scenes...
I CTRL+S even when I write emails. Literally doing it everywhere xD even after I finish watching a movie
So I think I'm good for now :)
I need to up my game
😂😂😂😂
Thanks Man!
Why did you change it so that it auto-saves a new back up scene to a new folder in the scenes folder instead of saving what ever scene you are in?
@@andrewpullins8817 it now works similar to how auto save works in editing software. It creates a snapshot history of whatever scene you have open
I haven't seen it mentioned that unity saves the scene every run to /Temp/something/0.backup or something like that, you can rename the scene to a .unity file and load it up. As long as you remember to manually do it before it overwrites it
Very useful!
When you restart the project the scripatable object can not find the associated script.
Also when trying to find the config after resatrting your project i get>
NullReferenceException: Object reference not set to an instance of an object
Tarodev.TarodevAutoSave.ShowConfig () (at Assets/Editor/AutoSave.cs:92)
Interesting... Let me investigate. Thanks for bringing this to my attention
I've fixed this issue, thanks for bringing it to my attention mate 🙏
what file do i download
maybe they don't implement it by default is cause for me atleast everytime I hit ctrl s it just takes like 20 seconds to application.reload or similar messages
Oh god, yes that would be horrendous.
Wait, do you mean you do not do a Ctrl + S every 2 seconds ?
Not in the editor apparently 😭
Sacred knowledge is usually occulted. Not by intention, but because the masses prefer mainstream and popular, over informative and proper.
Oh, yes, Color Pickers are evil. As are, from personal experience, events. At least, that's when Unity loves to crash my project 😒 Thank you so much for this video and tool!
Unity 2021.3.9f1 not working on mac m1 24... Anyway, thank you
I'd had this tool not working. Then I tried reimporting the scripts. It worked!
You need to import both cs files at the same time: AutoSaveConfig and TarodevAutoSave
Pfft, the obvious solution to bad ctrl+s skills is to rebind every single key on your keyboard to a macro: "[key], ctrl+s"
You'll never miss a save again
You'll also have a hard time typing on the internet
Haha. Nice...
🤣🤣 the sound effects
me the one of two girls feeling recognized and validated
Wow, doing unity's job for them. Can you make a script to be able to keep changes in play mode? Hahaha!
nice
Of course, for those that want this feature, awesome. But personally, an autosave feature wouldn't be desirable. As you mentioned, diligence with your ctrl+s, seems like the best way to control the state of your project to me.
But Unity never crashes... said no one ever.
that edit makes me fall in love with you and i guess that's gay thing and i love it.
Strong effect :)
Noice
You're handsome!!!! THANKS!!!
I love you
Bro Unity pisses me off so much for this shit, billion dollar company cant add 5 lines of code to save thousands of hours of hard work
That edit 😍
It would've been better if it auto save a new scene as a backup and not overwrite the current one
because sometime you could mess things up and you wont want your scene to be overwritten by your current mistakes
That sounds like it would be inefficient. My best advice is to upload build versions before making critical changes. No program can really make that decision easy because only you know when a critical change is going to occur.
@@ghostderazgriz that's how a lot of auto saves work though. They just save a backup copy with a different name. If your program crashes and you didn't save, you go open one of those backup copies. If it doesn't crash, you just save whenever you want as normal and there's no risk of it auto saving your main file when you didn't want it to. There's nothing inefficient about that.
@@r6scrubs126 In a normal program you'd be right, but when you're making a game or anything with massive amounts of data, you want to compress that data into version files, like how the package manager first installs a package and the package unpacks all the components you want.
Otherwise you're saving entire duplicates of data, not all of which is necessary for the game to be saved, and that takes up a lot of space.
The most efficient method is to export packages (found under the Assets tab). I don't know if exporting can be automated but I do know that there maybe objects you don't want exported with each version, or experimental features you want exported in separate packages.
In those cases an auto-package program could hurt your version control and mess up your file organization. I think it's better that you decide for yourself what to back up and what not to, but I could be wrong.
Just keep a repo for version control. Additionally with apps like Github-Desktop you can easily revert any saves you dont like locally.
How are you not the top Unity Game Developer on RUclips? Your videos are top tier. Quick, detailed, and exciting. Thank you for the amazing tool!
Thanks Owen 🙏
You may have experienced a bug in the previous build where the config SO would be unlinked after an editor restart. This is now fixed
Hey tarodev. I cant believe you still use consolas in 2022. Cascadia code is the new standard. It has ligatures and everything.
@@RealisiticEdgeMod I've never used ligatures. You obviously reccomend?
@@Tarodev Can recommend. I think cascadia code semibold would be more readable on your videos.
@@RealisiticEdgeMod Such an interesting way to approach someone: "I cant believe you still use ... in 2022." There's a reason you can pick from multiple fonts in the editor, each to their own.
Good to inform people, just not a fan of the execution.
@@secretservicebob3288 Its not just one of the fonts you can choose from. Its a newer superior font that has superseded consolas.
You are a lifesaver and that 1 minute was the most exciting thing of all time.
Mission accomplished 😎
I think it should be saving to somewhere else. If unity crash than you can get the recent file. Just like how it works on office programs. Otherwise it can save a state that i dont want.
I was thinking this... I originally set out to make a separate save history users can revert to... The user could set how many temp saves there are before overwriting.
I'll look into it to see how much work there is and maybe offer an alternative version.
Good suggestion!
@@Tarodev Honestly if it were me (which I'm still notice so keep that in mind), I'd just allow for an alternative backup location in the settings, then simply use new location if it's a valid path, warn if it's invalid, and revert back to the current behavior if left empty.
If you wanted to go the extra mile in my shoes, I'd probably do that... then realize it's probably a good idea to have a checkbox "Overwrite existing scene" that would give you the option to select a path. That way there's explicit and clearly labeled step you'd know you were taking when choosing your preferred behavior.
@@Tarodev did you ever get round to looking into this? But otherwise this is already very nice to have just in case
One time I was fixing a bug with animations while setting up the animator for an enemy, Unity jest froze and I lost a hour of work.
I got just the tool for you ;)
I wasted all of my life savings on pasta...
It was worth every Penne.
im way better than this i press ctrl + s every second and every dam line of code 👌😎
Unity needed this, taro provided! As always
tysm i just lost 5 hours building a map and its gone, fml 😮💨😭
this is awesome !!!
thanks !!!!
My Hero~~~~
Very recently, windows rebooted during the night (without asking me, obv). Of course I didn't save before going to bed.
Always a pleasure.
Well this is the perfect solution 👌
What is it about colour pickers? They crash blender the most for me too! No one talks about it tho. But it's the colour pickers that house the true evil .
How strange...
Good my ctrl+s game is quite good
After many years of working in Android development were there's no need to manually save anything, getting back into Unity was kinda hard, and I lost work right away. I forgot how easy it is to crash this IDE. Thanks for the greeting btw, girl here.
I don't believe you
EDIT: My wife just told me my above reply was rude. So sorry about that :D Thanks for watching Nucifera!
0_0 sus
"girl here"
Sounds like something a boy would say!
And I should know, I'm dating a boy, and he says that all the time.
I keep telling him, to stop like "Please, honey, this is a funeral" but he just can't help it.
That's a real scenario I didn't make up cus I'm an authentic human female person with boobs and stuff.
(Certified by the Board Of Typical Sapiens [B.O.T.S])
@@ghostderazgriz this is legit
@@ghostderazgriz funny, I totally wasn't aware because I'm not a native speaker. How can I make it sound more believable in your opinion?
I don't know why but Unity crashing when you were using a color picker cracked me up😂
It didn't crack me up at the time
UUU aaaa good one.
Imagine chuckling at a video about auto-save. Great one bro!
Thanks buddy :)
@@Tarodev Why you keep replying to my comments, huh? You like me or something?
I suppose there's always been some kind of chemistry between our people: those with beards and those that have been trying to grow one for like 10 years but just end up getting laughed at by everyone and resort to just subscribing to those that have what we may never possess... It's probably that.
@@CheeseChuckie I'll send you some of mine in the mail and you can use adhesive
10/10 edits
Thanks!
Meanwhile I still have memories of windows 98 (95?) freezing during an auto save and corrupting my file.... so instead of just losing the changes that didn’t save I lost everything.
Hah... golly
The color picker crash has been happening to me a lot lately too.
First time experiencing it. I wonder what causes it
Could you just simulate "CTRL" and "S" being pressed every interval?
You could with a tool such as auto hot key, but I could see that causing problems
Maybe by using keyboard events: docs.unity3d.com/Manual/UIE-Keyboard-Events.html. Doing this would preserve any checks that Unity does without having to know them
The project I'm working with at the moment takes several seconds to save the scene (not my project, I just started working with the team), at which time the entire editor becomes unresponsive. Unfortunately a periodic autosave is not a viable solution for me. I even had to turn off Unity's built-in autosave on the prefabs because it took so long to write the prefab to file after each edit.
Oh man! AAA?
The thing that kills me the most is when Unity decides to crash shortly after saving a script in Visual Studio. I've literally had to go in and just straight up turn off the asynchronous complication under the Unity plugin in Visual Studio because it's like a child when leave it alone too long. >:[
Thank you for doing the work for Unity. The gatekeeping dogma of "get good, save often", doesn't take into account those with ADHD who have a hard time remembering things when they're focused on something.
CTRL + S is hard coded in my mind
Wait… You can save your project? I always just make the whole game in one sitting haha
Hah! Teach me master
@@Tarodev I have honestly developed a habit of pressing control-s so frequently that I haven't lost anything over the past years. I could see myself installing this and still mashing control-s lol
I died when it dropped. You're a wizard.
Best !
that was insanely epic
funny how i lost 2 hours of worth of work. Does Unity Crash every 2 Hours now???????????
Auto-save is a feature I always turn off.
My computer has crashed many times and unity always saves for some reason
Nice, but will it pop up the "Can't save while playing" message every minute that I'm playing the game?
BRO WHAT TEH FUCK YOUR FILE CAUSED UNITY TO CRASH
Thanks Matthew - first job in the morning will be to set this up 😎
I’m working now on unity for 3 hours and unity decide to crash every thing is gone and need to do it again It’s really sad that you trying your best to make something and in 3 seconds every thing burn , sometimes you need tow fingers to save your life . What i’m doing , just thank you, that will help me alot ❤
Awesome thanks Taro Dev
Billy my boy, you're welcome