Unity Architecture for Noobs - Game Structure

Unity Architecture is one of those things which can completely overwhelm new devs. This video will introduce you to a handful of architectural design patterns, which shy away from over-engineering, allowing you to learn the basics and get on with developing your game. Simple patterns are perfectly fine for most projects solo devs and small teams set their sights on.
Package: bit.ly/3JthhfR
❤️ Become a Tarobro on Patreon: / tarodev
=========
🔔 SUBSCRIBE: bit.ly/3eqG1Z6
🗨️ DISCORD: / discord
✅ MORE TUTORIALS: / tarodev
0:00 - Intro
0:50 - Hierarchy (Scene structure)
2:17 - Project (Folder structure)
3:00 - Singleton Managers
3:58 - Game Manager
5:47 - Unit Manager
6:12 - Scriptable Objects
8:22 - Persistent Systems
9:18 - Audio System
9:38 - Resource System
10:44 - Unit hierarchy
14:33 - Utilities
15:00 - Rest of Folders
15:18 - That's it (+announcement)

Пікірлер: 357

  • @Laurynaspupsta
    @Laurynaspupsta2 жыл бұрын

    Great video, but there seems to be a mistake in StaticInstance class On the Singleton class, there should be a return method inside the if (Instance != null) statement. Otherwise, the base.awake method is still being called, and the previously created static instance ref is overriden by the StaticInstance class's Awake method. But still, the structure is amazing. Keep it up!

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Yup, you're 100% right. At the time I must have thought Destroy would effectively act as a return (how crazy of me). Thanks for picking that up!

  • @nathalieraffray306

    @nathalieraffray306

    2 жыл бұрын

    @@Tarodev You should pin this comment! I definitely spent some time confused because there was no return statement and thought I was misunderstanding something. Great video though

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    @@nathalieraffray306 you're right. Done!

  • @ihugyoucuziloveyou

    @ihugyoucuziloveyou

    Жыл бұрын

    @@Tarodev or anybody else can write the correct code please? Not sure where to put what.

  • @urselhorst9253

    @urselhorst9253

    Жыл бұрын

    thank you for mentioning this. I ran into an issue with the missing return and wasn't 100% sure where to fix it

  • @ZahhibbDev
    @ZahhibbDev2 жыл бұрын

    It's quite rare too see a tutorial on architecture, so thanks a lot for this! Happy holidays mate!

  • @Pixelhurricane
    @Pixelhurricane2 жыл бұрын

    I think one of the most important tips I received in this video was during your intro, "as you learn as a developer it will adapt and evolve to your style" I had been confusing myself trying to force other developers' styles of architecture into my projects, what I *should* be focusing on is taking advice from other devs to evolve a style that's suitable for the way that *I* think. Really enjoyed this video, learned a handful of other helpful things as well!

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    That really is the most important takeaway from the video so I'm glad that part stuck.

  • @Tarodev
    @Tarodev2 жыл бұрын

    Few spoken mistakes in this video with corrected annotations. Needed to rush it out before "Merry Christmas" became too irrelevant heh. Love you guys! Enjoy.

  • @rohanmanchanda5250

    @rohanmanchanda5250

    2 жыл бұрын

    Or you could have just erased the part where you say Merry Christmas? The only thing would be the bush stuck on your head but I think it'll be taken as modern art...

  • @mehmedcavas3069
    @mehmedcavas30692 жыл бұрын

    we need more of this kind of tutorials. great work

  • @windwalkerrangerdm
    @windwalkerrangerdm2 жыл бұрын

    This was something I seriously needed as a self-thought developer, and there are few (maybe no other) examples of architecture out there that's in my league... Thank you very much and you've got a sub.

  • @tylerheenan9393
    @tylerheenan93932 жыл бұрын

    Wow. Busts out ALL the awesome tricks it took years for me to learn and a few new ones! Amazing, mate.

  • @sprungo3968
    @sprungo39682 жыл бұрын

    This is great content man. There's so much out there for the beginner it's really refreshing to see well made tutorials that cover this intermediate kind of content.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Thanks mate! I'll have some more intermediate to advanced stuff coming shortly!

  • @JasonStorey
    @JasonStorey2 жыл бұрын

    Great Video, I follow a very similar structure. The only real standout differences is that those "separator" style gameobjects with dashes etc, if you put them on the editor only layer they will be auto stripped from the project which cleans up the build hierarchy, and the other one is that I personally try to avoid "resource loading" style code at runtime if possible. In the case of populating a repository of units etc, if they are not going to be loaded from a remote source I have all the info I need at edit time to populate the arrays myself. So I usually write a little helper function that uses the search syntax in unity to find, load and populate an array with matching content. so for example, a context menu button that has _array = ResourceLoader.Load("t:prefab l:unit boss") which would then find all prefabs with a unit label with boss in the name, get their resource guids, resource load them and pop them into the array for me. Oh, and instead of using the _ on the scripts folder I make a generic "_project" folder that I treat as the "real" root. so it has its own data folder for scriptables, its own prefab folder etc. That being said, I subscribe to the belief that the unity project view is NOT a folder structure but an asset database and so I don't try too hard to wrangle the folder structure, but empower myself to be able to use it through targeted naming and use of labels and other search utilities. Again, great video. It's always a joy to see other people orbit some of the same patterns and practices, it means we are all coming to similar conclusions so their must be a kernel of value in them.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    What great insight, Jason. I love your videos by the way! Your editing is so clean and satisfying 🤩 It is nice seeing us all reach similar conclusions. I'll be interested in what you think about my slightly off-market state machine video coming out soon.

  • @Nova04550

    @Nova04550

    2 жыл бұрын

    Jason Storey you are an inspiration!

  • @RealisiticEdgeMod

    @RealisiticEdgeMod

    2 жыл бұрын

    11:06 You are violating programming principles 101. Composition should be used instead of inheritance. This has been the standard practice for 27 years. ( the gang of four book was published in 1994).

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    @@RealisiticEdgeMod Wholeheartedly disagree, and this is also coming from somebody who uses composition over inheritance 90% of the time. In addition, overusing composition simply to avoid inheritance is even worse than not using it at all, in my opinion. As this is a unit base and I know EVERY unit will take damage, it makes sense as a function, derived from inheritance. Over-engineering is the death of many projects, especially for new devs, which is who this video is for.

  • @RealisiticEdgeMod

    @RealisiticEdgeMod

    2 жыл бұрын

    @@Tarodev I agree that sometimes inheritance is better but in this particular instance you really should use composition.

  • @BlueJeebs
    @BlueJeebs2 жыл бұрын

    Nice, there were a few things I've been doing but some of them went completely over my head. I've heard more and more about scriptables so inevitably I'll need to dive into them. Thanks for the rundown

  • @greghcarr8192
    @greghcarr8192 Жыл бұрын

    I've been hopping around between different Unity tutorial channels and I think I finally found my home. This video has been incredibly helpful for me, thank you.

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Welcome home Greg

  • @Caphalem
    @Caphalem2 жыл бұрын

    Always happy to see a Unity video promoting some proper programming patterns

  • @VirtuwolfGames
    @VirtuwolfGames2 жыл бұрын

    Looking festive af bro! Thanks for the Architecture advice. The neater it is, the sweeter it is

  • @alexcubed4270
    @alexcubed42702 жыл бұрын

    I like that you put the commment at 15:18. I recently switched to using that approach and i really like it. It makes it much easier to find the stuff you need when working on a feature, especially since the different file types all have their own icons, so if youre in a hero folder, its very easy to locate all the sounds for that hero for example

  • @Nova04550

    @Nova04550

    2 жыл бұрын

    I think I would worry where to put files that could belong to more than 1 feature, but idk, never tried that way, but you can always mix and match both paradigms

  • @Liamneedham29
    @Liamneedham298 ай бұрын

    This is the exact tutorial I've needed. I find it so easy to come up with ideas for games and visualize what that game will end up looking like, and impossible to understand any of the structure I need to build. Every tutorial has their own structure that they follow without explaining, or they stick to very basic stuff without ever teaching you how to implement a structure. I now know what I'm missing, what I need to learn about and what I can figure out through trial and error. So instead of searching "how do I actually make the games I design", I know that I can at the very least build a structure with this in mind, tweak the structure to suit the game better if need be, and start actually making the games. It's like being a painter and never being taught how to use a canvas or a brush - sure you can throw the paint at a sheet of paper and call it art, but if you want to paint something in particular, you need to know what frame you are working within.

  • @rezmon5311
    @rezmon5311 Жыл бұрын

    Found you a couple of days ago. The educational content is very much appreciated, Ser!

  • @helenvillian
    @helenvillian11 ай бұрын

    I'm new to Unity and making games but work in data & analytics professionally. This video has helped FAR MORE than any tutorial. I really need to understand a good workflow and architecture before diving into learning Unity itself and C#, from this video I feel I have a good base to start on a game when coupled along with a detailed game plan of what I want the end product to look like and have. Thanks so much!

  • @ElboxD
    @ElboxD2 жыл бұрын

    Exactly what I was looking for for weeks! Thank you!

  • @hectorcruz92
    @hectorcruz922 жыл бұрын

    I love your videos! This video is just what i was looking for to have a quick understanding of how to structure my games. Keep up the videos i know you are making someones life a lot easier!

  • @xxann55
    @xxann552 жыл бұрын

    Been using Unity for about 2 weeks now and this is what i needed! Watching the video and reading through the code/assets set off so many light-bulbs in my head, I finally have a high level overview of how a simple game would flow. Thank you so much!

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    You're welcome mate!

  • @PeterAlexay
    @PeterAlexay2 жыл бұрын

    Wow. This is exactly what I wanted. Thank you for this. 🎄🍾🎉

  • @sir.niklas2090
    @sir.niklas20902 жыл бұрын

    Your the first content creator, teacher who responds and adjusts to your communities comments. :D Thanks friend!

  • @dominicwindle5707
    @dominicwindle57072 жыл бұрын

    Your Unity tutorials are excellent. As a DotNet developer trying to learn Unity I really appreciate how you explain things

  • @pixeldevlog
    @pixeldevlog2 жыл бұрын

    Loved the video, these types of videos are very rare, as an experienced programmer, this was very helpful for me.

  • @halivudestevez2
    @halivudestevez22 жыл бұрын

    I will need to repeat it several times, and slow it down. Very valuable info included! Worth to watch it and learn, think it over.

  • @sabbracadabra7083
    @sabbracadabra70832 жыл бұрын

    Thanks for great video! I go back and forth to it for a few days while learning how to organize game better!

  • @mrpancakeguy
    @mrpancakeguy Жыл бұрын

    Excellence! Can’t wait to try this out.

  • @dmitrywroclaw9165
    @dmitrywroclaw91652 жыл бұрын

    Cool! Thank you and Happy New Year!

  • @anaibrahim4361
    @anaibrahim4361 Жыл бұрын

    tamara adviced me to watch this video and it was really answering all my questions thanks a lot sir for your efforts to simplify the game dev work by highlighting thos principale step

  • @MatthewKimbrough0
    @MatthewKimbrough02 жыл бұрын

    This is a great resource - I've made so many notes on my to-do list to try these out. Especially the dictionary of scriptable objects - good stuff!

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Glad I could help. Also, thanks for the support!

  • @Pharaxiel
    @Pharaxiel Жыл бұрын

    Thank you! I upgraded my "Projects' Architecture" almost instantly from "v.0.2a to v.2.0" ;) after watching this video. Great job!

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Happy to assist 🙏

  • @niranjanwagh5767
    @niranjanwagh57679 ай бұрын

    This is the video I was waiting for for long long time. I will be watching it several time in upcoming days to understand each part. Please consider making more videos like this in future. In each video you can deep dive into Managers, Setup, Enviroment, Canvases and System. I know you have videos on most of these topics already. But most of them are oriented for turn based games. Again Thanks for this video. It helped me overcome my initial barrier of game development journey.

  • @Seizen
    @Seizen2 жыл бұрын

    Wow, really good video. Most of the videos on KZread doesn't care about those details you mentioned. Subscribed.

  • @datablob
    @datablob2 жыл бұрын

    I learn something with every video, even with the beginner stuff, thank you!

  • @ItsMrFabry
    @ItsMrFabry2 жыл бұрын

    More of this Great video! I saved it in my playlist for later! have a good holiday!

  • @bunnybreaker
    @bunnybreaker Жыл бұрын

    I love everything about this video. Subbed for the head tree and intro statement alone 😉👍🏽

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Welcome aboard ❤️ 🎄

  • @tommyford1301
    @tommyford13012 жыл бұрын

    Thankyou so much I've really been looking for something like this :)

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    You're welcome 😊

  • @ObviousDev
    @ObviousDev2 жыл бұрын

    Great video! I always struggle with architecture so that was very interesting :)

  • @sn0man
    @sn0man2 жыл бұрын

    SO appreciate this video. Just starting out architecture and structure is hard to get started. Going to rewatch this a couple times and go through the project until it all makes sense.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Glad it could help you on your way :)

  • @robertjenkins6323
    @robertjenkins6323 Жыл бұрын

    Great video. I found this really useful as a beginner to unity. Thanks Tarodev :)

  • @okamichamploo
    @okamichamploo2 жыл бұрын

    Wow thanks. Been looking for a vid like this for years

  • @oliver.travelling
    @oliver.travelling Жыл бұрын

    Very interesting. Thank you for sharing your structure.

  • @Tharky
    @Tharky2 жыл бұрын

    Great video as always and posted right when I needed it the most :) Taro is like Gandalf for Unity.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    I should install more cameras

  • @ExplorationTV
    @ExplorationTV2 жыл бұрын

    Thank you Tarodev for the Unity Architecture for Noobs - Game Structure video, extremely helpful on my aspiration journey to game and film rendering development.

  • @buttforce4208
    @buttforce4208 Жыл бұрын

    Super helpful, thanks so much for making this!

  • @kdeger
    @kdeger2 жыл бұрын

    As mentioned these types of systems can cover %90 of the gameplay, great structure sample. Also maybe you can make another video for state machine samples and addressables(instead of resources I feel like it's more convenient). Great video as usual, oh oh also I'm going to become a Tarobro now!

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Thank you so much for your support man!

  • @djalexander968
    @djalexander9685 ай бұрын

    wow, found this on christmas of the next year, still is a great gift given im also splitting my head on my keyboard over unity confusion

  • @treppas
    @treppas2 жыл бұрын

    Such great suggestions, thank you :)!

  • @RobertGercia
    @RobertGercia Жыл бұрын

    Thanks for sharing this tips. Really helpful to me.

  • @hacklordmonster8780
    @hacklordmonster8780 Жыл бұрын

    Great video thank you so much. This is gonna solve a lot of issues i have with my games.

  • @chusatorra96
    @chusatorra962 жыл бұрын

    Love this, thank you very much!!

  • @eleonorahackman6779
    @eleonorahackman6779 Жыл бұрын

    This is so interesting and good to know! Thank you for this!

  • @rpamungkas13
    @rpamungkas13 Жыл бұрын

    This channel is really a gold mine for anyone learning Unity. It answer many questions on the back of my mind when learning this Engine :o

  • @youcancallmedoggie
    @youcancallmedoggie2 жыл бұрын

    Thanks for the vid taro!

  • @mrOverYeff
    @mrOverYeff2 жыл бұрын

    Can you make a video on decision making? Like good questions to ask yourself and how to resolve them. Example: should this class be a monobehavior, a scriptable object or OG c#? Flowed by some indicators you can look for and an example / fixing a bad example

  • @mrOverYeff

    @mrOverYeff

    2 жыл бұрын

    I'd really like this cause I feel like i know a lot of concepts but use them in the wrong situation :)

  • @mrOverYeff

    @mrOverYeff

    2 жыл бұрын

    Another good question: should I even ask this question on this project? Indicators: size, complexity

  • @jkRatbird

    @jkRatbird

    2 жыл бұрын

    Yes! I really need this too! Roughly understand what everything does but still really hard to grasp the what the purpose of each one is.

  • @mrOverYeff

    @mrOverYeff

    2 жыл бұрын

    @JonontoastTo: depend on your project: yes and no the answers most definitely depend on your project however there is some good questions that overlap and guide you in the right direction. To: questions about questions, I recently had a sw project (not gamedef) myself, where I was asking myself how do I optimize this and how do I handle this being in a bad state. Which in itself where bad questions, cause by trying to resolve problems that could exist I created problems that actually existed. And I feel like this is decision making. I hope you at least partially get my point now? And thx for the detailed response ^^

  • @edward3190

    @edward3190

    2 жыл бұрын

    Use scriptable object whenever possible. it makes your project easy to manage, debug and test.

  • @artourprice2435
    @artourprice2435 Жыл бұрын

    Thanks for sharing. Very helpful!

  • @zamidare9038
    @zamidare90382 жыл бұрын

    This is nice. I want to see more overview of relationships and how communication happen between managers and game flow. Because of the explanation for scriptable objects being easier to pull than needing to do a long route of making the object be present first was easy to understand and gave me a good push to try learning more about SOs. An overview on UI and scalable with different display sizes and how to manage them would be nice. I only have a vague grasp on the differences between controller scripts and the possible or common managers that are in a game. Singletons are useful for communication between scripts but I've read that it can also be bad or have some drawbacks (maybe if there are a lot of them) but I don't know the reasons. Good situations or type of systems when to use a private variable would be helpful (I'm only limited to info that they are useful for debugging because private means only that script can access it so pinpointing where the weird behavior or error is easy). Also which category would object pooling fall into? (I'm referring to script since there's a built-in one now iirc).

  • @codered_dev
    @codered_dev Жыл бұрын

    taro is the ultimate game dev,i hope my channel grows just a big!

  • @zanagi
    @zanagiАй бұрын

    6 minutes to the video I finally noticed that funny christmas decoration

  • @Tarodev

    @Tarodev

    Ай бұрын

    heh 😂

  • @alexfu1734
    @alexfu17342 жыл бұрын

    Awesome video! Inspire me a lot.

  • @adammain3424
    @adammain34242 жыл бұрын

    This was great, thank you. Would love to see a deeper dive into configuring that generic singleton class.

  • @yoshimario40
    @yoshimario402 жыл бұрын

    This is exactly what I didn't know I needed. Going into Unity without any knowledge of how game objects are organised, or how state and instatiation is managed, or how different scripts communicate with each other was a nightmare.

  • @atmos2766
    @atmos27662 жыл бұрын

    This was amazing ! thanks so much

  • @CodemasterJamal
    @CodemasterJamal2 жыл бұрын

    This is very helpful. I'll be honest, I never thought about putting all of my managers for a scene into another object, just to make it easier to organize and manage an entire scene.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    It's the little things 😉

  • @synchaoz
    @synchaoz2 жыл бұрын

    Big thanks for this. Not a lot of hierarchy/file/folder structure insight videos out there. How to manage all your files and crap seems to be one of those things nobody really spotlights. I suppose because, as you yourself mention, it's a highly subjective thing. But even so, as someone new and still learning, the value of seeing how more experienced devs manage their game structure should not be underestimated.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Glad you found it helpful Sean :)

  • @johnreycasingal6954
    @johnreycasingal6954 Жыл бұрын

    This helps me a lot!! Thanks

  • @bombrman1994
    @bombrman19942 ай бұрын

    I find that SOLID principles applies to game dev so good. Some might dislike it and start thro shades at it in other industries, but in game dev its definitely needed. It just makes everything clean and helpful especially if you are working with a team. Also easier documentations for modification and balance changes as we know its popular in video games.

  • @Mikelica69
    @Mikelica692 жыл бұрын

    Thanks for this knowledge!!

  • @SuperTungbi
    @SuperTungbi2 жыл бұрын

    Just what i'm looking for, omg thank god i have you 😍😍😍

  • @merlinduty7546
    @merlinduty7546 Жыл бұрын

    That's probably the single most helpful video on unity I've seen. This is the things you struggle with building from blank slate and step by step. Normally you just start with something, then at some point realise you need some kind of system to do X, than try to build that , conceptualize , look up specific tutorials , fail miserably because there are just tutorials about smaller problems saying 'Oh yes at this point we will do this just like this, but it's not proper, so mind that', look up forum questions, can't read beacause $$anonymous$$ , and finally be able to do what you wanted to after working through debugging sessions. Later you will realise you need some other system and refactor because you get this unorganized abomination. This video avoids so much pain, acting like something where to look up on how to implement X base concept and organize your smaller problems. Amazing. Could be just me since I have experience with software development, just not game development. I am not overwhelmed by the code snippets themselves, I can imagine you don't really worry about these things when you don't come from software engineering. However still kind of sad to see the use of this Don't Destroy and kill new versions pattern. My dev senses are all tingly with implementing that. Doesn't seem proper at all. Was looking forward to see a solution that avoids those.

  • @KeyboardKrieger
    @KeyboardKrieger2 жыл бұрын

    Good timing, I'm going to restructure my current project in January, so some input was very welcome 😊👍

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Good luck with that! It's always a big task restructuring mid way through 🙏

  • @KeyboardKrieger

    @KeyboardKrieger

    2 жыл бұрын

    @@Tarodev yeah, that's why I'm not already on it and have to finish the MVP beforehand -_-

  • @msj6894
    @msj68942 жыл бұрын

    Awesome! Thank you soooo much!!

  • @bshibishi5889
    @bshibishi58892 жыл бұрын

    I just got into this and I was actually wondering about this kind of thing, didn't even care to search because I thought no one would care to post. Subscribing was the right choice haha Thanks.

  • @andrewsneacker1256
    @andrewsneacker12562 жыл бұрын

    Very usefull content! Thank you!

  • @_g_r_m_
    @_g_r_m_2 жыл бұрын

    That was so much usefull information, specialy the singleton class

  • @dwried
    @dwried Жыл бұрын

    After leaving a game behind for a good while, and then going back to it, I started to question my logic on the game flow big time. This video just happened to show on my recommended watch videos shortly after. Thank you for the video. You have given me some insight on ways to look at the mess of code in games.

  • @TaAnderson-Google
    @TaAnderson-Google2 жыл бұрын

    Informative video - Check Entertaining host - Check Clearifying annotations - Check Showing clicks & folders - Check Just enough detail - Check Bookmarked chapters - Check Sample Unity package - Check Tarodev videos - THIS IS THE WAY.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Damn! I checked all the boxes on this one. Although: Zoomed in code for mobile screens: Unchecked

  • @TaAnderson-Google

    @TaAnderson-Google

    2 жыл бұрын

    @@Tarodev Trust the person that spots their own errors, tells you about them, and moves to correct them. That is the person that you don't need to follow up on or worry about. That is integrity and it is far too rare and so very priceless. You're personal/KZread checklist is problaby much larger. Your example is a legacy that others will look up to in awe. Well done. Happy New Year to you!!

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    @@TaAnderson-Google You're making me blush :D Have an amazing 2022 my guy! By the way, I'm premiering a video, starts in 4 mins!

  • @razanomer10
    @razanomer10 Жыл бұрын

    Thank you. You are fantastic!

  • @TheIronicExistence
    @TheIronicExistence11 ай бұрын

    Loved this video thank you

  • @svendpai
    @svendpai2 жыл бұрын

    Another great video, thank you for taking the time to cover this :)) A lot of tutors skip this part of development

  • @Betruet
    @Betruet2 жыл бұрын

    Great useful video. Subbed. Merry Christmas and happy new year. Thanks for putting in the effort.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Tha ks for the patreon support mate ❤️

  • @Betruet

    @Betruet

    2 жыл бұрын

    @@Tarodev hard work pays off ;]

  • @VSalmerV
    @VSalmerV5 ай бұрын

    I like to see different approaches to game architecture! Thanks for a video! One thing that I would like to make different here is to make UnitBase (or any _Base class) abstract itself so it will work more as interface but also usable in unity inspector.

  • @Mikelica69
    @Mikelica692 жыл бұрын

    Super useful video!! Thanks a lot

  • @coffeemachine2816
    @coffeemachine28166 ай бұрын

    Thanks man, good guide and nice hat

  • @xDTHECHEMISTx
    @xDTHECHEMISTx Жыл бұрын

    Man you make me want to start my whole base project all over again and be neater this way. Its efficient

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Big decision. A re-write always feels nice

  • @mralien9547
    @mralien95472 жыл бұрын

    Thank you , this is very useful

  • @KasperGrnbakChristensen
    @KasperGrnbakChristensen2 жыл бұрын

    This is good advice for new game devs, can recommend 👍

  • @kelskye
    @kelskye9 ай бұрын

    I've been learning Unity by tutorials, and I've found it frustrating that the tutorials are so focused in getting across specifics on how to do particular things in Unity that they only pay minimal attention to architectural concerns. I get that this is not to intimidate or discourage those who aren't from a programming background, but as a programmer it makes Unity feel like it's disordered by design. This has given me ideas for how I could impose a sense of order once I break away from the tutorials and into my own projects. Thank you!

  • @IndieDX
    @IndieDX2 жыл бұрын

    Thanks for sharing!!

  • @prod.jakekarno1765
    @prod.jakekarno1765 Жыл бұрын

    Top quality advice, thanks

  • @chioxin
    @chioxinАй бұрын

    Thank you so much for this. This is SUPER helpful after all the other stuff I've gone through and learned. =) I've been trying to find this to help with my sphegetti code. You are a hero =D ( to me at least XD )

  • @SojoTaku
    @SojoTaku2 жыл бұрын

    Noice!! Merry Christmas

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Ho ho ho

  • @fmproductions913
    @fmproductions9132 жыл бұрын

    I remember having that in my suggestions in one of the comment sections from the last videos. Thanks for making this and awesome to see a video on your project setup so quicky! Edit: There are a couple of things I do differently. Like the mentioned lazy initialization of Singletons (glad that got some coverage) which is nice because you don't have to explicitly set up objects in a first scene. Something I wanted to mention is the Units base class and an alternative way of doing it using composition. The base class approach makes unit specific logic easier to manage, provides common methods and data for inheriting units and in your game, the stats might only make sense when they are associated to an unit. Here is an alternative idea to do that uses composition: - Have an "Damageable" component or even an "IDamageable" interface that has different implementations. Damage can be dealt to any entity that has a component of this interface. - There can be a "UnitStats" component that holds the stats (if the stats are copied from the template by a manager) or a reference to the scriptable object template for the stats. - An "UnitDamageable" component implements IDamageable and accesses the UnitStats component to calculate damage. - To identify a set of objects under one type, there can be a method that gets all components of the first type, then checks if they also have the second, third etc.. But that's inefficient. If you need this identification, how about a tag component? Say there is a "TypeOfUnit" component with a RequireComponent attribute for "UnitStats" and "UnitDamageable". This would make sure that an object with that tag component also has the required components. I'm not really a fan of regular tags, since you can only have one per object and they are not type safe, since it's just a string. There are ways to make a better regular tag system though. Like having a custom component is optional but can hold multiple tags - with a custom inspector that allows only a dropdown of existing tags in the project. On tag comparison, make a regular tag comparison and if an object has that component, also check the tags stored in it. One problem remains: When the user changes the tag in the project settings mid project, which should probably be avoided. For handling tags in code I'd usually setup a static class that has pubic constants for each tag, so there is a layer of abstraction above just having inline string tags in your code.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    I agree, composition is better most of the time and it's what I use in my day to day. Although I wouldn't recommend it as a beginner pattern as it involves a few extra steps and this video was primarily about getting new devs up and running with as little steps as possible. Good writeup mate!

  • @fmproductions913

    @fmproductions913

    2 жыл бұрын

    @@Tarodev Thank you! Yeah, for conveying the ideas you shown, this is not really necessary of course.

  • @AbuSalmanAngoli
    @AbuSalmanAngoli2 жыл бұрын

    That is really helpful. Thanks man, lemme give you a hug!

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Gimme gimme

  • @abdullah4653
    @abdullah46534 ай бұрын

    great tutorial🤩

  • @geri4367
    @geri43672 жыл бұрын

    Really valuable video! Videos about patterns, project architecture and so on are always fun to watch Nice festive hat btw, gives me some TF2 vibes :P

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Yes indeed 😂

  • @SpicyMelonYT
    @SpicyMelonYT2 жыл бұрын

    0:00 ""Merry Christmas" A simple spell but quite unbreakable

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Ever been wished merry Christmas so aggressively before?

  • @SpicyMelonYT

    @SpicyMelonYT

    2 жыл бұрын

    @@Tarodev First time for me lol! Merry Christmas to you to0 and thanks for the dope video!

  • @egekol11
    @egekol112 жыл бұрын

    If I had a wish for a new year, that would be a tutorial like this one. Thanks.

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    Now you can choose a new wish 😉

  • @SystemOfATool

    @SystemOfATool

    2 жыл бұрын

    @@Tarodev it would be awesome if you did a video on assemblies

  • @Tarodev

    @Tarodev

    2 жыл бұрын

    @@SystemOfATool Good idea. Also, awesome name

  • @SystemOfATool

    @SystemOfATool

    2 жыл бұрын

    @@Tarodev Thanks bro, i love your channel. Please continue making videos on advanced unity/c# stuff

  • @onekoff8480
    @onekoff8480 Жыл бұрын

    Nice video. Thanks! I believe you can actually use methods from ScriptableObjects in classes and MonoBehaviours. You just need a base ScriptableObject class with some abstract base method which will be overwritten by deriving ScriptableObject classes. That way, you can make modular systems like handling movement of units either by player control or UI, etc.

  • @un_holysix
    @un_holysix Жыл бұрын

    First of all, thank you, my friend! Second, for every one that is starting coding right now, or trying to, and don't know what to do, is like completly lost into what things to study and where to start, I humbly invite you to read about my short journey into software development world. Even if it's still short (about 2 years) I think this may help you. Time ago I tried to do unity games a couple times, and I did it till a certain point, then my code starts getting unreadable and I can never advance... Now I code rest api in java and live from this. There is an achitecture, of course. Every language has a lot of technics. Clean code, solid, ddd, clean architecture in general. And i didn't know this when I start coding. Even now, I'm not able to code something expandable without this. (Honestly, I think no one can) And that's something that we do not realise until we got experience and most times someone have to give you a little push and open your eyes. I was looking for something to start doing this right that time in unity. I just needed a little help, but I could not find this for free in the internet, until a couple weeks ago, with your video... And dude, works like a charm! That's exacly what I needed and I can assure all of you that THIS is the most important thing withing all languages. Even more important than code at all. Boy, no matter what you do, you need achitecture or you will get lost. Your code will break and you'r gonna have to call an alchemist, or even an exorcist to fix it for you. Of course it may vary within each language, but the *way of thinking* is the most important thing when talk about coding clean and architecture. And that is simply the best tutorial I found. For real! Generally i have to read a bit from some place, then a bit more from another and another, watch some videos and read huge books till i learn the content. But its all here, perfeclty separated for topics. I just felt compelled to set aside a little time and come here to thank you. Hope this can reach millions of people and you can keep spreading your knowloge out. I wanted to use youtube feature to give you a "Thanks", but its not available... You will get farther and farther, keep going, we jrs need you 😂❤ My best regards, Manolo Dias.