What EVERY Game Dev Needs & is Required for Jobs - Source Control for game devs & Unity3D

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today we're going to talk about something extremely important that most new game developers don't even know exists or if they do they may barely understand how it works or what it is or why it's useful it's also something that really is important for intermediate or experienced game developers if you're an experienced game developer and you submit a resume without this on there well it's probably going to disqualify you right away so what is that thing and why is it so important well the thing is source control and we're going to get into why it's so important why it's avoided by new developers how you can get into it really easily what all of the different options are because now with game development there are quite a few options and the options are i'd say quite a bit different from non-game development programmers i mean if you ask any web developer what you should use they're probably going to tell you get get or get so what are the options for game development why are they different why should you maybe consider something else stick around i'll show you exactly what the best options are for unity and at the end of it i'll give you my recommendation for what i think you should use what i use personally i want to start by describing the first version of source control that you'll run into or the one that i used first and the one that you've probably used first this happens usually after you've made some big mistake you broke your project and you're trying to fix it and you go you know what next time i'm gonna copy my project so i have a backup of it and you copy it and paste it add maybe an underscore a dash back up to the end and you're safe you've now got a stored saved off version of it so you can now continue on and if you make a mistake you go back to it and every now and then you just copy that folder and paste it now this kind of works it solves some of the issues you at least have some way to go back and undo things if you're not doing at least this well then you're missing out because while this isn't a great option it's better than having no backup at all the next step though tends to come when you're working with somebody else you're going through this process the copying is okay but then you're finding that hey you know i'm also zipping up this entire folder and sending it off to somebody so i've got to like keep sharing this or sharing it around the the team at the office or wherever the place is now if you're in an office and you're doing this nowadays you've got some issues but hang around because this video is going to explain exactly how to solve those problems but let's continue through the evolution you set up a network share and everybody's dropping their folders now into there you've got a backup underscore json a backup underscore json tuesday a backup dash thursday jason a couple weeks later the system admin or whoever's running the network share starts to email you saying hey um you guys are eating up a ton of space here filling this folder up you've got this network share that's three terabytes can you clear that up and you start to get into this process of needing to now manage the shared folder so you've got to start adding some rules maybe you only have a couple days of folders and people have to manually drag things around clear them out but nobody does and it ends up being a mess where you're constantly fighting and things are getting deleted at random and it's really difficult to deal with so then maybe you move on to the next step you're like you know what this isn't good enough a file share isn't going to work we need something more advanced let's go to dropbox so you upgrade to dropbox and all of a sudden your problems are solved the storage is remote the files are kind of just getting replaced so you drop a folder up and you've got the new version of the folder there and things kind of seem like they're solved and to be fair it does help it's definitely a better option let me cut to clarify it's a better option than the past two options it's still not something that i would recommend because you are going to run into issues with this it's a little bit slow you've got to manually control the syncing or kind of manually control the syncing because it's also automatic you don't know which files have synced some files may sync while other files are not synced you can end up in a completely broken state a lot of the time especially if you're using the dropbox folder as your actual like source folder and you're linked directly up to that because as people are changing files somewhere else one source file might update and get sent over to you and then the other one isn't there yet so you still got to go through a manual process and if that other file is not there yet you're going to get compilation errors or other weird bugs if you know only half of a check-in is there now speaking of check-ins let's get to the solution and that solution is source control and you know if you're already using a source control solution before we dive into those drop a comment down below and let me know i'm curious what you're using before we go into this and if you're not using anything let me know that as well too i'm kind of curious to see how many people are not using any source control in their day-to-day life so what is source control where did it come from and how can you use it in a nutshell source control is the terminology that we use or the word that we use to describe systems or services that keep track of our different versions of code now in game development it's not just code we keep track of code art assets metadata and quite a few other things but the source control system is responsible for keeping all of those revisions keeping track of the differences between those revisions and to revert back to or pull back those changes if we make a mistake or we need to undo something or just kind of look at what we've been working on they also give us the ability to do some better distributed work unlike a file share we can work in a source control system where we work on our own and then just push up the specific things that are ready or we push up our changes as soon as they're ready with comments history and a whole bunch of other information and then other developers don't need to pull the changes down until they're ready so we don't have the issue that we run into with dropbox where something's up there and it totally breaks your code halfway through because you're linked to that folder so what are these source control systems what are your options and what should you choose as a unity developer let's start with what the options are i'd mentioned at the beginning that web developers are going to recommend git and to be honest that's probably what about 50 percent of your peers are using if they're doing source control and they're in some kind of a game development place they might very well be using git if they're outside of game development they're definitely using git if they're doing web development or something else well say definitely but 90 to 95 it's very prominent it's got a giant market hold that said for games there are some other big players out there some other options that i see used because git isn't always the best option for large art assets and really for the way that games are built in the way that the size and weight of the projects that you have git is great for code it's not so great for all of the other options so what are those other choices well one of the first ones that i used was perforce this was a big very popular system back in the day when i was at sony everybody used perforce and pretty much every game company used perforce that i knew of there were a couples that used some of the competitors that we'll talk about but most of the time we used perforce either the red version or the yellow version and people kind of loved and hated it programmers generally kind of liked it because it locked files made it easy to prevent merge conflicts which means that if two people are working on code at the same time imagine me and another jason are both working on the same method of code in the same file on our own computers totally remotely we both make different changes and we both try to commit those that is a merge or a merged conflict and we have to figure out how to resolve that with perforce what it does is when you want to edit a file you actually have to check it out and you would lock the file so that nobody else could edit the file it'd be like saying hey i'm working on this file don't make changes to it right now it's mine nobody else can change it i need it because we're going to have a merge conflict otherwise now you can get around that that's an optional thing in per force i believe now but it used to be just kind of the workflow and it probably still is the workflow for a lot of developers personally i don't really like that workflow though i don't like having to check things out and i prefer being able to just work on things alongside other people that and when i looked at perforce for personal use there were some licensing issues once i got past five users started to get pricey to share projects and things so i've kind of stopped using it although i still think it's a useful tool and it's something that's useful to understand and know about especially if you want to get into the game development industry there are a lot of companies that use it and if you understand how to use perforce it definitely doesn't hurt it can only help in fact it's something that i would say is good to have on your resume having perforce and just any source control on there not just good to have it's extremely important to have on your resume now let's take a look at another source control system that i used to use but not so much for game development and that's sbn you'll see svn used with tortoise sbn and it's pretty easy to use it has a nice right-click context menu to allow you to check in files or to check in an entire folder or check out a folder the wording here is a little bit different you check things out you're pulling them down and you check them and you're committing them and you'll see how strange that is as we get through the i guess whole process of source control and talk more about it but checking in checking out they'll mean different things in these different source control systems something kind of important to note really what's important to understand though is what it means in the source control system that you're using and i wouldn't recommend that you go with svn for your game development it's not a bad option it works okay but it's just not the option that i would go with personally those are two that i don't use now let's talk about one that i do use or at least that i'm using right now and that's unity's collaborate system unity collaborate was built into the unity engine a while ago and it's been kind of a godsend ever since it's extremely easy to use and really handy i think it's the best way to get started with source control and it's really the first thing that i teach in all of my game development courses because i think it's so important that game developers just get into the habit of committing regularly and speaking of my game development courses i've actually got some really exciting news with black friday coming up i've decided to have a do a huge sale with black friday coming up i've decided to do a huge sale on all of my courses starting on monday it'll be the biggest sale i've ever done and all my courses will be 50 off with a special black friday bonus and some really cool new things you've never seen before with the bundle you'll get all of my courses including the game programmer course that'll teach you the fundamentals of game development in unity and the game architecture course where we go into the advanced topics that you really need to build out big full-scale games like the rpg that we're building live the discount and bundle are only available for a limited amount of time so if you're interested in game development and want to take your skills to the next level i definitely recommend you check it out by clicking the link in the description go sign up for the notification to see what kind of cool things are in the bundle and get notified when it comes out now i mentioned that collaborate isn't something i'm going to be using long term and i want to explain why that is they're actually replacing it collaborate is a really cool system but it had some downfalls or some weaknesses it doesn't support some of the more advanced features that a lot of people using source control really want like branching which is i think probably the biggest one branching and partial commits probably two of the largest but branching is by far the biggest and most most concerning one for most people so what is the new option what are they doing why are they deleting it and replacing it i think initially they were probably going to keep working on it and building it up but eventually unity acquired the company that made plastic scm and plastic's been around for i think around 15 years or so it's a little bit older than i thought but i first heard about it about seven or eight years ago working on pantheon actually i think it might have been even before that that i tried it out the first time and it was sold as a new source control system meant for game developers or at least the advertising i was seeing was all around meaning it or building it for game developers it was meant to handle art assets and make that a little bit easier because if you work with artists you know that they usually have a really hard time with source control and it was meant to make it so that game development and source control just kind of worked together now when i tried it out before it wasn't bad it didn't have too many issues but at the time i was also getting really heavy in to get so i was kind of being pulled back and forth between plastic and git and get one out because everybody i knew was using git and it just kind of seemed like that was the way to go that was the the flow of everybody else there's no reason to fight against it but now with unity buying plastic or in and then now integrating it directly into the engine i've decided it's time to start reevaluating that and i've been actually looking at plastic quite a bit and it seems to me that it's going to be possibly the new standard for unity game development at least whether or not it takes over for other game development who knows i mean source control systems change compete there are a lot of different issues there a lot of different things that they compete on things like pricing speed performance reliability and then features i don't know if plastic has every feature that every source control system has or that everybody needs may not we'll see as as time goes by i guess but this is the one that they've now switched in and you'll see here that it's actually integrated directly into unity you no longer need to go download or build anything you just set it up takes about a minute to create the account in fact i think it was a little bit quicker than creating an account and setting it up for unity's collaborate which is kind of crazy i thought it was going to take a while but it was extremely easy the first time i set it up the source control system seems to just work easily select the files i want to commit check them in give them a nice message and then everybody can see the history and then pull down the changes as they want just like with collaborate but a slightly bigger ui and a little bit more going on there plus we've got the ability to now branch which i think is probably the biggest part that's going to kind of push this over the edge anybody who was kind of up in the air not sure which one to use the ability to add branching once you get past the first maybe six months of using source control is amazing the first couple months of using source control branching is not that exciting branching is essentially taking your project and then making a copy of it it's a lot like making those folder copies that we talked about earlier except here you're making it in a system that's kind of tracking that saying hey make a copy label this copy my jason's making a new feature branch and it makes that copy and it only copies and changes the things that it actually needs to other than that it'll what it'll do essentially is reference back to the original files and in the copy it'll only have the changes and then essentially links back to the original files or the non-changed ones so it's a much tighter version that doesn't waste a bunch of space but it also allows me to switch back and forth between those two really easily and then merge the changes back in from the branch into our main branch you can have multiple branches start branching out a ton and merge back in or you could just use branches sparingly when you need them depends on your use and how your studio runs or how you like to do it yourself personally i don't branch too much on my own but every now and then i'll make a little feature branch when i need to go test something out unless i'm working with other developers then i will pretty much always make a big feature branch work on my feature get it ready get it fully figured out make sure that it works do the merge so that i know that it works with everybody else's latest changes and then commit it so that it's nice and easy to keep it separated and if i need to go back and change something else in the main branch maybe i've got an emergency bug fix or something else i can do that just by switching branches and this is something that actually comes up a lot when you get into actual like professional aaa development especially if you're on a game that's got a live team something where you've got live servers that are running you have to maintain and manage done a lot of this with mmos you are going to need to go back to that main branch and randomly fix bugs when something pops up that's causing all of your players to disconnect or crash or somebody's found some weird new exploit that you've got to fix you don't want to have to undo and copy your entire folder you don't want to have to grab another computer or something to to do the changes you want to be able to just switch branches go make the change fix it and then go back to your existing working stuff that you've been doing for the last week or two this new feature stuff that you've been doing but what about git i mentioned at the beginning that git is one of the most popular options in fact i think it is still the most popular option i still think that it's a pretty viable choice if you want to be a game developer using git you certainly can there are however some things that you need to pay attention to and note first is that art assets are going to get big and bloated if you don't set up get lfs and get lfs is something that you're going to need to just look into once you get familiar with git and you start to get comfortable with it and you start to run into the issue of every time we check in an art file we have an exact complete copy of it then look at get lfs you're going to need to do that i wouldn't start with it though if you're just beginning with git just start with git and kind of get familiar with it git has some really cool features and some really nice things to it one of my favorite things is that you can just commit locally and then push up your changes later that's what's part of the distributed version control system and it's just the way that git works it's a really great way to work it's a nice workflow because you can just commit things constantly locally without having to worry about whether or not they break something for somebody else and without being in a branch it's almost like when you're working locally you're always in a branch until you hit the push button to push your changes up now when you do your pushes and get you actually do your merging so with perforce or other systems you do your merging when you pull so you pull down the latest changes and you have to merge them in with git you have to merge them when you push your changes up now that might not sound like a big deal but when you're working with a big team and you get really tired of having to constantly fix merge conflicts every time something somebody else checks something in you start to see the value of it and see why it's such a cool feature and a really nice workflow you don't have to worry about other people interrupting your workflow and if you go in and make big breaking changes you're the one responsible for kind of fixing those it really does help and there are some other really cool features in get that said it's a little bit complex it's definitely not where i would recommend people start if they've never used any source control gets an easy way to completely break your project accidentally delete things when you go in trying to mess with the advanced features and fix things it's easy to just mess it all up so on your first get project one thing i would recommend which as bad as this might sound is that while you're working and getting getting kind of familiar with it if it's an actual real project you care about also do a little bit of that copying and pasting of your folder just keep a version around before you make any big git commands or you try hitting something like a rebase or some other thing that you're not quite sure what it means or how it's working but you think it's going to fix the problem get yourself a backup because i've known way too many developers who've lost a ton to get and it's always in those first stages they're first kind of figuring out the workflow and accidentally hitting the wrong buttons or doing the wrong thing speaking of the wrong buttons with git you have a couple options there's a command line interface that's somewhat popular you'll see a lot of people talk about it i think a lot more people talk about it than actually use it when you go into an actual environment of developers you'll see that maybe like 1 out of 10 or 1 out of 20 people are using the command line most people use one of the tools that are available like source trees tool or get kraken or get tower there are a bunch of different options out there from free options to paid options that all act a little bit different and i don't have any real opinion on which one's great if anybody does have an opinion on which one is the best get option now by the way drop that down below i'm kind of curious now that i've gone over the options that are available or at least most of the options if you've got another option that you really like drop that down below too i'm kind of curious see if there's something else out there that i'm missing that's really popular i think that i've kind of hit the top ones though but now that i've done that i want to talk really quickly about just habits when it comes to source control because it's easy when you get into source control systems to just make a first commit and then kind of forget about it and then not commit again until like a day later and then two days later you do some other commit and then you're committing like a thousand files at once and i would just like to contend that i don't think you should be doing that especially if you're starting off with source control systems and you're working on a solo project you should be committing almost all the time maybe hourly maybe at least every two to three hours you should be committing whenever you make a change that's a significant change where it's actually a functional change and it works then that's when i would commit if i've added a new system to my game some new thing maybe i've added a new um item type that i can pick up a new set of those things then i'll make a commit if i've added just some new content i pull in some art assets i will make a commit if i pull in an art package i'll make a commit if i make a change to a scene go realign a scene go rearrange things place things in the scene i'll make a commit every single time i want to commit these changes and the reason for that is really simple source control gives me nice long undo history it gives me a history of every single commit and if i break those commits down into the actual bite size chunks that they are i have a lot better control over what i'm viewing so i can see the differences there what i go back to and what i change and i can tell what's actually happened there it's a whole lot easier to read a bunch of little commit messages that are a single thing with 5 or 10 or 20 files in them than it is to read one that's got like a giant list of stuff in there that half the things we forgot because there are so many files and so many things changed in there and we just really won't understand what's going on with our changes it makes it a lot harder to go back and undo things it also makes it so that we don't have our undo points if we're committing every time we add something new if we change our mind we go hey you know what this item change or this inventory change this isn't actually going to work as i get a little bit further i can go back and undo to the point right before that and not have to worry about oh did i undo 10 other changes because they were all part of these other commits and with the right source control systems i can even cherry pick out and remove a single commit or undo parts of a commit without having to undo all of the rest of the history so get used to source control start to master it and trust me it will really make life easy for you it'll help a lot and when it comes to interviews if you understand source control and you can help them with source control oh wow that'll really push you over the edge if you don't understand source control at all and they ask you hey what source control systems have you used and you say i don't know what that is it might be a disqualifier so i would watch out make sure that you get comfortable with it get familiar with source control and again if you're interested in learning source control from me check out the black friday sale it's only available for a limited time and we use source control in every single one of my courses you'll learn that in a whole lot more alright thanks again for watching and see you soon oh don't forget to hit the like button
Info
Channel: Jason Weimann
Views: 8,531
Rating: undefined out of 5
Keywords: game development, game dev, unity3d, unreal engine, perforce, collaborate, plastic scm, plastic scm unity, git, git unity, sourcetree, tower git, tower, brackeys, dani, jason weimann, unity, learning game development, game dev jobs, unity 3d, unity3d college, game design, source control, distributed source control, git lfs, game source control, unity source control, unreal source control
Id: ZM31kw8ttVw
Channel Id: undefined
Length: 24min 28sec (1468 seconds)
Published: Fri Nov 12 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.