LEVEL UP your code with this AWESOME FREE project! (and e-book)

Поділитися
Вставка
  • Опубліковано 24 лис 2024

КОМЕНТАРІ • 50

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  Місяць тому +7

    🌍 Design Patterns e-book cmonkey.co/designpatternsebook
    🎮 FREE Interactive Project cmonkey.co/designpatternsproject
    ✅ Get my C# Complete Course! cmonkey.co/csharpcourse
    🔴 RELATED VIDEOS 🔴
    Learn C# Intermediate FREE Tutorial Course! [2024] ua-cam.com/video/I6kx-_KXNz4/v-deo.html
    How to Talk to NPCs! (or Interact with any Object, Open Doors, Push Buttons, Unity Tutorial) ua-cam.com/video/LdoImzaY6M4/v-deo.html
    Why you should NOT make everything PUBLIC! ua-cam.com/video/pD27YuJG3L8/v-deo.html
    "I'm not perfect" OR "many solutions to a problem" ua-cam.com/video/gh9ISSLQSUc/v-deo.html

    • @rumplstiltztinkerstein
      @rumplstiltztinkerstein Місяць тому

      I'm a programmer for Rust and Javascript. Don't have much experience on game development either. This is a godsend for me.

  • @PotatoManager420
    @PotatoManager420 Місяць тому +5

    Finally! Some asset from Unity that helps begginers to boost their C# skills

  • @JohnVanderbeck
    @JohnVanderbeck Місяць тому +14

    Glad to see the highlight here!
    Unity has actually been producing a ton of great resources like this that have mostly gone under the radar. This is probably by far the best one though.

  • @MOONtyzoo
    @MOONtyzoo Місяць тому +19

    Coincidentally I just started reading Clean Code, but I had trouble thinking of specific examples of how to apply what I’ve learned n game development.
    I think this E-book and project is exactly what I needed! Thank you for sharing this resource.

    • @sealsharp
      @sealsharp Місяць тому +10

      Just a warning. Clean Code was written in the 2000s for enterprise applications which dozens, sometimes hundreds of people worked on.
      1) Unity (and other engines) heavily uses the composite pattern, so some of the advice for general OOP will become an antipattern in that a game engine scenario.
      2) the heavy emphasis on abstraction is a waste of time if you do not have parallel teams working on replacing and changing huge parts of the system and also, Unity has a different coupling through it's components+gameobjects-architecture.
      3) There's a lot of advice in that book that is basically "feelings and preferences" and how clean the result is, that is debatable. Like splitting stuff into many little methods which reduces the complexity of the individual method but increases the complexity of the whole system by reduced locality of behavior.
      I'd still recommend to read it, but not as gospel. Try to understand where stuff comes from and you get a better feeling which parts you can apply and which parts you can transform to apply for cases that do not exactly match the scenario they were made for.

    • @reessoft9416
      @reessoft9416 Місяць тому

      @@sealsharp i said a similar thing in a comment a while back, so i certainly agree with you.
      I've been using design patterns since i first started using java about 20 years ago.
      I just find them to be a pain, especially as part of a small team, just obfuscating things with layers of abstraction.
      Games are all about real time performance, and as you say, the unity architecture is based on scripting and game objects, so isn't well suited to design patterns, anyway.
      Unity uses the observer pattern behind the scenes for the event model, and singletons can be useful for an audio manager, or a game manager class.
      Beyond those sorts of things I just think design patterns add complexity, and can affect performance, if not implemented correctly.
      I think it's more important for people to get their heads around the way unity works, and its single threaded nature.
      On forums, for example, I often see people telling others to use multi threading, instead of coroutines - just a lot of bad advice from people who are not understanding the basics of the way unity has been written.

  • @mattrobb3566
    @mattrobb3566 Місяць тому +3

    Thanks that ebook is excellent as you say. Very useful indeed and should help get me out of some of my current poor design practices. So helpful!

  • @royalPourceau
    @royalPourceau Місяць тому +4

    Very, very cool stuff here ! The code technical debt is very concerning and slows down a project velocity very quicky

    • @dbweb.creative
      @dbweb.creative Місяць тому +1

      It's not that a technical debt slows down a project... it's that many devs just slap things together without a proper architecture. You SHOULD think of proper architecture, as well as, of the good performance practices from the start. If you don't - chances are, later on it'll be too late, because the good architecture can look and behave completely different. Educate yourself, know how stuff works under the hood, expand default functionality with things that make your life easier (like C# delegate event wrapper classes, they can even be dictionary mapped. Also just today I added a class that invokes event on trigger enter/exit, just so I can listen to collider triggers on another GameObject. Simple things, but help a ton)

  • @MrOmega-cz9yo
    @MrOmega-cz9yo Місяць тому +1

    I need to find the time to check this out. 🤪

  • @carndacier
    @carndacier Місяць тому +1

    That's an impressive combo. I like to think they took inspiration on your idea to build an in-editor guide / tutorial ;)

  • @AaronAsherRandall
    @AaronAsherRandall Місяць тому +3

    I HAVE BEEN WAITING FOR THIS OMG!!!

  • @Deymser
    @Deymser Місяць тому +1

    Thanks for showing this! I was actually learning about SOLID and all Patterns but this makes it much more easy and fun to learn!

  • @suicune2001
    @suicune2001 Місяць тому +1

    Oooooo, this looks amazing! Thanks!

  • @AndersHPhotography
    @AndersHPhotography Місяць тому +1

    For unity/C# Code Monkey is very top tier, no doubt !!

    • @hldfgjsjbd
      @hldfgjsjbd 19 днів тому

      I wish code in tutorials was more in-depth and future proof. They helped a lot, but later I discovered that it can be done much better. Too bad this information came from another place, like git-amend channel

  • @Veles017
    @Veles017 Місяць тому +1

    It is very cool! Thank you for the information!

  • @MarushiaDark316
    @MarushiaDark316 Місяць тому +9

    The way I always think about Liskov Substitution is that "all dogs are animals, but not all animals are dogs." Meaning a base class can't necessarily be substituted for a child class, but a child can be substituted for a base class. So when designing behaviours, it's important to decide whether they belong on "dog" or on "animal" if they're something that everyone will share or not, and then when you call the class, is your behaviour on the base class or the child?
    There's also another principle that says, "Code the rule, script the exception." In other words, hard code things that are certain and deal with anomalies as they show up. So all birds fly ... except ostriches and penguins. All mammals birth live young instead of laying eggs ... except for platypus. So a bird class with Fly and a mammal class with Birth Young still makes sense even though it's not absolute as it will handle 99% of cases.

  • @The123Adrian
    @The123Adrian Місяць тому

    Very cool stuf i add this to my queue "thinks to make"

  • @themirlabs
    @themirlabs Місяць тому

    dude this looks really useful. thank you

  • @adarshmaurya7553
    @adarshmaurya7553 Місяць тому

    Really helpful video, thank you for this.

  • @ExpensivePizza
    @ExpensivePizza Місяць тому

    This is excellent.

  • @cpalta4500
    @cpalta4500 Місяць тому

    Awesome!

  • @creativekev5215
    @creativekev5215 Місяць тому

    I just started watching your Kitchen Chaos tutorial, is there any more tutorial like this in the asset store?

  • @dbweb.creative
    @dbweb.creative Місяць тому

    Let's say I have a lot of different animal NPCs roaming around the map (hundreds total). Do you think there would be a significant performance increase if I segment them in some way like with a dirty pattern or something alike?
    In my scenario most animals have a collider, but most of their function is either being there for aesthetics or a physical obstacle, and they roam around.

    • @JJSmalls
      @JJSmalls Місяць тому +1

      I think your scenario is fine without a dirty flag, but it will make sense to turn off the colliders if the player is far away.
      Dirty flag is probably for something that's O(N^2) or higher time complexity that doesn't need to run every frame. I could be wrong.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Місяць тому +1

      Yup you should definitely avoid updating NPCs that are super far away, you can indeed test the distance and mark them as dirty if past a certain distance and if they are dirty hide visuals/colliders/logic. Then if the distance is under that threshold set it dirty again and make it all visible/enabled.

  • @deadspace4755
    @deadspace4755 27 днів тому

    When or what level of experience do you recommend someone to start reading this?
    Like someone who read and practiced every video of yours(Beginner to Advanced)for one example?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  26 днів тому

      Around late beginner-intermediate level. If you're an absolute beginner then focus just on the basics like what is a variable what is a function. But if you're past that then yes you should start to learn more about how to write high quality code and not just something that works.

    • @deadspace4755
      @deadspace4755 26 днів тому

      @CodeMonkeyUnity I have computer science degree, but l do not have faith in me. I feel rusty even if l understand programming well and when l go to practice, I freeze. That was back then. Now? l am not sure

  • @elearnplay8714
    @elearnplay8714 Місяць тому

    👍

  • @jeanlsm3227
    @jeanlsm3227 Місяць тому

    given what can be learned in the project, what level of a Unity Developer a person can achieve?

  • @TheThursty100
    @TheThursty100 Місяць тому +1

    you can do MVVM in Unity!? What

  • @robertvalentic4939
    @robertvalentic4939 Місяць тому

    Is there something like this for DOTS? Entities, Bakers, Systems etc..

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Місяць тому +1

      Not that I know of but that would be awesome!

  • @SunSailor
    @SunSailor Місяць тому +21

    It physically hurts, that Unity makes a book public with singletons without a service locator or dependency injection as good practice.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Місяць тому +6

      Those would be great topics to add to a future update! They've updated this e-book once so they might do it again in the future

    • @sisus_co
      @sisus_co Місяць тому +3

      Yeah, the only interesting DI pattern they used was this bit in the Dependency Inversion Principle sample:
      // Unity's serialization system does not directly support interfaces. Work around this limitation
      // by using a serialized reference to a MonoBehaviour that implements ISwitchable.
      [SerializeField] private MonoBehaviour m_ClientBehaviour;
      private ISwitchable m_Client => m_ClientBehaviour as ISwitchable;
      Pretty underwhelming, given the importance of the pattern when it comes to the SOLID principles... but also understandable, given that it is a complicated topic in and of itself (with Unity in particular).

  • @keahunuitechnologies
    @keahunuitechnologies Місяць тому

    2nd last

  • @michaeldiaz4285
    @michaeldiaz4285 Місяць тому

    Is interfaces just a C language thing? I use them in c++

    • @aibou2399
      @aibou2399 Місяць тому +4

      It's a common feature in many language. C++ has no interfaces tho, only abstracts

    • @JJSmalls
      @JJSmalls Місяць тому

      Popular in Java / Spring as well

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Місяць тому +1

      Many languages have something similar to interfaces, it's an extremely useful concept

  • @Loved--
    @Loved-- Місяць тому

    I got about 30 errors on import

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Місяць тому +1

      How so? This is a complete project, did you import it into an existing project? What errors? Maybe you opened it in an old Unity version?

    • @Loved--
      @Loved-- Місяць тому

      @@CodeMonkeyUnity Yes, I realised I had to use unity 6, the errors are gone now. Thank you

  • @devangganbote4334
    @devangganbote4334 Місяць тому

    Last

  • @MahadAsif-g7r
    @MahadAsif-g7r Місяць тому +1

    first