Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Had a monster coding weekend to finish my game ... and then lost it all this morning.

Discussion in 'General Discussion' started by Rajmahal, Jul 27, 2015.

  1. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    http://forum.unity3d.com/posts/2229614/

    Not quite a blog post, but reasonably straight forward instructions to set things up. I'll consider doing a video on it's well if there is interest.
     
    frosted likes this.
  2. Tanel

    Tanel

    Joined:
    Aug 31, 2011
    Posts:
    508
  3. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    Why would you want to remove csproj, sln and unityproj files from source control?

    Personally, I would also want my project specific user settings from resharper and visual studio saved in source control. But that's because I'm the only developer. It's annoying having to reset your naming conventions, suggestion and formatting.
     
    Dustin-Horne likes this.
  4. Tanel

    Tanel

    Joined:
    Aug 31, 2011
    Posts:
    508
    I wouldn't want them to clutter up my repo. I remember Unity regenerating and doing other weird stuff with those files, so it gets messy.
     
  5. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    I'm not sure on Resharper, but for Visual Studio if you log in and connect it with your Live account and it will sync your environment settings. It's in the upper right hand corner of the IDE.
     
  6. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    It may regenerate the csproj files but as far as source control is concerned it's just a modification, no reason to not source control them as only the diffs are stored.
     
    frosted likes this.
  7. Tanel

    Tanel

    Joined:
    Aug 31, 2011
    Posts:
    508
    Unity generates those files when they're not there anyway, so I don't really see a reason to include them.
     
  8. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,985
    There is no such thing as a "good quality 1TB drive" that is magically perfectly reliable. Every drive eventually fails. That is why it is critical to keep backups on multiple devices instead of having a single drive that can fail. If that external drive holds the only copy of your data, then you will eventually lose your data. It is unfortunately that simple.

    What you need to do is store multiple copies of your data. If you trust external drives more than internal drives, then back up your data to another external drive.

    But keep in mind those external drives are just cheap internal drives (usually laptop drives) in an enclosure with a USB, firewire, or eSATA connector board built into the enclosure. There is nothing inherently better (or even as good) about an external drive.
     
  9. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Unless you're strictly a coder. I spend a lot of time just opening the solution in visual studio, writing code, and never even opening the Unity editor.
     
  10. Tanel

    Tanel

    Joined:
    Aug 31, 2011
    Posts:
    508
    Okay, I get that but still I wouldn't want them in my repo. Open Unity once, let them be generated and you'll only need to do that again if you clone somewhere else.

    I'd probably feel differently if it wasn't a Unity project and the solution actually was the project and not being something that's auto-generated when missing.
     
    tiggus likes this.
  11. Deleted User

    Deleted User

    Guest

    How do you back up your project using VS Online? I just made an account and it seems awesome but not sure how to back up my project with it.
     
  12. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Create a team project and use source control explorer in visual studio
     
  13. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    Some people can be a little silly about autogenerated files and "i don't want them in my repo!" but here's the deal...In the average unity project there will be thousands of auto generated files you do include in your source control. To make a big deal over a few small text files, when your project might be storing tens of thousands of generated files (which aren't ignored in that gitignore) really kind of misses the point.

    The real reason not to include these kinds of files in something like source control isn't "if it's autogenerated it should never be in the repo of perfection!" - the real reason is if you have multiple developers who have legitimate reason to have differing copies of the same file, which can at times cause problems with merges and stuff, not just that something is auto generated.

    Honestly, git is a beast. My project has over 45,000 files in it and git just chugs through. Git isn't gonna choke on a 100 lines of csproj xml. Git doesnt afraid of anything!
     
  14. Tanel

    Tanel

    Joined:
    Aug 31, 2011
    Posts:
    508
    Well yes, I pretty much agree with this. The difference between for example auto generated .meta files and those solution files is, they're pretty much useless to the project. Nothing breaks when they're not there, so why have them in? If you have a legitimate reason TO include them, sure do that.

    That gitignore wasn't an example of how you absolutely must do it though, just a starting point. Anyone can make their own modifications based on needs.
     
  15. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    Nothing breaks when meta files aren't there either - unity just generates new ones out.

    A lot of this stuff really just comes down to personal preference. I find it handy to be able to diff csproj files against older revisions, you may not find value there. That's cool.
     
    Dustin-Horne and Tanel like this.
  16. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    +10. Sometime your project breaks and you ask yourself what changed. Source control -> view history -> compare. You can very quickly see what files where added of removed.
     
  17. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    Was wondering if anyone ever runs analytics on source control and stumbled across this.

    https://code.google.com/p/gource/

    Might be the single best reason to use source control ever.
     
  18. Deleted User

    Deleted User

    Guest

    That's it? It never even uploaded anything. How can I tell it backed up properly? I can't find any tutorials on backing up using VS online.
     
  19. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Vsonline is for source control, not backups. You'll need to setup your initial team project, map your workspace using source control explorer in visual studio and check in your files to push them to vs online. There are tons of tutorials out there for using it, just not specifically with unity.

    Also just as an fyi, you can also use vsonline as a git repository, so you're not limited to tfs functionality.
     
  20. kanga

    kanga

    Joined:
    Mar 22, 2010
    Posts:
    225
    Would it have helped the op?
    What was the point of the first post?
     
  21. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,516
    Data being on an external HDD would have helped the OP in this specific case, but that doesn't make it solid general advice. The (main) flaw is the part where you're advocating using an external instead of the internal drives, as opposed to using one in addition to the internal drives.
     
    Ryiah, Dustin-Horne and Kiwasi like this.
  22. kanga

    kanga

    Joined:
    Mar 22, 2010
    Posts:
    225
    @angrypenguin
    I wont explain again, but I must say I find your remarks insulting
     
  23. 3agle

    3agle

    Joined:
    Jul 9, 2012
    Posts:
    508
    Nothing he has said has been insulting, he merely disagrees with you.
     
    angrypenguin likes this.
  24. minionnz

    minionnz

    Joined:
    Jan 29, 2013
    Posts:
    391
    Version control isn't the only solution but it definitely makes life a lot easier. The versioning aspect has saved me more times than I can count.

    I also store all of my work on a single external network attached drive and it feels a lot safer than storing it on the same drive as my OS.

    And I backup everything (including OS) to a USB drive regularly. No matter how prepared I think I am, there's always that one file I forget about until after I've formatted.

    Oh also, I bought an SSD drive a few years ago thinking it might be more reliable. The problem was it died after around 18 months and it died without warning - working perfectly fine one minute, completely dead the next. At least with a mechanical drive, you can hear the warning sounds.
    I don't think that 1-2 years is the typical lifespan of a SSD drive - and I'm definitely planning to buy another one again - but if you buy a SSD, don't make the mistake of assuming it's any safer than a mechanical drive.
     
  25. kanga

    kanga

    Joined:
    Mar 22, 2010
    Posts:
    225
    Calling my advice irrational is trying to cast aspersions on my intelligence. I find that method of discussion offensive and unnecessary.
     
  26. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,141
    Your statements read as though you're suggesting that switching from an internal drive to an external drive somehow eliminates the potential for drive failure. Further you're suggesting it as a complete replacement rather than using it alongside internal storage.

    If this is how you intended them to read, then you're basically advocating a single point of failure. How is that not irrational?
     
    angrypenguin and zombiegorilla like this.
  27. kanga

    kanga

    Joined:
    Mar 22, 2010
    Posts:
    225
    Oh I never suggested anyone place all their files in one place. Read the above passage and putting a backkup in a safe is not the external drive you use while you work, its an extra drive. I assumed you guys would understand that. So you have 2 drives, so you have 10 drives, so you have an automated system that backs all drives up daily, whatever floats your boat, whatever fits the size of the investment. But using an external drive would have saved our op, like it saved me about 2 or 3 times. My experience is that internal drives have to work harder, they are vunerable to corruption through software conflicts and normal use. I suppose if you are a coder all you need is notepad++ and an engine you wouldnt notice the advantage of extra headroom (apart from natural safe partitioning). But when you make animations with uncompressed HD tiff frames (in the thousands) it can add up, 30 seconds of avi is already a gig, these are just some of the things that can take a toll on your disk, add that with zbrush caches and AE temp files, and well you can guess the rest. My method has worked for me very well and I will continue to use it.

    So it is not irrational, I havent been lucky and I dont appreciate being talked down to by someone who wants to push something I never wrote, as bad advice. Also writing 'How would that have helped at all?' after my initial suggestion was perhaps the most ill informed line I have ever read because it would have solved the situation as a matter of routine.

    I have done all I can, there are others to help, games and good discussions to be made.
    Sheesh
     
  28. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,141
    I have a strong dislike of assumptions and try to avoid making them as much as possible.

    Anecdotal evidence works both ways. I have had losses from using external media. Most of the time these were not critical as I learned quickly to keep multiple backups and often it's a result of the enclosure failing rather than the drive itself.

    My internal drives are kept in a cool environment (a fan blowing over them), have a very stable power source with good feedback protection, and if they are non-primaries then Windows will keep them offline when they are not in use.
     
    Last edited: Aug 4, 2015
    angrypenguin likes this.