[GameDev Stream] Sharing My Project Setup in Unity (5/31/2020)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone welcome to another game dev livestream I'm your host I guess Charles and thought I'm with infallible code and today I've got Jason story with me once again we streamed about a week ago and we looked at some projects us looked at some of our old code our own code and so today I think we're gonna take that a step further and I kind of wanted to go over how it is that I you know set up how it is we set up our projects generally speaking so you know if you've been following the channel you have seen videos kind of surrounding this topic we've got a video on assemblies that we did a video on namespaces and I've got a whole bunch of like unit testing videos and kind of wanted to bring all that together and just talk about the things that we do to just sort of set a nice foundation for the project with our you know file structure again setting up assemblies and namespaces and then just talk to those things how it helps a project scale how it helps drive how a project grows as far as structure and then things like system boundaries and those those details that are look super important um related to these topics so and then Jason was just sharing with me that there's some things that he's been using doing with his workflow like tags and stuff that I'm not really familiar with it so it should be interesting to take a look at so yeah we look like we've got some people in the chat here if you have any questions during the stream always as always feel free to to drop those in the chat I see a lot of familiar faces here thank you all for coming through Jason your new look look is it's great people say they like your haircut yeah I've got the the quarantine haircut makes life a lot easier I actually risked it a couple weeks ago and went to a barber and got a haircut everyone was wearing masks we're all separated worth it yeah exactly so it was a comment about that I vote that had yeah someone says he almost smiled so cool and this is great look at that see Luis here Luis Torres what's going on a lot of other names hi from India hey Vivek appreciate you joining in again any questions related to gamedev unity you know all that please please feel free to shoot Amara way next week we got a video coming out on how to set up a project for unit test but we're gonna we're gonna cover some of that today so you're gonna could get to see sort of like a sneak peek on that that should be pretty cool wow that's so funny if you look in the stream our mics are actually yeah come here that's hilarious [Laughter] super Z's asks how was the vacation thank you man I think he thank you for asking it was great my wife and I we went up to the mountains in Asheville it's South Carolina or I want to say it's now I'm blanking I think it's North Carolina Asheville we stayed on a sheep farm this is pretty crazy which is funny because I was I've been working on this sheep game which is also a game that I've been promising to make for my wife for like years to were dating and then we stayed on this sheep farm I wonder if I could pull up the video and show it's really funny there was a hundred and twenty sheep and we stayed in like a little cottage and at one point the Shepherds brought us out here's a video I'm gonna put up and see if it's uh you can even see this on the whole it's probably gonna blur out maybe Vonda scored so anyway there's like a whole bunch of sheep running or running towards the camera and maybe you can see yeah you could probably see it look at that so it was pretty funny and so when we were on the farm my wife and I were talking about the Sheep game and we learned that the Sheep get moved from paddock to paddock every eight days they have like these sections of the farm I was like I'd be kind of an interesting game mechanic to wear like you know just you get the Sheep into one paddock you know maybe there's a shepherd there that's like you talk to them and it's like okay now we got to move into the next one and then you know I'm sure there's all sorts of game mechanics and challenges as you you heard the Sheep to another paddock so it's pretty funny but yeah thanks for asking about that appreciated it was much much needed R&R okay oh no avoid appreciate that has just got into bed but I can't can't sleep knowing that I'd be missing a Falvo code content oh that's really sweet appreciate that we're gonna we're gonna stream for about an hour and a half today so you know if you can just hang on for another hour and a half then you can go to sleep cool Microsoft like number of lines per class hmm well if it is lines then there's not really a hard and fast number the general rule is you want to be able to see what a class is doing basically in a full-sized monitor there used to be a that used to be rules that were guided around how many lines you could fit on a terminal so that's what that's what the the old saying was you want you want one screen size worth but that means a lot less these days when you've got 4k monitors but you can display hundreds so pragmatically speaking I usually try to aim for not having more than one scroll bar like a little little area as for actual numbers I probably cap out somewhere in 300 lines be absolutely maxed I would have per class it's kind of arbitrary though there's not really a set rule realistically you'll find very few mechanics will be more than that if you're actively making it separate in terms of what you're features are any class that's more than 300 it's probably doing more than one thing yeah and it's one of those things to where you shouldn't as you as you're you know coding and writing classes you shouldn't be looking at the line number concerned about how many lines are there you should be focusing on the structure of the code and has separating you know responsibilities and from that sit sit symptomatically you're gonna get smaller files what's that there's like a concept after I was someone brought it up in a stream a couple of weeks ago where you have too many classes like too many tiny classes forgot what the term they use for that was a class explosion was it yeah yeah I mean that gets the the the other side of the flip side of the coin is sometimes you can get a little too granular and you can have these classes that are just so dialed into one specific responsibility that you just end up having hundreds and hundreds of classes that all do one little thing and you know obviously that can all that's the other side work and get out of hand there - I will say though there's a common misconception people have where they associate number of classes which the kind of complexity of a project so just because something has a lot of files doesn't mean that's a bad thing right literally a big project will have lots of files so it's not really it's an odd thing to judge a project by the number of files you've moved it into this conceptually as far as the compiler concerned it's one giant file no matter how many times you split it up it's going to be red and processed as a collection of instructions in linear order at some point it'll be interpreted into intermediate language and that's going to be a literal linear pile of steps so keep in mind the point of splitting up the files is for your organization it's supposed to make your life easier and it's it's again it's so weird to judge the worth of a project based on that the idea is simply if if it's hard to read it split it up into more files if it makes it easier to work with but it open to more files if you've got too many files or it's not easy to work with maybe don't split up into some class of files right like it's not it's not something that should ever really be considered as much of an important spectrometric fur coat yeah someone asked can you write a game using functional programming sure there are yes there are games that they're functional programming I wish I could have some examples on hand but I don't but trust me there are people are doing it you'll be able to find some examples if you search yeah yeah I don't have much experience with functional programming personally I it's interesting how that topic I've found on the Internet can be polarizing yeah it's it's too contentious to be a topic I ever really like to get into because so strangely just like it yeah it's like it's cool but it's again it's a tool it's a tool your tool belt there's there's no reason to treat it like it's some sort of replacement for object-oriented code and there's also no reason to consider it as so a newfangled crazy thing it's just another way to write code it's it's really really good for writing the kinds of code where you really try to make sure there's no side effects so if you're doing stuff that's running in treta environments it's really nice to have code that's atomic and doesn't have that sort of weird state stuff that can happen and if you're writing code that is very algorithmic so if you're writing stuff that's like processing things through a series of steps it's really really good you're doing there's so many cases where it's really valuable it's harder to use in situations where it's very state heavy that's something you can't you can actually do an awful lot with functional programming and you can sort of simulate state with the whole structure of how works and but the problem is you end up having lot more boundary lines and application sort of end points hmm so what I mean by that is if you're copying lists around and moving them you you have to clone lists and time you use them now there's a lot of really clever stuff in functional languages specifically which can optimize for that but still if you look into performance in video games you really want to avoid doing things like coughing list contents that's just you don't need to so it's not really ideal from a memory management perspective for games but as a I guess academic exercise it's pretty good and you can still make games in it just you're just not really going to see very tightly memory managed games done with functional programming at least I don't think so but it's not something I know wet enough to be an authority on the topic just I just know enough to do a little bit of it I guess yeah it's interesting this the spectrum you know of opinion on on that when it comes to developing games you have the no code camp who you know just doesn't want to have anything to do with code gimme game maker or let's do visual scripting and then you know on the other end of the spectrum you have some people with the opinion that oh yeah we you know functional programming versus object-oriented programming and you know there's just so many disparage and like paths that you could take and I think really I guess the older I get the more I just realize like there is no right answer I mean the right answer is what's right for you and your project and that's well not always hard to hear that is one of those things that I think you learn a lot as you start to become a developer for enterprise type stuff right you're making a game you're working traditionally in one environment in one platform in one engine if you do work where you've worked on some web projects and some API projects and some desktop projects and some Android projects and after a while you start to realize that a lot of the stuff that you take as sacred it's sort of language specific stuff that doesn't really matter yeah realistically for people who know one language you'd be surprised how easy it is to learn another and I've said this before but you have one language it might take you six months maybe a year like worst case scenario to learn a second language your third language to take a couple months at best your fourth language to maybe take a month and then after that you're looking at a month ish maybe two three weeks depending on the language and so once you've realized that you realize it's more about pick the tool for the job right yeah yeah like you can build websites using everything from Java and.net but realistically you probably want to pick something that's you know more like a mean stack or a JavaScript approach because that's what most resources will get me for you know yeah likewise your desktop stuff you probably want to be working with the dead dotnet stack and be using dotnet core or something but so it doesn't matter specifically what languages or what tools or like I don't understand a lot of this evangelism or around certain stuff I mean I love you sure but like that's because I like the syntax I know it very well but I was pleasuring something in JavaScript it's like you know it to bring it to some sort of other example maybe parallels to like hey I like writing poetry I like writing fiction I like writing nonfiction at the end of the day you have people have ideas and people are creative and want to create things and how you know how you do that just depends on you and your and what you're trying to get out of it and I think you know bringing it back to like programming and especially the business world a lot of the driving factor is typically money in fact right now my day job we're in a crossroads where we are we have an application that's written on a very dated technology stack and so we are struggling with should we try to upgrade this technology stack to the most recent level its angularjs or should we just rewrite the application using another technology stack that everyone on the team is familiar with so it's like the width the weighing is it's really not about the technology stacks no one cares about angularjs versus Grails which are the two frameworks where we're in between it's more of like what's gonna be most cost-effective what's gonna be faster we need to sell this thing we need to get it out it needs to be secure and so that's that's what's driving the process there is no sort of like I'm gonna die on the on the hill of angularjs because I love JavaScript and it's like an upcoming language no it's like we got to get this thing out the door and it's got to be maintainable so I think the same applies to game dev and I know a lot of people you know use things like game makers and maybe there are some purist programmers who are like scoff at that but you have someone like Thomas brush who's a great artist and if he will if he were to try to learn programming and and do all that and and really dedicate the time to that he probably wouldn't be able to put out games the games that he has so I'm thankful that you know there are those tools that he can use and now he can lean on other developers you know potentially and and this goes for other you know game creators too I'm glad that there's those tools that maybe I would never use but it enables them to create games so yeah it just depends yeah and also it's one of those things that there's a bit of a stigma around visual editors and it's kind of funny because there's a lot of games that you don't realize that are made with visual editors one that one came up very recently for me is I just wish listed a game it's here somewhere [Music] I never know how to navigate my own steam profile yeah I don't mean either I don't use it enough I'm mature enough Jason's Mike I heard actually Jason he turn your mic up a little bit I met max unfortunately yeah okay I'll try to give you some gain on my side I have a gain filter for you this happened last time but let me know if that feels a little too low I'll try to speak up as well I do tend to speak relatively low I'm trying to stay slightly further away from the mic anyway because the kinds of mic that myself and Charles has has a tendency to get ready boo me up close and my room isn't very well treated no I've noticed they can get a bit muffled if I'm too close to the microphone see question here how'd you both come through once before how did you both get into the unity I got a to unity just as sort of a fun I work right now in that business in enterprise world so I program really boring compliance security applications and one day a co-worker and myself were like hey you know well I'd be really cool if we could like write like a chat a little chat app so we can chat to each other because we were really interested in networking so we we wrote that and it was console based and I was like I'd love to like give it a UI you know so we can actually see and like you know get more sophisticated so we literally just googled different you know front end I guess frameworks or whatever and like I came across community and I was like I let's just use unity I didn't even get it for games I got it for that little chat chat app and we put something together and I was like that's really cool so then I started using it more and more and at that time it was never like I never thought I'd make games like that wasn't even on my radar in fact I think at that time I was a little um holier than that when I came to that thinking anyone who would say oh I want to make a game developer I would just be like you know what that's so unrealistic you're never gonna be able to do that and so but lo and behold I got into it and I started making little prototypes and then that led to an opportunity to work with a subsidiary of Disney doesn't the annual pass so I did some contractor work for them created a little game and from there I just have been doing contracting jobs never really got into a studio but as you all know it led to me making infallible code so that's kind of that's kind of my journey and Here I am today about you Jason um well for me it was actually the oculus rift mostly um so I was working an enterprise and hadn't been to for a while I've done the rounds between making Android applications Windows 8 applications I did some JavaScript back-end stuff I did some sequel database stuff for there's a whole concept called business process management and it's basically internal software solutions so I did a bit of work on that but it's all pretty dry right like it's not particularly fun stuff to do and so I kickstart back the oculus rift that was pretty cool idea after a while that arrived and I started playing around with making my own stuff with it and it was really really simple the early days getting PR to work in unity was as simple as a simple library that you just drop in and it works because it would just track to the camera it was just a glorified camera controller there was obviously I that's making it sound simpler than it is there is a lot of you know shader stuff that goes into it actually rendered two cameras and to do a whole lot of weird stuff but I guess my point is as someone who was new to both game development and the yar development and even just unity in general I was amazed at how easy it was for me to open a project dragged in a few things press play and I have a virtual environment with 3d space I could play with so I started messing around and at the time there's a really big maker community of just people doing silly stuff so in this was back when the oculus of red it had like less than a thousand people and people would post their experiments in unity so every week they'd be two or three random like dodgy zip files of revision see from projects people have been playing with to try out different things and what would work and what wouldn't it was pretty exciting time and so I started doing the same thing as everybody else in started making them test projects and I used that as a chance to learn and while I was working on it I noticed a couple of more skilled artists than myself would produce stuff so there was one guy Nick bidam and he made if anyone's ever tried the the VR Ghibli demos he's the one who made those so they're they're effectively the Studio Ghibli environments he the places was spirited away and from Howl's Moving Castle he made like really cool 3d environments in PR you could explore and I thought this is really cool I was like wow this is you know a movie I like I get to stand in for the artists is very impressive but his code sucked really really bad and I don't I don't mean like an academic sort of oh you're code not as pretty as it should be kind of stuff that sometimes we fall into yeah I mean I just mean literally mechanically speaking as a game it wasn't very easy to work with a good example of this is he's using ray cast for selection which means you had an invisible pinpoint sticking off your nose that's meant to select what you look at and it was extremely difficult to select things and I was like look let me help like I can I can do this kind of stuff and I can help you out with it so I said I'll do it for free I just like your projects I want to make them more user-friendly so he said yes I worked at them for a little bit and then he ended up having a game jam the the oculus gear VR Jam and he wanted to enter that and he had a team of people and they needed a programmer they can have any and I was like okay I'll do that and so long story short worked on a few things in VR and then if getting contracted because he hit a bit of kind of cachet to his name so he would get offers produced off and he doesn't he didn't code so effectively I was being dragged along for the ride and then after a while it started to become a thing to me just work together and now I also got a bit of a name for myself doing that too and then lo and behold I'm getting contract offers to do various VR and unity stuff and then I blink and I've been a unity dad for five years that's cool I feel like that's that is a common story common thread like you know you kind of dabble you talked to some people you get hooked up in the right community you work together and then next thing you know it's you know word-of-mouth is super powerful especially and I think you know our niche is pretty small relatively speaking yeah so it's a lot of people ask kind of to go on a tangent a lot of people ask well how do I get a job as a game dev you know what little I saw a good question here I wanted to answer from from my new about you know what's the best way to show your projects on a portfolio and yeah I mean or I think really word-of-mouth so powerful being being involved in a community and you know not as a lurker but as someone who contributes and and then works with that community I think word of mouth you know it's gonna lead you inevitably to finding a paid position whether it be contract work or maybe full-time job or you know and to answer that question by the way I think um you know there's obviously a lot of answers to that how do you should have what's the best way to show all your work to position your portfolio for potential employers and partners I think I really gotta say I like I like github and I like how I think if you you know work on your github account treat it like this is my opinion treat it like your LinkedIn I don't know if any on LinkedIn you should definitely if you're looking to get a job probably should be on that and make sure that that's all you know your summary your experience all that's fleshed out with all the keywords you know all the things you got to do pretend you're a youtuber and you have to make everything sort of click Beatty I think if you treat your github profile in the same way you put your you star your projects that you want to be seen and you work on those readme files include images and gifts of your game and an explanation of what it is or your prototypes I think that's super powerful and I think it is yeah I know go ahead ok so yeah and on that notes like a I'm people asking okay I get it I should share the stuff I work on but what do I work on what do i do what do I share and tell the truth it doesn't really matter because from my experience the way it works is somebody will eventually need something and you can you can even spot this yourself as a Content consumer if I you probably found trousers channel you probably had I want to do X I want to shoot a gun or how do I do physics or a box Collider or whatever silly thing that you were working on you would google it and you find content of someone doing it and this isn't just true for sort of small snippets of mechanics this is how people tend to connect in general which is somebody and this is like of the projects I worked on come from somebody who saw work that Nick had done visually like they liked his art stuff and they wanted to hire him because the no he can do that kind of art style and so that's how we get a project and so if you make things and I personally would say I recommend doing stuff visually if you can because quite frankly games the visual medium yeah our programmer learn how to do things like render lines or learn how to do stuff like just basic shader stuff so that you can take your cool code ideas and have some visualizer for it so and actually just to prove the point I will link this to you trails you can it's the my mechanic is a thing I was working on um but yeah my point is that it doesn't matter what you make but just make it make it visual and put it somewhere and if you put it up somewhere people will see it it'll give them ideas and they will work on it and they will they'll kind of go well I want more stuff like that can you help me with this thing and that's how you connect so it doesn't matter just pick a thing you like do you like AI do you like colors and a silly sounds imagine doing a color library that does like cool effects that can transition sky boxes or that has like interpolate between different it doesn't matter like thing you like make stuff for it and just make a lot of visual content and you'll you'll find you'll connect to people by doing that yeah yeah it's very much an organic process or it can be it can be organic so cool all right so I see I see a question that's a great segue into the topic of the video of the stream today which we're going to take a look at project structure and some things like that but before I dive into that just wanted to friendly remind you to invoke that like button really it really really helps if you if you're enjoying the content there are two there's two ways that you can really help support and that is in a like button and also leaving a comment that is you know and I don't you know i'm not saying to just drop a comment if you can't think of anything but if you have a question that didn't get answered or suggestion for something you'd like to see those those comments are great because they allow us to see what the community is interested in and and sort of tailor that to to that so we don't need to just drop a comment arbitrarily yeah as a side note on the on the questions to like I said sometimes we look back over those comments and we will use them as ideas for videos or we'll use them for kind of aggregating ideas of what people want to see so exactly it's definitely valuable like we genuinely do read through pretty much every single comment that that is yes it's just unfortunate it's not usually a lot to say on some of them because they're they're kind of commenting on specific stuff but for example like on older videos it's very hard to comment on stuff that's fundamentally changed when it's the technology behind it's change that unity changes a lot of its stuff frequent enough that sometimes it's hard to answer those questions but if you leave comments on videos we will try our best answer whatever questions you have yeah okay so down to the matter at hand Felix asked a question I saw that some unit projects have a understand project folder in the acid flurry up can you recommend it okay so that's gonna just bring us right on over to so I'm gonna share my screen now I don't recommend it yeah I wish I could make this a little bit bigger and but anyway hopefully this is easy to see if anything I can probably up the up at 200% zoom but anyway as you can see on the left hand side this is our project pane here actually no what I could do I could probably switch it to the horizontal view and maybe yeah you got that's a little bit easier to see so I'm gonna I'm gonna jack up my UI here but you can see that in our assets folder we've got this project underscore project folder what is that well well you can see we've got a couple other folders in here too like this demo giant tex mesh pro and that should give you a hint as to why we have stuffed all of our scripts scenes fonts editor animations all those other folders that you normally associate with a project the reason why you can see them in this underscore project folder is because every time you pull in an asset from the unity asset store for some reason a lot of asset creators don't follow the rule and i think it is in the documentation that whenever you upload an asset to the asset or it has to be in a plugins folder a lot of people don't follow that rule and then so what you do is you get a whole bunch of these annoying folders in your main assets folder and it can get really messy so that's why yeah in an ideal world you wouldn't do it but to be honest I find that there tends to be stuff that's project specific and stuff that's just various assets and tools and I like to draw a very clean line and say this is the stuff that is required that I have written or I have made for this project and so having that under our project is very much this is this project anything outside of this folder technically isn't this project it might be various plugins and assets and whatever but realistically the code or the models the prefabs are in the air for this project yeah now I've never run into an issue with this but one thing that I had done in the past I don't really mess around with it these days it's like I'll just create a plugins folder and then just drag those things in like drag - text Metro but then you know I've heard where it's like oh if you want to update your asset yeah I don't for that reason yeah whenever you update stuffing now to be fair a lot of this is moving into the packages folder anyway so it's making like yes you're first but um it's it's gonna be a while before I were like there's no downside for me to do that it just basically it's like all over saying is instead of using the assets directory as your route yeah use wonders for a project is your route from that point on and just pretend anything outside of that doesn't exist a good way to put it yeah that you don't use the asset as your root folder on one other note - before we go too far down this rabbit hole is really interesting I forgot to phrase that but someone really made me think about how I approached the project tab and I've really changed my mind which is someone pointed out to me once that it is not a folder view it looks like a folder view it conceptually feels like it's sort of file explorer that's not what it is it is a project view it is a view of all of the stuff in your project and what that means is if you forget about the fact that it happens to be conceptually in folders that shouldn't matter right and the point of this asset this project view is to give you access to your assets and so you should do that in the way that makes the most sense and it's easiest for you to do and a lot of people naturally organize and sort through their stuff by using the directories but they kind of forget that there is a search bar yeah I totally get into the habit of just typing you know whatever the object is like just right master seaport immediately find stuff right yeah and if you're thinking oh but now there's all this stuff and I can't really see it all of the buttons on the top right there design can be filters and various different things you can hit those pretty you're right of search that's that store here yeah you can if you want like free assets yes you just pick a pick a category like scripts you'll just find there's a million ways to use this thing that isn't specifically with it's just searching we're just using this file system and so if you keep that in mind you'll realize that this whole concept of a project view was a lot more powerful than you think it is it's just one of those things that you take for granted except it looks inherently like a oh look at that I can ya beat me to it I was gonna say the one thing you can do is you can mark stuff as favorites that you you know you're doing regular searches so if you've got a search where you're getting all of these different things yeah most people don't use these features there's another example is if you have like to come the sheets per second oh here's those yeah and if you go to the guessing this here a little little blue dot on the bottom right under asset labels oh here yeah this or so people can see it because I know that our cameras always cover it oh yeah so yeah at this point is the inspector of you know just type in something like will say character yeah so you know associated the label character with that and it doesn't have to be all the same types of thing anything gets to do with characters you could put that last that label on and then if you want you can just click the label you can search for that label and you'll just find all of this stuff with that asset so the thing is there are a million ways to sort and organize and filter and find and yes I guess my point is don't get too precious with the idea that your folder structure matters that much you get really caught up in should I do it this way engineer do it this way the answer is it doesn't matter because the whole point of it is to make it easy to find so give yourself as many ways as possible that's a really good point there's only one difference I would say to that I personally sort my asset folder with one goal in mind because it is an underlying folder structure I don't care how it looks as a folder structure because that's something that like I said I can search through a million other ways but the one time I do care about the structure is if I want to add or remove the feature so if there is an entire concept hmm but we put ducks in our game lots of duck related and all of a sudden we're like you know what scrap the ducks ducks are gone I want to eat duck my game and so it would be really nice if you could just click the duck folder and delete it and not have to go through 50 different things uh-huh duck into the search thing have to eat all of them and make sure you find them so in that one instance I like to say stuff is vaguely categorized by the type of thing it is or by the category of what I'm not the not the type is in whether its interior descriptor but more so whether it's to do with a topic or category so that I can quickly and easily move it deleted transferred to projects and that kind of thing and that's everything rightly that's assets I rather like textures and scripts related to ducks and animations like would you say that you would have like a ducks floor that has kind of a similar format where you and I tend to use that sort of cyclical thing where it's ducks would have duck scripts materials interesting now all of that being said there's one last fit about that which is slightly different which is we've discussed before it's things take a little bit different turn if you start leaning into using assembly definitions yeah because in that case the folder structure does matter because you're you're actively doing unity assembly definitions work is the folder structure defines what assemblies are built to and I don't think you ever demonstrated this but we probably should do it one day but if you use assembly definitions and build your project and then go into that folder ya know that assembly - c-sharp it won't be the only one but the whole point is that all of those don't show that yeah so we can go over that but anyway I will say by the way to that comment you mentioned there is a there's something called assembly definition references yeah I think that allows you to kind of over like get past that you can have a subfolder deep in your project that's associated with an assembly kind of in another grand a happy when you play with those much myself but then again as I think I've mentioned before on the video is that personally the whole point of assembly definitions it's a hack to give you back different dll's mmm that you that you because it's not a feature that's easy to do in mmm but you can just do it yourself just like open up writer make it class library make it DLL yeah yeah happenin and you get all of the same stuff except you're just doing that's that's a personal preference that's how I prefer to do it but it's the same thing I kind of like to explore that because I haven't really I mean I have in the past but since I've been really messing around with assemblies I always just do it in unity I'm curious to see the buff workflow of doing it from writer so maybe cuz the thing is most people think it's like build a separate writer project like know you can you can open up the dot CS proj file and it's just a it's just an XML descriptor of all other different parts of the project and there's actually a pre combat out section so if you go to a CS proj file on any project and just open it the text editor there will be a comment it out piece of XML at the bottom that says pre build post build and if you basically take the post build one and open it there's little snippet of code you can paste in and you can effectively do like an ex copy and then copy the finish of build copy these things to this place and so I tend to do that into a relative directory so I tend to have this is my unity project in the same folder I also have my the class library project and then what I do is I say when this class library project is built go up a directory and then back down to the one with a u dot prefix of the same name and then from there going one more directory to plugins and then drop your DLL in there as well so just by the nature of having the two connected anytime I build my class library project it'll automatically build a DLL drop it in unity and by adding a new file that unity will reach rigor a building unity and all of a sudden it works yeah Charles hasn't said anything about writer yet are you feeling well I love read my writer pain yeah you know what actually I'm wearing my writers shirt or if you can see that yeah I love this writers shirt you know what I have a whole bunch of them that I'm supposed to be giving away so maybe in a follow-up stream next week I'll do a giveaway of my writer shirts I've got pins too so thank you for ringing that up I love writer I'm in contact with a someone there and I really need to reach out to them and see if we can't do some more stuff for the community with a writer yeah yeah like I know I know it's a joke a lot of people seem to think you're like officially sponsored or whatever but at the end of the day it's it's just simply a better tool like yeah if you've been doing unity work as long as I have I know it sounds like a million years old but no it's before five years that's long enough to say that and we all remember using monodevelop nightmare and so for those of us who came from a visual studio background with like a full qualified text editor it was like this is great but how do I get this in unity and so you could open the projects in visual studio back then but it was a nightmare because you did having these really weird issues where it would cause locks so the act of changing your code visual studio would cause that unity would do a rebuild which would lock your scripts which would then throw accept Phoenix is trying to save files that are being read by unity and locked and it's like a file systems work with actively cerebral so there was an unofficial plugin made for Visual Studio to connect the unity you actually to install this thing in your project and do a bunch of reference stuff and have this like build process Stepford would build one and wait and do the other unofficial hack to get facial Sedo to work and it was great but it was really really slow because now you have to wait for this double cycle of the compiling building your scripts and again this is before assembly definitions so you didn't have a way of choking your code to build smaller unity would be pre build your entire project every time you so much just put a full-stop for the script so it got really really tedious and so what did you do well again unity sort of scale up a bit unity officially bought that looking and built their own first party one slowly had integration with Visual Studio and moved away from monodevelop so now Visual Studio became the de facto solution but again it's slow and even with unities help in optimizing it and using Visual Studio Community Edition which is even lighter you would still have a really long turnaround time between the two so why did I go through all of that well because writer looked at that problem and it added support the unity natively and it's fast at least comparatively speaking to everything else and it works natively and a lot of the stuff that you expect is there and we had a quality of life stuff that no other plugin had like the ability to see the serialized values in the inspector yeah so world and it's like it's such a mind-blowing saves you an awfully I spent hours debugging because the value that I could see in my script is 10 is technically actually 20 because it's 20 in the inspector and I don't know this when I'm editing my code so why do we like writer so much because it literally saves us hours of time it's a very good tool and you know we don't need to be sponsored by them to try to express to people that is the better so although I'd love to be sponsored by them well speaking a writer I think we're let's start working on this project a little bit and I think we're gonna end up there very soon before we do just wanted to kind of show off what what we're working here working with here it's little cheap game it's really not complicated we'll go through a little bit of the code but you can go up and down it uses do tween to do a little jumping animation and I'm using WASD for movement not really that complicated and so the main files that we're gonna take a look at here sheep we got sheep class the player class is is what controls the Sheep X's controller we got this Direction class a couple of extensions we're not even using the game for this because I've gotten rid of all that fluff just hopping around so if we look at the code I'm gonna pull up the sheep class for instance we can see for one what you most likely see in your unity project if you don't really mess with assemblies or namespaces is that you're just gonna have all your your code like this and it's funny looking at this I basically stripped my products of namespaces this looks so weird to me yeah I admit whenever I don't see any space it's something I'm so used to yeah yeah so here we are in Ryder someone asked what's Ryder they're answering in the chat I appreciate that but in a nutshell it's it's a really you're looking at it it's like Visual Studio which is an IDE which stands for integrated development environment and basically it's a tool for writing code but this particular tool Ryder has native integration with unity like Jason said and you can see there's a whole bunch of little call-outs here you can see that there you can click this and see all the times that sheep is used these are actually you know in assets you know if I had to serialize fields they have little call-outs that as well in the UI you can see here this has this frequently called code because it just knows that this is being called in an update method somewhere which is pretty interesting yeah so there's all those really cool cool things that you've got there and then of course there's a bunch of other features like you can see why does it say my name a lot of people ask why doesn't say Charles a lot well because I've get github integration or rather git integration and you can see that now it's saying oh who edited this file and you can see all the times that I edited the file yep so if you're if you've got a team of six people and you're all working on the same project it's really nice to say who wrote this last bit and you know you can then have a look and compare stuff as for people worried about price and stuff if you are a student you can get it for free they literally will give you they have students offers yeah they'll give you assets of the free for the duration of your education effectively and then if you are a sole developer it will cost you money like it's not going to be free but honestly it's it's the difference between somebody doing it as a hobby and doing it as a job right and if you're being practical about this I can honestly say on ironically you're going to save hundreds and hundreds of hours of your life because over time over the space working on a project for two years all those little things you have to go back and forth and all the time you're waiting for something to compile and all the times that you're sitting there confused about why stuff is you know happening or whatever when I say that the price is around I think it's 150 or 200 for the year that is basically an entire year ask yourself how much you you're worth and if you think it's going to say to you more than ten hours over the course of a year which I'm pretty damn sure it will cuz it saves me probably like ten times that if it saves you that much it's worth the price and that's basically all that's the only math you need to do do you think if you're in a position where you're trying to make money by using like doing game development or using unity or using this kind of stuff then putting in that investment is pretty small in the grand scheme of how much benefits you'll get first yeah but again free for student stuff and if you happen to have graduated and you still have access to your student email you know read between the lines [Laughter] all right so definitely use writer it's awesome we're gonna see some more of the quality of life features that it has as we go through this alright so so what I was mentioning earlier is like we don't have a name space and if you're not sure what a name space is interesting how do how would you define a name space it's like an organizational tool that you used to basically I don't know cordon off each one of your scripts into its own into its own space that's not you might enter call in a box a box yeah that's all right like if I've got a bunch of scripts and they're all so for example let's take let's say at the very top here we're building something called cheap game adventure right if you make a box and you call it cheap adventure and then all of your cheap adventure stuff goes in the sheep adventure box and inside the sheep adventure proxy file lots of stuff well some of that stuff is going to be dealing with saving your game and managing all of your data and that kind of stuff so maybe you're going to have a box called saving system and so inside of your cheap adventure box you've got your saving system box and in the same box beside that you'll have your character controller and movement stuff so you might have character box so you've now got your sheep adventure box and then you've got your movement box and you've got your kind of persistence and saving books and then I'm story short your namespaces is that chain so if I'm holding up a script said where does this rip belong you just look up the namespace and it says chief adventure saving dosh whatever it's like oh that's where it lives simple box unboxing box and there are other boxes that have code like there's a unity engine box as we see here there's a system box all of these are namespaces that we are referencing boxes that we are pulling into our code base and saying hey look you can pull some clone out of that box pull some color out of that box what's good is that in those boxes you might have classes that share the same name for instance like I created a direction class this direction class that I created it isn't associated with any other box right now but if the unity engine happened to have a direction class in its box well then you'd have a conflict the editor or the compiler wouldn't know which direction you're referencing in fact because there's no namespace here I'm pretty sure that I would say that I I'm not allowed to create a direction in class because it already be one in the end you in the engine box so so what we'd have to do there is I'd have to say okay okay fine I'll take this direction I'm gonna put it in a box called sheep adventure and then now there can be two Direction classes and when I use them in my code I can I can tell the compiler hey I'm gonna use the I'm gonna use my direction from my direct for my sheep adventure box so that's kind of one of the big important important things of having namespaces that's and so yeah there's a lot of stuff in programming which is implied and kind of invisibly added before and after various things that you write and one of them is the path to your namespaces so take line seven we've written public read-only vector three vector so there is this concept somewhere in the world called a vector three and like I said it's in a box somewhere and we just happen to know it's inside the unity engine box now you can write right in front of it you can even do this an example Charles just write unity engine dogs vector three so change line seven so that it prefixes with the but the namespace so that is what's technically there now writer will gray it out it'll tell you that you're already like this this entire file has included that unity engine see so it knows it's needing it but you don't need to use using staples at all you can replace all using statements with a very manual unity engine dot thing unity engine thing for everything it's just unwieldy so instead of doing it in every place you move it to the top and you say just to just implicitly assume I'm putting unity engine in front of everything where she got a really good example random is a great example because you know there's sisters a system random and there's a unity engine random so if I were to pull system in here see how we have a red line one do I need there's two randoms which what are you trying to make yeah so it's gonna it's gonna ask me which one am I using and because I'm using both of these boxes unity engine and system and both of them have a random now I have to explicitly say hey I'm gonna use the random and one way to do that just to be more simple as I can call out say I want to use unities random so then I'm telling it we're gonna use unities random or as you may have seen what happened just now is when I actually use the editors help menu and to do it there's this thing called a static what's the kulluk isn't huh oh you need to do yeah yeah write an alias so you could you be I think it's called static something and in Java you use like the static keyword but in this case it's like an alias I'm gonna say hey whenever someone says random I'm going to I'm gonna point that's a unity engine dot random and if you wanted you can make this whatever you want so you can call this you know Yui random you can it just arbitrarily nameable which is called Yui random in case you wanted to use both Rams in one file and give give the other one s random which I rarely ever see but hey you know I'm sure it happens in some yeah I usually avoid it the whole point is that most of these tools are there to make your life easier and if you do this you're gonna confuse people yeah if I have two cases from using multiple randoms I will prefix things ways I will just write this one is literally system that random as opposed to this one which is literally you know the engine that run exactly so hopefully that's enough to convince you all that namespaces are valuable so what we're gonna do is we're gonna give our entire project what's called a root namespace and that's just all of our classes are gonna be associated with this root namespace and really most projects can probably get away with just doing that and then you're good to go you don't have to go in and get crazy about adding a whole bunch of namespaces for your persistence and and if I shouldn't say most cuz now that I'm thinking about it I don't think that's actually true I think there are plenty of projects that could get away with it but I think if you learn to use namespaces even small projects can really benefit from from leveraging them I know it sounds silly but I often recommend people do it anyway because it helps conceptually when you start moving stuff around yes if you're like me and you have a lot of scripts and a lot of projects all over the place if you're sharing a script with somebody you can just share the public class treat proportion well if you share it and it's got a wrapper around it calls you know chief adventure with the namespace you're like oh that's part of the chief adventure project I remember now that's that's what that's where this came from because that's what it belongs to so I think even as a social thing it's just a good idea to have a global namespace anyway not just because it's going to help you avoid collisions because again you don't know what you're going like very good example for this is you might write a health system or literally just health public class health and you're like there guy got help and then later on down the line you say does a really nice health bar asset that I want to use somebody's put on the assets mmm-hmm because you can't rely on other people doing this stuff they should be doing you will download this into your project and all of a sudden your entire project is a lot of read errors because they have in their own health system something called health which happens to collide with yours and it may seem like a small thing and you don't really need namespaces but honestly is it really worth the pain in the ass is going to happen when at some point someone happens to have decided on the same name as you and let's be real there's a lot of names people writing game code which is pretty identical there's a lot of players there's a lot of Health's there is a lot of saving and various different like grid and map and game yeah yeah aim manager and like you are going to collide other people's code at some point just put a nice wrapper around it and say this is chic games or sheep adventures version of these things you can completely avoid any future headaches yep so let's go ahead and do that let's wrap our project in a namespace a root namespace now you think I would want to do some Rider and you could if this was a traditional project you could go to solution and you can see here that we've got this main solution that's called Natalie's sheep adventure it's my wife and we've got these three assemblies one of them is dot tween as its own assembly which is great good for them there's editor thing you call it not to me it's do tweet we do tween so you think you'd be able to come in here and say hey I'm gonna make this the root namespace infallible code right or sheep adventure yeah and so was how do you choose it its name your project your root namespace is literally the project or if you come from a Java world it's your website but people who don't come Java background the convention in Java is the name is come your name das yeah whatever the project is which is insanity because as you start to grow a project the namespaces yeah very ver me like four or five deep right so let's be real as long as the whole point of it is is that it serves the purpose and the purpose it serves is to wrap what you're doing now again there is a method to madness the reason you having to do this is because it was actually your website and very good for documentation like you could literally be using some code and go how the hell do I find out more about this you could literally type in the URL from the inverted version of the namespace to find out all this I don't need that anymore we live in a much more efficient way of documentation can be built right into the to the editor yeah Oh Java do that just just use a nice picture maybe your project that'll do fine so I can't actually do this from here by the way I just wanted to call that out even though it does have the setting and you can hit it okay Jud unity is gonna regenerate this SLN and and that when regenerates it it's gonna regenerate it without the root namespace you say you have to do it from unity you have to set the rudeness his community so we're gonna go to edit and then we're gonna go to project settings and then in the is all these tabs you go to the editor tab and in fact I think you just do a search on it group namespace there it is we've got root namespace and it's even under the c-sharp project generation tab so now you can say hey whenever you generate my project make the routes namespace sheep adventure oh that right yeah so we'll save that and now when we go back to writer we should see that if we go to properties it doesn't help code well you I'm sure if I close the project and reopen it it would say sheep adventure cuz it's gonna regenerate but in this case it did not but that's just a pro tip there I have set this from this part of the editor from writer and it's been overridden I'm not sure at what point unity decides to regenerate maybe I would have had to change some code or something but yeah that would get over it so now that we've done that you'll notice hey all these all these files they don't have sheep Adventure what's the story here well we would need to add those in and if you're using writer you can do that very easily if you just right-click on the scripts folder and hit refactor this you'll see that there's this little call to this little menu and it says it just namespaces and so because writer now the assembly now knows that the root name so they should be cheap adventurer if you do that it's saying hey do you want to you want to adjust all these you hit next and then it's gonna adjust all those namespaces and there you have it we have sheep adventure and now this highlights as well something interesting which is a lot of coding standards will tell you that your namespaces should match your folder structure right and that's probably generally good advice because it makes things quite clear I don't do this but for very particular reasons to do it's dividing boundary lines that I don't want to get into the 12y on the scope of this but I will say just as a small note and you'll notice this as you start to expand things if you were to make us some folder in the scripture tewi and call it something like game or our it's called saving or something yes saving it's fine and if you made a file inside of this saving folder database so you'll notice it'll automatically it's now she prevents you're not saving it is it is helping you out by saying ah I see why you've why I see you're making stuff in the saving subdirectory so we're doing it for you now this hopefully answers a question that came up a while ago which is why are you calling it box in that namespace because narrative lis this makes it makes more sense to explain it this way it is a folder which is automatically being used to kind of categorize your stuff based on names place so for people who aren't familiar with names places I like using the term box it very clearly defines that that's your you can see it visually now right like there is something there scripts is what's called here but basically imagine scripts is actually called sheep adventures that's the route and then underneath that is saving and so subsequently all future folders will be matching that name structure so if you have multiple nested folders your name space will be nested down that hierarchy now fun fact if you want to if you don't want to follow this for whatever reason and I've actually already done this with the scripts folder in the project folder you can right click on a folder and now this is writer I'm not trying to do this in Visual Studio but you can go to properties and you can say you this is CSS name space provider if I uncheck name space provider and now it's gonna say hey the name space should be sheep adventure because this folder no longer acts as a namespace provider and if I turn that back on it's going to complain and you can see that in my scripts folder I've turned off name space provider and also with the project folder which is some of that you know we we mention that we do I've turned off the name series provider for that as well alright first thing like to do that again so it turns yellow so now if you hover over if it will actually give you a little warning and so for people aren't familiar with what these main yellow means here is something you should look at but it's not really going to break anything it's just it's usually some small thing you should look at in this case if you look under inspection in the middle it's telling you what it is it is saying name space does not correspond to file location I don't you can look at white saying and all that kind of stuff if you quit mean this to it'll actually take you to bring you to writer and this is why again you don't need the bloody calm down structure because you can just do this but that one at the top just stays disabled once right you can stable it or you could my personal favorite one down just underneath that is configure inspections very you can just say do not show this personally I don't care I like to control my own namespaces and I don't want writer ever to tell me that my namespaces are wrong I could do it myself it was uh that's another option you can just outright say you know stop order off cool a rabbit is thank you mister stream and we got a bawd coming up after this you can want re-watch it thanks for joining us I hope that this demonstrates that names aren't scary and they're also they're not some super complicated or only for you know leaf programmers the point is it is a structure that's there to help you and you shouldn't be afraid to use them and as you can see it's like three clicks yes dear at once forget about us even if you never do anything else other than just have a root news base just have yeah name space chica venture in space in my game that alone will save you any future risks colliding with third-party aspects that one thing alone is worth its weight and comes with all of the other stuff we talk about there's more interesting stuff you can do with it when we start talking about dividing project dll's and stuff and being able to have like code that can be compiled at runtime and you can drop plugins into your project and have it automatically load up new code there's some cool stuff you can do that requires you to sort of divide your namespaces but none of that matters yes and the most the only thing that really matters at the moment is just little make your life easier yeah totally I see question Oh what about EDD which is a domain domain driven development yeah in terms of game project structure I don't know that domain driven development really applies because I I feel like that more is when you've got like a database and you've got you know tables that have a whole bunch of information and you just want to say hey given the domain of for instance a person you know like you might have a person on a database and it might have first name last name Social Security credit-card numbers but like in the context of like a profile you only want to show their first name last name so you create this domain object that represents hey a person but for a profile and then maybe for like an ordering you want to look at a person in the context of an ordering or a cart then you want to say I want to get their first name lasting but I also want their credit card information so it's like in games you don't really have a concept of taking like a domain object and seeing it in different contexts it pretty much just is what it is you're you've got your player you got your you know your sheep or whatever and and it doesn't really there's really no context your changes yeah and everything it's kind of confusing to explain to people but when you talk about a domain unity is your domain your immunity that is your platform that is your a lot of lot of stuff when people talk about dividing your code and trying to like this is why it's so weird to me when people misuse everything in unity and the whole different talk with the point is MVC is designed to separate your presentation layers from your data and whatever but technically unity is your entire presentation layer okay that's what it is it makes no sense to put an MVC inside of your presentation there it's kind of an odd yeah yeah it's funny like you know I think that was a concept even for me that took a while to kind of grasp but like you know reaches are like it just a renderer you know it's it's got everything you need inside of it I mean you know obviously there's there's times where you kind of want to overcomplicate it and provide more sophisticated tooling for your particular project but generally speaking you can do you can do a lot of what you need to do just in the editor some Aaron says I want to learn codes but I can't no man you sure can anyone can learn code yep just want to do is start just got to start yeah you know what yes I'm gonna say no okay all right so we've got we've got a root namespace that's good for a step yeah it may already feel like one word but I really hope that we've demonstrated that there's there's a reason we took a lot of time to go over this topic it's one of those things that you'll like I think without even going I wouldn't want to nail him the idea because because everybody's done this and maybe you didn't realize why this happened mmm have you ever installed an asset or a unity package into your project and all of a sudden there's errors just lots and lots of errors in the in the console and you're really annoyed and know if nothing works till you delete the product at the folder that was added and then everything's fine again yeah yeah that is literally what this is that is that is the problem where certain files are expecting other namespaces and they're matching and confusing or whatever that is most of the time that's what that is there's other things that can happen that caused that issue but honestly most of the times that you install a project it's because either something has changed with namespaces or it's because there aren't things basis and things are colliding so you've seen this you've seen this happen in your own projects and so putting just one thing in place just avoids that issue so it is very important and that's why we're putting so much effort on this just the concept of a namespace so Raza says so can namespaces and and SMD files help in badly coupled code well they they will so if you're working on a project and you are using namespaces and you are segregating your code and drawing system boundaries what you know we call it in that case yeah that does help with poorly coupled code but just adding a namespace to your project it would by virtue of adding the namespace isn't gonna fix your poorly coupled code you need to separate that code and that's where namespaces and assembly definition files help you really create those boundaries they are really hard to cross so yeah inherently if you had a namespace rude namespace it's not gonna help your decoupled code but kind of tell how a lot of stuff will just all of a sudden magically stop working and get it very confusing because if you've got tightly coupled code and you put a single assembly definition and as you start to build up your project all the assembly definition will do will say oh I can't talk to that oh I don't know where that is and all of a sudden you'll have to start like wiring the different components together and you'll get a really good that you're messy code is messy code because the the way the compiler will work will highlight the flaws in your architecture because it'll like full-on refused to work until all of the connections make sense so to kind of I guess kind of show an example that we already made of a folder called state had deleted it but I guess in our existing code trying to see if we can draw some sort of boundary here I mean I guess one boundary would be that the game doesn't really need to know that there's such thing as a player or an NPC it just needs to know that there are sheep and needs to know when they've entered the pen so that could be a good opportunity to draw a boundary and say hey look NPC and sheep I mean rather NPC and player those are concerned about sheep controlling so maybe those can be in their own own namespace definitely like persistence and saving that could live in its own it doesn't need to know about what's you know provided in the code another thing that you could say is hey there are some things that are fundamental here like Direction is pretty fundamental this min/max is just a it's just a helper thing extensions extension methods you could say that these are core maybe these are core elements that should be shared across the entire project maybe he'd create like a core namespace now I did see that earlier on the stream someone had asked about the word core and yeah is core a good idea I never really can't you know consider that using the word core would be something that I think he mentioned that Microsoft documentation says not to use the word core have you come across that I haven't seen that before but it makes sense although I would say as well there they do have their whole concept about that but I I do agree that for the most part there's no real needs to arbitrarily have because the point is right like using the Box analogy again the point is stuff is in a box if it needs more detail it goes into a smaller box and so if if the root level box is your sheep adventure it's kind of City to arbitrarily say oh this is all the stuff that's in the sheep adventure box because we make a smaller you don't I mean you can just leave it there if it is part of that project yeah I don't tend to make Corker say well what I do tend to do is a dot common in a lot of case mmm how about if I'm if I'm using stuff that's shared but but then it's not chic adventure common because I that's no sense right because like cheap adventure is specific and to have like whenever there's something which is cross project hide usually one that's just my name okay namespace is Jason story and that's my root for all of my code that doesn't have a home it's like it can go to any project under any context and then under that I would have a Jason story common so that's the stuff I would use for all of those kinds of projects and then I might have other variants so I'd have stuff to do with sequencing things or animating things or whatever and so I would have exactly like unity and you can see this again like the kind of circle back on our unity like if you want advice on how to use your namespaces look where everybody else does it just right just right system dot for example but look at how Microsoft themselves do it there you go so these are if you scroll down a lot of these are types but you can tell once you start getting down to the icons so let's get to the collections is one of them so if you get to yes Oh see that little that little back and forth the two brackets that symbol represents a namespace and effectively again like folder if you were doc and if you scroll and it'll be easier to see here this was the bottom so you literally seen how Microsoft does it systems it's this very of doc collection stuff got generic stuff and then here's a bunch of types and there's no it doesn't go any deeper than that so these are all the types inside of it so this is this is them structuring it nice neat collection of here is the entire Microsoft System here is the collections that exist in Microsoft System here are the collections that are generic and we're going to much the reason there's a Dutch in Eric is because the original collection system for dotnet 1.0 there wasn't the concept of generics yet so they added that generics as a later Edition and that's kind of the point your namespaces right you can add stuff under other categories without really messy eater structure exactly it's actually under stuff and you don't even check you know these well it does the same thing you know the engine dot and if you press up it'll drop to the bottom you can kind of see here the end of the list and also all of these BR but these are also native rotated or even yeah yeah all the deprecated is done so so this is the nicest you'll see unity engine dot there's some UI stuff there's some VR stuff there's some exercise there's some scene management stuff there's some I don't have no idea what yes let me get a sense now of what the different components are yes the question is how should I sort my name spaces well just look how everyone else is doing it yeah and that's predominantly me whatever I am what are my entity is I my Microsoft a my unity engine now they're calling it systems because it is literally every system but it could be pretend that says Microsoft it's Microsoft and all of their other stuff like Microsoft code contracts all their other namespaces go under Microsoft and actually here's something go to references there Charles they can reference in your in your oh yeah oh here yeah yeah just add reference up here yeah should be an option to just right-click addresses oh yeah I go ahead oh my knee unity one maybe I go to solution yeah yeah dependency really right-click and add references yeah I reference so here is all of the namespaces that are natively probably on your operating system yeah and so you can you can see what these systems in your computer are using so their system that system there whatever and they'll be there is some of them that's like system that windows dot and there's other one system that Microsoft are there's a whole load of like Gordon there's other ones the Microsoft not whatever and so any company that you're using a namespace for will be like end and hopefully you're starting to see why these names based important during because these belong to certain companies their entire subset of stuff that's kind of nudged away and into the entire category yeah they're Microsoft up build so that's my stuff let's see sure all these different subcategories of names yeah cool so I think we've we've driven at home and I think that you know in this case I got for this project I don't really think there needs to be any other namespace because of how simple simple it is but I think to give it off to give an opportunity to explore to explore assemblies what I could do is we could create a unit test because testing in in unity it does depend on having assemblies set up so imagine we wanted to write some tests for the easiest one is this direction class because it's just a poco and it doesn't rely on being in a seem to run it does reference up vector which is part of the UD engine but otherwise it can just be your your basic edit mode script so let's go back on over to the editor to set that up the easiest way to do this by the way is if you can go in and create your own test folder and all that but if you just go to the general tab and hit test runner there's gonna be this test Runner window and it has some helper functions if it doesn't see any scripts or tests in the folder that you've selected you can go ahead and just create a test assembly folder and you can do that for all edit mode tests and play mode tests so when I'm at the at the very least what I'm gonna do is just create a folder called tests to put both different types of tests in and I'll just start with edit mode test so I'll just click on edit mode here it's gonna say hey do you want to create a demo test assembly folder say yes and I'll just name it edit mode over here on the left and you can see it actually created an assembly so an assembly is like well let me not open that up and writer assembly is like a name space but just a step up where we're at assembly is a box within one bit of code and you can have multiple boxes in one codebase an assembly if you had multiple assemblies actually breaks up your code into different dll's distributable pieces of code that get compiled into their own separate archives and so in that way it's really hard to cross those boundaries because when you just use namespaces in your core project or your just your project you just reference the other namespaces so like let's say like we saw there was the saving namespace if I needed to get access to that dot saving namespace I would just reference it wherever I wanted to there's no big deal but when I separate that saving that persistence namespace into another assembly I can't actually reference it unless I give the DLL a reference to the other assembly and so that extra bit of work really does take it to the next level and so we can see that here and specifically the term DLL stands for dynamically linked to library that's so that if you break that up into individual parts the term for it is library to start with so what is a library well it's if that is the collection of those different scripts so a library is like a little bundle of scripts that you can then pass around with a kind of with it with a boxed name so namespaces there's a very strong relationship between namespaces and assemblies as Charles was saying but it's that's kind of out of scope but I don't want to say there that the important part is the dynamically linked portion why bother with the allows what's the point if it was the dynamic linking that were discussing if you've got a DLL and it references another DLL you can you can basically build this hierarchy chain where this thing and this thing have a connection and then there's another thing over here which has connection and it's basically like a little tree so this connection of Easter but these two know nothing about each other not independently deployed independently the code is really really easy and separate because rather than talking to each other they both have a dll that they work with and kind of defer and can talk between and that's nice to get very important when you start thinking about things like multiple platforms and you've seen this if you've ever done any VR work or even multiple platform stuff in unity unity does this and has and you'll even see the check boxes right there under platforms you can have dll's per platform so you take the entire chunk of code that deals with a particular concept like saving or high scores or whatever and you can say this is all of the high score stuff that specifically talks to the google play implementation of high scores where this is how to save files but specifically on iOS devices and so you don't have to muddy your codebase by having to deal with the case of like four or five completely different things you can just say this one is the iOS stuff this one is the Android stuff and all I need to do is say save and then pick the right there though whatever platform you're on using video L to solve this problem yeah as you can see here we're looking at it's called the ASM DF file as Azzam def file and this basically in unity when you add this assembly definition file to a folder it's going to treat all the code in that folder and subfolders as part of a single assembly and then as a part of that you can edit certain things like jason was mentioning you know you can say hey this dll I only want to want this to be built for Android platform and so unity when you select the Android platform it'll include the DLL but if you were to go ahead and do it for ps4 build for ps4 then that DLL would not be a part of that build and then you can see and this is something we're gonna come into assume that you can actually reference other DLLs so in this case we've got this edit mode assembly and if I were to go ahead and just add a test and if I go to the an easy way to do that again is to go to the test Runner and say create test script and current folder go ahead and do that I'm just gonna call this Direction tests because we're just going to test the direction you'll see that when I go into this folder and I just let me just delete all this boilerplate code so we don't have to worry about it if I try to let's say just get a direction remember a direction lives in the sheep adventure namespace you can see that I actually can't access it there's direction in unity engine UI slider direction unity engine that UI scrollbar direction and and so this is another great example unity because again you know he's a big company with multiple different teams three different systems completely separate independently have a concept called Direction mm-hmm and they all do this by having their Direction inside of their namespace that they work with and so it's just literally proving what you're saying yeah it's a testament to like dark there's so many words are so common and and and in this case like to see a whole bunch of them but I can't see mine and that's because the test just delete this the tests lives this direction test class lives in the edit mode assembly and something that's interesting if you click on any script file so I have the direction test file highlighted here and look at in the inspector you can see there's an assembly information section and you can see that it belongs to the edit mode DLL so when we build this project and we'll do that soon we can look in the resources and see that there's gonna be an edit mode deal well actually probably not I don't think tests are included in builds but at least once we make another DLL yeah literally so here's here's a fun fact because I actually didn't know this myself so I look into it the runtime the the editor time dll's that you build do not process assembly preprocessor commands so funny funny fact if you d compile the assembly c-sharp inside of the unity engine folder not the one in your game build but like me the actual editor version all of those assembly pre processes are still there so every version of it is actually in it including all of your editor code in test code and that's why you only get those errors if you accidentally reference editor scripts in a runtime script when you go to build it for real because that's that's when it actually runs the deciders for which things get included or excluded from your food processor that's interesting yeah it's it's a I was like pulling back the covers and seeing things like that if you have not installed I'll see if I have it my tool bugs well we can we can mess around with that later I'm not sure if I have it in there am I have it but we'll add that to the next stream yeah if you want to see that drop it in the comment yeah bird on the comments alright cool so so we have this edit mode test assembly and you can see that the direction test is a part of that little scroll up to the assembly information but it can't actually reference the class that we want to test which is directions so the easiest way to do that and I'm telling you it's super easy you just right click on your scripts folder whatever you want to turn into an assembly and then you just say you just click on assembly definition well you name it whatever you like in this case I'll name it sheep adventure because that's I think that's the root of my project just the name space I used anyway so I don't know exactly what the best practices are whether you want to call it the name of the folder like if I should call it scripts or if I should name it after my core namespace but in this case I'll just name it sheep adventure and then if we open it up here we can see we've got got in the inspector there's nothing too fancy about it but if we start to click on these other scripts if we click on Direction now you can see under the assembly information it's gonna be a part of the sheep adventure DLL let me delete this real quick sigh I forgot to show you I delete that oh as a small side note because it was a question in the chat so one of the questions is what's unsafe code unsafe code so for starters unsafe isn't just like you know meaner dangerous I don't say he's literally a key word there's a lowercase key word and see sure I've called anything and what's fun is you can actually write unsafe curly brackets and then write some unsafe code in there otherwise if you're writing on safe code the compiler won't let you it'll actually tell you we won't build this because the code is unsafe what does that mean and have you seen it before the answer is yes you literally have seen it before because if you ever played Pokemon the original remember missing no missing no which is actually missing number because there's no ID for that particular oh c'mon is a literal example of what happens with unsafe code because what happened was we talked about that let's say variables or boxes - we're gonna use boxes a lot for this thing for some reason a variable is a box it has the number 10 in it that's your health right and the whole point is that you play with the number and it goes up or down or whatever but as far as a computer is concerned in memory those boxes are stored somewhere it's like having a shelf with all of your stuff on and you keep thinking of it in terms of just playing with a number but you're not you're actually dealing with a shelf of stuff and it may sound weird to say this but if you've got a shelf full of our variables technically you could take something from one box and move it to the next box over and it's it's kind of it's not from a computers perspective that's not hard to do you can dry take the value that exists in one position and just nudge it and you can basically get into some weird scenarios and so what happens is is you take a value that's part of something like health like it's meant to represent a number and you push it into a category that's meant to represent inventory and all of a sudden the number 5 gets moved into the box which is inventory IDs which is actually your health value and all of a sudden you've got new items in your inventory and if you watch speedrunners there's a lot of really new stuff that's happened recently with Zelda Ocarina of Time speedrunning and it's really funny because the way they do it is they do this trick where they pick up an object and they mess with the internal memory by moving around in particular ways which effectively means the slot allocated in memory that's meant to represent what object you're holding when you're picking up an item it's changed so when you throw a when you throw an object it'll land as a different object than the items you picked up there's some really weird stuff but that's awesome it boils down to you can choose the game and win in a short period of time by not actually playing it at all I spend about 10 minutes I'll pick a wall and spinning I mean I throw something down and you end up with an item that you're not supposed to get terrible memory yeah and yes so as is pointed out in chat you're getting into the whole concept of pointers and whatever and I don't wanna get too far down that rabbit hole I just want to say that like that is unsafe code is when code can do that kind of thing yeah I'm sure it leads to some funny stuff for games but if you're talking about a banking application oh gosh yeah somebody messes with an and all of a sudden your address overflows into the category meant to represent someone's bank balance a lot of problems happen so unsafe code should really be kept at a minimum it's only really used in particularly odd scenarios like doing stuff where you're like if you're trying to mess with fan speeds or you're trying to optimize your your computer processor stuff mm-hmm do actually want to work it on safe space because you can do some really interesting stuff with memory that's far faster and more efficient but you shouldn't if you are at our level yeah yeah I'm working on games and that kind of stuff so don't play with that stuff is all that sick long story short cool all right so so back on here we're trying to try to get access to the direction class within this direction tests class here I deleted the assembly that we had just created if you look at the direction now Direction class and the inspector you see under the assembly information it's now part of this assembly - c-sharp DLL I mean if we go back to writer you can actually see that right now and writer we've got this Explorer mode set to the unity tab but if we go and go to the solution view we can see all the Assemblies that are a part of this project and here you go now we've got this edit mode assembly and so that has our tests so this is a it'll bill is a completely DLL a completely different DLL and we've got the assembly - - c-sharp DLL and that is actually just by default unity will put all of your code into this particular DLL and if you have an editor folder fun fact it's gonna put it's gonna put any class in in the editor folders throughout your project into this DLL and something that you may not have known if you actually create a folder called plugins and I'll just for the sake of this I'm gonna drag Demi giant into there should be some code in there if not I'll just put text measure pro as well if we go back to writer we should see that there is a different assembly in here let's see if it resyncs and builds there should be assembly oh this is an analysis throwing up well there's there's another assembly called assembly - c-sharp - first pass and basically unbilled that will get billed first so I don't know just some little gotchas I'm not sure to get that show up and writer I've gotten to show up before but I'm gonna pull his out so we don't screw ourselves over and so we get to a good point though which probably mentioned before we go too far down this sure is what's the point of the house well I guess the first thing to mention is dll's or what's actually ran dll is our your code so if you ever worked in java you write files with a dot Java extension so player dot Java dot Java MMH ARP you write cheap dot C sharp now job is a little more visually obvious what it's doing so you take this code you wrote and you pass it through a compiler and a compiler does stuff to it and it spits out a new file right in the case of Java it spits out a dot class file and a dot class file is a compiled version of your code because you don't really think about it but the computer doesn't speak the language you speak and I don't mean English I mean it doesn't even speak c-sharp yeah or Java or any of this because the code you write first of all it gets passed through a compiler and the compiler looks at it and then it takes away all of the nice code sugar that you've added so for each statements don't exist in c-sharp technically you actually are using for loops for or well technically for each is actually using iron numerators but the point is there's a lot of features you you think are parts of the language that are not they're just nice like editor stuff that gets stripped away as the code is compiled so step one remove all of that stuff any of those like nice interpolation syntax Turing's all of that stuff next step it does was called lorry so it takes the code that you wrote and it changes it to make it more linear because you write a lot of code using things like co-routines and iron meters and again they're not technically concepts that exist at a code level in terms of what the computer understands so it takes all of that stuff and strips it back in turns it into case statements my switches of if this do this if this do this at this do this there's no such things in a numerator at that level and then it goes one step further and you now have code which is the compiled version of your code it other stuff too like it strips that stuff it does some really clever stuff like if it knows if you say to values like int a equals 5 into P equals 2 and then a plus B and then do other stuff and then those that value is in a small scope it'll figure out that there's no way for those two numbers change and it'll just add them together and set one variable if there's a lot of really cool little optimizations that says you're doing a calculation here but when it comes time to use this code you're not actually going to be the calculation so it does all of this stuff and then once it's done with all of that it then compiles it to a whole different language called high L or MSI out for the Microsoft version what's that interpreter language okay good fender media language and this is what makes it even funnier it's in the name its intermediate language that intermediate language and then what's also called machine code anybody heard that term that's usually referred to at the il level right and then it's moved into something which is applied on the processor itself mm-hmm now the metaphor I use for this I think is quite clear you can write instructions for how to bake a cake that'll include you add milk you add sugar bomb about but if you give that to somebody they can't just do it because there's other stuff involved which are like the human steps like yeah you know grab spoon grab Bowl or all these things so that would be the equivalent of moving it down new layers until it gets to something that a person can use like a person like the aggressive you might say mix ingredients and then the the actual machine code would say pick a step one pick up spoon step to pick up bowl step 3 so that's the second stage that's what's moving it and getting rid of all of that syntactical sugar and making it more applicable here's the thing even that technically doesn't work you can't give somebody those instructions because where the spoon exists in their house is different or where the bowls are in their house is different so you take back now instructions that have gone from add sugar and milk to open the fridge get the milk and then you go one step further and say in your house move to the left go up to the thing grab on the that is what the last step is yeah because il is handed to a processor it is handed to your actual computer and depending of a platform you're on whether it's in teller you know whatever the architecture is for it it will choose how to interpret those instructions those instructions are actually quite simple there take a number add a number subtract a number do this thing it gets really small at that stage they are Maisie talking about registers and whatever but the point is how assistant chooses to interpret those that's how you can run code on phones as well as computers something else with a lot of different architectures they're an ARM architecture should be vastly different so that's that's kind of how you get from what we're writing is a very basic how to bake a cake so with that in mind what's a dll well a dll is the Box where someone has gone through all of that process wrapped it up and you can now hand it to a new system and say this is ready for you it's already now in il it's it's done right so a lot of work has been done to get you to that point and unity is doing that for you in the background so your scripts every time you see that little load bar and it's going through all that stuff I know of Kirsten we're not getting into just in time clever optimization stuff but they don't so long story short the point of a dll is it is littering your compile code and it is the thing that is around that actually make stuff happen on a computer yeah and when you start talking about the DLL portion of it the dynamically linked because it's code that runs a compiler or runs on a processor the dynamically linked stuff starts to get particularly important so we'll we'll get down that road later but there you go that's what a DLL is that's worth keeping in mind right code folder coding with unity makes a good point to make an app I first need to create the universe so there's a lot of steps basically no reason want to make sure that it's because we may have given the impression that namespaces and assemblies are just like various shaped boxes the put stuff in mm namespaces are structural you kind of make things easier what assemblies are like required though here is a coin that is the thing yeah yeah is the actual code so I want to make it very clear that it's assembly is like what you're actually building towards right and like unity it's all assembling all the code you write yes already in that's the c-sharp assemblies yeah yeah that that's where it lives yeah by default but now we've done here is I actually we actually created the sheep adventure assembly and by virtue of it living in the same folder here as all these scripts if we go back to writer there we go we see that now we have this other assembly here called sheep adventure and there's a whole bunch of squiggly as in errors and that's because we're referencing things from a text measures gonna complain about do tween dot between because those need to be referenced hopefully it now makes more sense after that panel Roger we're done that we're not just saying oh I can't see it anymore because we're not just talking about one scripts in a in a folder beside the next script we're talking it's basically saying I have gone through this entire chain of stuff and ended up in a nice neat box in a whole new language and I can't see that one does it's over there it's gone through its own entire process so it's it's the reason it's giving out is it's literally in a completely different conceptual code universe at the moment right if we look again this text mesh it lives it I'm not sure where lives maybe it lives in the assembly - see sharpers and I imagine it would probably be in the assembly - t sharp one because it's in the are just had folder at the TMP underscore text that whole effect you under at Actium oh oh yeah it does have its own assembly ok so basically we just need to say hey look sheep adventure once we go back sheep adventure wants to be able to reference this class that lives in this namespace but this code lives in another assembly so all we need to do is say okay let me go to my sheep adventure assembly we're just gonna say hey also have you created that one yes because you actually have to create the I think I have created it I know that because I've been using this project as my tutorial but right yeah so it's up here in tools right so people don't know people might not know what is it again it's not under tools I got demijohn which is dude do tween oh here much pro I know there's somewhere where yeah it does pop up and it says hey do you want to create a maybe I'm confusing oh I think it is do tween bro is smart enough to to just do it yeah look your movie yeah I did that one yeah all right so let's go ahead now we're in the adventure ASM death file and if we go ahead to this assembly definition references section I can add one and then we're gonna just reference text mesh Pro so we see unity add that text much pro they have editor they've got tests we just care about this just rule level one so we'll have that and for good measure I'm gonna just add the do tween one so we see we got do tween dot modules so remember we only talked about what the L stands for dynamically linked well so when we apply that now if we go back up to sheep adventure game we see that hopefully there you go it rebuilt the project or whatever the case may be and it would now its able to reference that some reason my du tween is still complaining all the time it'll technically still work it'll turn red but it won't stop any issues in terms of builds for me sometimes that's annoying well let's go back to the unity of you sounds look at that I think I think what you have to do is because it's based on the like build cycle for the two apps yeah so sometimes you have to close writer and then do the whole open again just to get it to like I know I moved it I moved it around by sticking it in the plug yeah in any case I'll just close that and like appears fast enough I could probably just reopen this let's open the direction text Direction test file and now what we're gonna do is because oh well now it's the opposite way so now the the edit mode assembly still doesn't know about the sheep adventure assembly so again if I try to say Direction dot it doesn't it doesn't know it's hard to see her it doesn't know and and writers cute enough to be like hey do you want a reference she Provencher but we're gonna do from unity just because I know that a lot of times you need to do from unity because it gets overridden it with generation we're gonna go to that edit mode assembly here you see it in the inspector and we can see the assembly definition references a couple of other assemblies already a couple of other dll's we've got unity engine test runner and unity editor dot test runner so i'm just gonna add our sheep adventure so you can see now it's there we'll add sheep adventure it's safe or apply that's important if you don't do that and i've done that a million times to ride in bed oh my god doesn't work you have to apply it and then if we go back to writer and now we should be able to say direction and there's sheep adventure right here and it has a different symbol i wonder what the story is there okay okay fair enough so we'll do that and now you can see i can you know i can reference all the which I didn't really dive into a basically direction has the ability to it has a bunch of static properties that represent cardinal directions but now you can see that I can reference it and if we look up in the using statements sure enough there's my sheep adventure namespace which is now available so so yeah I'm not gonna write a test I think I think we've gotten to a good stopping point where our well there's just one last thing I want to come sure let's cover that and then we'll call it again it would be really nice if you did have some how do you do it what's the steps to do that just to make sure I have it or not let me try something with this dot peek oh I might have it so something's opening 29 okay hey they got cool you have a nice ok so just just make one quick script in your project here and we're just going to call it game controls or something I'm gonna just do a really tiny thing here okay game controls so do a update statement and just do a if if the Escape key so yeah well we get to doctor peek in it's it's a free tool so it's instead of this what we're going to say is application not quit cool okay so this is if you've never seen it how you quit a game oddly enough most people don't actually put quit codings it's pretty funny I'm sorry that it's so tiny here by the way guys I I don't think there's a way for me to zoom in you can zoom open the script okay cool like none of that matters that's just the assembly okay yeah so just so if you run this that's one a highlight something so drop it into your scene and just run it where is my scene he heard his hierarchies here alright I'll just uh this game controls so this is our one line if backspace quick game now run this and if you press escape nothing will happen the reason nothing will happen is because that doesn't work in editor that works when you've got a built application and this can be very annoying this is very hard to tell what's actually going on now head back to our scope and just for a second comment that line out and replace it with editor application for quick oh it's it's is playing equals false annoyingly because unity has to be obnoxious at some of this right Wow now run it again 30 3 2 1 oh I love it so that's really cool you're like good I did a thing now I can quit the editor when I press escape that's kind of cool but here's the side effect you didn't realize that just happened when we did that it back over to the script and look at the top uh-huh to using statuses one of them is now using unity editor what does this mean this means that we have just included the unity editor in our build which means technically if unity would let us when we built the game it would have to build the entire application and the entire editor to access the scripts that exist in your name just to give you that one line of code and obviously you shouldn't do that and so it doesn't let you it'll tell you cannot make a build of your game if you've included the unity editor in your build so what do you really want well what we really want is if we're using editor stuff we want that to only work while we're in the editor but when we build the game we want to take that code out now we already know our code goes to this entire compiling process so unity knows how to do a little bit of sikhi rewriting of your code right before it uses it and so we can actually tell it this stuff should only be included in the script at the time with which you are actually running it in the editor and so the way you do this is use something called a preprocessor command and hopefully now you'll see why it's a bit too think in a normal statement so if you now here's when people forget you have to start with the name space because the name space will be included and that'll throw an error so yeah and then we can basically say there's a whole load of them but yeah I think the one we want is yeah well so unity editor that's fine yeah and then that's very end hash and interfere and yeah so now what we said is that line of code will only be in this script when you're running the editor and I don't mean I really want to stress that the way this is different what that saying is it'll literally take out that line of code when it comes time to actually build application and we can prove this if you now do an else so you've got hash if you can do a hash else you gotta gotta gotta yeah I'm gonna put that down there so I'll do it else you have to do in between Lee and if so if hash if hash else and if ya now notice line 17 is greater it out here because it's actually telling us at the current build version of the application the DLL that unity is building secretly in the background as you type that's why the build goes up it is a version that is technically unity editor so that great outline isn't actually in the script at the moment it looks like it we can see it but literally it's not really there and this is where I wanted to kind of show that if we can if you could build this project and open it let's do it open up that DLL we can demonstrate that so I'll do a build settings got the game scene just do a builds here where that puts it all right coach drop it in this builds folder it's like I've already built this before I'm gonna delete these so refresh so select the bills folder uh-huh okay that should do it they're doing it something's happening there it is oh I should've a queue demonstrated it if you left it open it will give without that at all if you put using unity editor it'll crash me do this Oh it'll crash well not crash like okay I'll give you the give me the red arrow and go I got I got I got it all right so here's the kind of zoom in here do they hear the results of that yes so head over to the yeah yeah resources Oh manage my battery written and then it should be your yeah so we should see in here somewhere I'm Jim again so it's easier to see hopefully it's not really though so these are all the details that are in your project and one should be called sheep adventure yeah and if you haven't done the process we just did where we did the assemblies it would instead be called the assembly the assembly - seizure alright so I should be able to open up dot peak and just drag it in yep there she is double-click it on that one it comes up and yeah there's your nice face and here's all your scripts so that was game controls yeah about a second okay so here's what I was talking about so the first optimizations is it's doing oh wow look at that that's cute yeah because oh yeah that's hilarious the reason why is because it's doing linear steps right so their code is easier if it can do exits out of ops because it doesn't think about the rest of the code so it doesn't do these giant ifs because it's not how code works yeah yeah versus you're safe it doesn't guard close and notice it's got none of the other stuff that we include it because we've specifically said don't include that stuff when we're actually making those scripts and here's the fun things this is our script by the way guys in case it wasn't clear this is well to be very specific this is a decompile version of the script if you actually click the button in the top left top down there show compiler generators aha you'll also see that even though unity doesn't let you use them there is actually a constructor nice because it's added by the compiler so if we had a sink over to hear things we get a lot crazier you'd see when you press that button your code that's a whole different don't get down that road all I'm getting out here is there's the code mirros it's gone through a whole load of processes and it strips out a lot of stuff but this isn't even the code that's in the DLL so I talked before about it goes through all these processes this is decompiled which means it is reconstructed back into let's not what actually what it looks like if you right-click on that script there anywhere Charles there should be enough called IL code and this is the real code these are the actual instructions that are being ran Wow and so you'll see here it's not as confusing as you might think but if you hover over any of those il underscores you'll see that they're all named it a description of what it does or sorry that the labels to the right of it hmm hmm Oh tells transfers control to a target especially now all of these are kind of fairly straightforward to think about it that's basically saying return false the one called call calls another function right and so the other ones are like pointers in the treads but if you think about it it kind of reads roughly the same yeah yeah it is saying call this return false under this condition otherwise return true call this function return how did it there's other stuff in here too right it gets more interesting as you start to add more code especially like kinds of things but the only reason I wanted to show any of this stuff is to demonstrate that the whole process of building dll's this is this is what happens this is where it goes and the whole whole thing of why you need to do this and why you need to have dealers and stuff will start to become more apparent once you realize that you're actually talking about this sort of like whole separate box of separately compiled code language right no yeah you can pretty much take any dll on your computer you can grab any DLL you find and drive over here so this is dot peek it is free from what I understand and think I guess so and there's a ton of ideas for you but there's a ton of that you can there's dot traced oh yeah actually that there's a other ones that aren't by jetbrains but it's like a bunch of free ones soon to be sponsored by jet branch to put that out into the universe and actually it is kind of funny if you've got any unity based games on your computer you can basically go if you if you basically do a search on your computer for assembly - c-sharp because 90% of game devs do not use these places you will actually find that root DLL across every single project you'll be able to like oh shoot never song come coming for you that is unfortunately not nice space let's see things like you can kind of kind of look at code cool yeah very cool cool yeah that's great I mean I you know it's interesting to go through the steps really because either this isn't even an exercise that I personally do very often but it's it's great to see this and and I am very interested in pursuing this more much yeah only to be another's needed yeah like once you have a DML you could technically leave the scripts and you have your code your the scripts don't matter the scripts the scripture what gets you to a day allows back to the point right there is one fun side effect to this that it's slightly different so now that you've actually seen what IL is you know what that is right we've gone through it is that language mmm you might have heard the term and not really know what it was called IL to CPP mmm-hmm the concept unity talks about a lot well let's break it down il to CPP what does CS fan for C sure mm-hmm what's a CPP stand for C++ what's il to CPP converting il to seasons closed so that's what il TCP does it effectively it's a way to run on certain platforms better because some some platforms don't like il as much as they like C and so some things aren't supported under that under under projects that get generated or converted to CPP yeah and and what's fun is if you try to decompile a see people's project it's not as easy as that you actually can't see the code like that because of the way it doesn't it doesn't give you a DLL like that so unfortunately you actually can't peek at those projects in the same so if your unity project is converted to C++ that's probably a better version of obfuscation of your code yeah cool well I think that was good I think I think that's a pretty good stopping point we cover all the things that I'd like to cover and then and then some so appreciate everyone for coming up to the stream I'm sure there's lots of questions that we missed as we work out on going through this so please please drop those in the comments and we'd be happy to get to them you know we'll do our best to answer any questions you have sometimes again if you learn anything at all you found it all interesting please give us give us an off-roader in a comment and let us know what you thought of it in invoke invoke that like button so thank you guys for coming it was kind of an impromptu stream but had a lot of fun hanging out with you guys this Sunday afternoon at least where I'm at and yeah stay safe we'll catch you sometime next week for a stream and if not Sunday I'll see you for another video yeah thanks guys all right take care
Info
Channel: Infallible Code
Views: 8,969
Rating: undefined out of 5
Keywords: unity 3d, gamedev, game dev, unity3d game development, unity game development, unity 2019, unity3d, unity, how to make games, unity game dev, game development, indie gamedev, how to make a game, game programming, game developer, game development unity, c#, unity 2018, programming, games
Id: e69cSW3nZ68
Channel Id: undefined
Length: 114min 25sec (6865 seconds)
Published: Sun May 31 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.