The 8 Game Code & Architecture Mistakes We ALL Make - Unity3D

Check out the Course: bit.ly/3i7lLtH
-------
Game architecture is hard and getting it right is nearly impossible. We all make a lot of mistakes.. and today I'm going to point out 8 of those game development mistakes, show how to avoid architecture pitfalls and push for a more SOLID implementation for your unity3d game. I'll show you how to keep clean code and clean architecture in this devlog.
More Info: unity3d.college
Join the Group: unity3d.group
Patreon: / unity3dcollege
Discord Link: / discord

Пікірлер: 269

  • @Coco-fw1in
    @Coco-fw1in4 жыл бұрын

    *Timecodes* 1. 0:40 .... Having Game Logic in UI 2. 3:45 .... Having giant classes 3. 6:40 .... Having everything be public 4. 9:10 .... Having setters with side effects 5. 14:25 .. Having giant prefabs 6. 17:05 .. Not using interfaces 7. 20:45 .. Ignoring Garbage Collection 8. 22:30 .. Sharing and Feedback

  • @leonardoraele

    @leonardoraele

    4 жыл бұрын

    Thank you.

  • @alec_almartson

    @alec_almartson

    4 жыл бұрын

    Thank you.

  • @quadtychgort6485

    @quadtychgort6485

    4 жыл бұрын

    Awesome, thanks.

  • @darsheelrathore3069

    @darsheelrathore3069

    4 жыл бұрын

    Really appreciate it mate

  • @chuk_udi

    @chuk_udi

    4 жыл бұрын

    not all heroes wear capes

  • @nah82201
    @nah822014 жыл бұрын

    Everyone: State machines.

  • @NewRook
    @NewRook4 жыл бұрын

    I would love to learn more about states in game coding.

  • @hare2693

    @hare2693

    4 жыл бұрын

    Where the state machine video?

  • @JasonMorelandDigitalrecline

    @JasonMorelandDigitalrecline

    4 жыл бұрын

    Me too

  • @ProdigiaGames

    @ProdigiaGames

    4 жыл бұрын

    Same here...I get the basic gist of it, but managing loading multiple scenes and everything is a shallow understanding at best and something I'm definitely going to need to solidify.

  • @akaiheartchainsaw

    @akaiheartchainsaw

    4 жыл бұрын

    Yeah would love one!

  • @xdjrunner

    @xdjrunner

    4 жыл бұрын

    @@ProdigiaGames state machines, basically a list of states. You then use these states to do, "whatever" according to a specific state. You can create them with many different variable types (array of name, array of bool, array of int, enumerators), as long as each state has their own individual representation (value) inside the variable.

  • @roelhoppenbrouwers8837
    @roelhoppenbrouwers88374 жыл бұрын

    Yes more state machine plzzz!

  • @AstralxAnima
    @AstralxAnima4 жыл бұрын

    I got a FEVER...and the only medicine, is more STATE MACHINE

  • @CodeGaff
    @CodeGaff4 жыл бұрын

    Interfaces are also especially useful in the early stages of game development when you don't know EXACTLY how a specific system will be implemented. You can fairly easily prototype multiple implementations in your code and then "swap" one out for the other to change which gets used in your game at runtime. The benefit of this is that you won't have to go through all your code and update the references (since they only reference the interface). This is essentially an example of the "Strategy Pattern". Great vid Jason!

  • @FullMe7alJacke7

    @FullMe7alJacke7

    4 жыл бұрын

    I recently discovered the Strategy Pattern and I must say it seems the most natural to me now. I was struggling with terrible spaghetti code before. I despise switch statements with a passion now because I was so prone to them in the beginning. A combination of the Strategy Pattern with SOLID principles and the observer pattern helped me get around that.

  • @CodeGaff

    @CodeGaff

    4 жыл бұрын

    @@FullMe7alJacke7 Glad to hear it! Writing well-architectured code is super satisfying, I'm sure you'll agree :D

  • @dukewendel

    @dukewendel

    Жыл бұрын

    ​@@CodeGaff interface support is atrocious in the Editor tough :( found my self repalcing a bunch of them with abstract base classes just to avoid the hastle.

  • @mattmurphy7030

    @mattmurphy7030

    Жыл бұрын

    Using too many interfaces too early is a great sign that you have no idea what you’re making and you think if you just abstract enough then the design will come to you without doing the hard work of designing it. Early abstraction is a sin not a pattern.

  • @paulwhiterabbit
    @paulwhiterabbit4 жыл бұрын

    I think I learned all that the hard way... One crucial thing I learned in software development is to always ensure your codebase is as testable as possible, you can split your codebase to multiple projects, game engine-dependent and pure classes, so you have more ways to test your game other than built-in game-engine tools and manual testing. Many say code structure is not that important for games that is known for performance but the small "quick and dirty" solutions pile up over time (technical-debt) and will bite you real hard. also if someone's interested, look into domain-driven design, no need to implement it, just learn why it is design that way, it made my life easier

  • @jadhajali2804
    @jadhajali28043 жыл бұрын

    "is this right? should I be exposing it? should this be public? does it make sense?" this can apply to so many things other than programming. I love this.

  • @allesster
    @allesster4 жыл бұрын

    need more state machine!!!

  • @cgfrog5
    @cgfrog54 жыл бұрын

    definitely more state machine please!

  • @DePistolero
    @DePistolero4 жыл бұрын

    Green light for state machine. I would love to learn more. Also more in-depth look into interfaces would be awesome, and unit testing...

  • @WeaselWeaselW

    @WeaselWeaselW

    3 жыл бұрын

    "Green light for state machine" I see what you did there

  • @devcaio
    @devcaio4 жыл бұрын

    Video about prefabs (variance and nesting) is a good idea. Thank you!

  • @JerryIsdale

    @JerryIsdale

    4 жыл бұрын

    Yes especially the new 2019 Prefabs which open up a whole new way to share assets (with all the good and bad that can happen)

  • @kadandreatta9190
    @kadandreatta91904 жыл бұрын

    Wow, thank you so much Jason. This is some of the more in-depth tips I've been looking for. Just having some input on best practices and simple explanations as to WHY. Wonderful video, thank you so very much for taking the time to share. :)

  • @akaiheartchainsaw
    @akaiheartchainsaw4 жыл бұрын

    Awesome channel, I'm really learning a lot from this. It can be really hard to find people to learn from who aren't also on a learning path. So this channel is one hell of a find.

  • @baroquedub
    @baroquedub4 жыл бұрын

    Initially did a bit of a doubletake, wondering why I was getting a notification of a video by some guy called Jason Weimann :) You are most definitely the brand so I'm cool with the name change! Great info, as always

  • @Sovreighn7

    @Sovreighn7

    4 жыл бұрын

    Yea I did the same thing because Ive always associated Jason @Unity3d.College but I agree it with the name change...Jason reminding us to refactor.

  • @vishalgupta5288
    @vishalgupta52882 жыл бұрын

    Your videos are always a treat to watch.... Have implemented your State Machine scripts in several games and they work like a charm... And I am specially in love with the simple GameEvent and GameEventListener script.... Those are real gems... With an addition of a Raise button on the GameEvent it makes testing so much easier... It'd be pretty cool if you could do a video on the new Prefab Variants and nested prefabs... I always find it little confusing on when/how to use them... Keep up the good work Jason...

  • @justinmonroe8683
    @justinmonroe86833 жыл бұрын

    Thank you for sharing your experiences, and knowledge. I started dev in Unity a couple of months ago, your content is really helpful in avoiding headaches. It's not my first attempt, though before I used GameMaker, which is okay, but not nearly as developed or asset friendly, especially advice on specific parts of game dev. I appreciate what your doing here, as an artist, and recent digital artist, these are very insightful tips. You sir have gained a sub. I would enjoy your take on state machine coding, as that is almost alien to me. I knew some C++, but C # seems to be the more robust language. As well I'm still learning good coding practices from pros such as yourself. I'm grasping the fundamentals, with a ways to go, but with content like yours, am sure you're helping a lot of potential game devs.

  • @arlolambdin8710
    @arlolambdin87104 жыл бұрын

    I am always interested in seeing more about implementing state machines.

  • @MuseumOfReality
    @MuseumOfReality4 жыл бұрын

    Thanks for another great video, Jason - really helpful! I'd love it if you did a video on Unity's new UIelements system.

  • @skippythemagnificent8103
    @skippythemagnificent81034 жыл бұрын

    An EASY GOING PROFESSIONAL - what a breath of fresh air. Great honest appraisal, you can always work out the people who really know there stuff, as they don't use the knowledge as a weapon. It was true in the early days of computing and is, as true, now.

  • @meaterbeater2781
    @meaterbeater27814 жыл бұрын

    Hi I’m new to unity and your channel and I find it really useful so thanks, keep it up 👍

  • @aoberthuer
    @aoberthuer4 жыл бұрын

    I also would like to see the video on game management state machines. Great video this one btw.

  • @crinklecutchipscringe9167
    @crinklecutchipscringe91673 жыл бұрын

    I started saving for your game dev course, hopefully I can get it some day in the future :D

  • @ram97tabla
    @ram97tabla4 жыл бұрын

    Would love a video on prefab variance, thanks for the offer!

  • @FenrirDragonheart
    @FenrirDragonheart3 жыл бұрын

    Thank you for this, i didnt even know which things i should whatch out for, as always a very clear and elocuent explanation, i appreciate the love and passion you put into this. we can tell Dinamic loading and prefab variants would be awesome!,

  • @ultimar-sensei
    @ultimar-sensei4 жыл бұрын

    Excellent video as always very informative. Waiting for the state machine video :D

  • @xXrandomryzeXx
    @xXrandomryzeXx2 жыл бұрын

    I always feel demotivated to code and make games, idk why. Somehow watching your video for 2 minutes motivated me to think of a game and get motivated to work on it. You are a magic man, I don't know how you do that, but I'm not complaining.

  • @wenpung1510
    @wenpung15104 жыл бұрын

    Really thanks for sharing these leading knowledge and reducing the walls where we usually bang. Appreciate it.

  • @neonsamurai
    @neonsamurai2 жыл бұрын

    Great info in the video! I want to suggest one missing 'mistake'. And this would be relying on inheritance and creating large inheritance hierarchies. These get quickly very brittle and you and up copying classes around just to change a few lines and you end up with huge chunks of duplicated code. Use composition instead of inheritance whenever you can.

  • @parthpandya008
    @parthpandya0084 жыл бұрын

    +1 for State machine to control a game love to see a different and more generic way than your previous video on state machine (it was great and helped me a lot)

  • @trinosan
    @trinosan4 жыл бұрын

    Great vid! I would personally be interested in a Unit Test lesson using a real game dev scenario, where the expected answers mostly depend on user input / other entities or functions don't really give a printable answer. All I can find are tutorials where they explain everything using a "MultiplyBy5()" function.

  • @Borgimanio

    @Borgimanio

    4 жыл бұрын

    You should look into Dependency Injection. You can pass a class which is responsible for user inputs for example into the class under test. In your unit test you could inject a custom test class which does fake user inputs for example.

  • @brianpurdy2966
    @brianpurdy29664 жыл бұрын

    Jason I'd love to see more on state machines. hope we get enough support to promote an updated video on on this.

  • @tonychristney2728
    @tonychristney27283 жыл бұрын

    Clean up as you go. Never have wiser words been spoken in a programming video.

  • @Adidaas
    @Adidaas4 жыл бұрын

    Some great tips man! Having giant classes I think is the easiest basic seemingly innocuous beginner mistake. I feel a lot of beginner Unity scripting tutorial needs to emphasize decoupling and separation of concern concepts. They're such important concepts that forums and Udemy course just kinda gloss over.

  • @andrewhoculik3462
    @andrewhoculik34624 жыл бұрын

    Thanks for describing Interfaces properly for everyone. Lately I've joined a few in-progress projects that use them incorrectly (i.e. they should be using a class with private/protected variables) and I find it very frustrating

  • @sk00sh
    @sk00sh4 жыл бұрын

    Your vids are super helpful!!! I really appreciate these.

  • @BarcelonaMove
    @BarcelonaMove3 жыл бұрын

    Would definely interested in a prefab variants video. Thanks mate.

  • @vygar5473
    @vygar54734 жыл бұрын

    I appreciate the mention of interfaces as I find them vital in cases where a component needs to reference and communicate with another component in the scene (rather than using a concrete class reference). I'd also be very interested in your thoughts on state machines. I've written a few implementations of them in the past and would find a different perspective very insightful.

  • @abrampainter3764

    @abrampainter3764

    4 жыл бұрын

    I should probably use interfaces to get more flexible camera target behavior. I hate having to use a "find player" method or having to reference a transform in the scene controlled by a public field in a component exposed on the prefab. It should be more like the camera has an "I take targets" interface and players, enemies, and other agents have an "ITarget" interface. However, I then have to write behavior which binds the camera to the target I want to use in the scene, but this shouldn't be too hard, and it beats inserting a scriptable object that includes the players last known transform.position into the camera follow script using an exposed public field. ScriptableObjects are super easy to use but they can make things very messy if you use too many of them, especially in the wrong context.

  • @JocelynDaPrato
    @JocelynDaPrato4 жыл бұрын

    Yes Jason I'd like to know more or see more example of statemachine for player control and for game states.

  • @android272
    @android2724 жыл бұрын

    16:13 this also sounds awesome. I have not used prefabs all that much but this sounds like something I will be doing in the future.

  • @pedrodish
    @pedrodish2 жыл бұрын

    Thought this video would be more about specific about game dev, but it's all about good programming practices :) makes sence

  • @kserra9112
    @kserra91124 жыл бұрын

    This was a fun video. I wanted to contribute my point of view so I can stop thinking about it and get back to work. Really glad Jason made a video on this, because it helps me highlight important things to keep doing within my own projects, so I thought I'd dump some reading below: 1. @0:40 .... Having Game Logic in UI Things just work when keeping classes small, there is this moment where the code just comes together and works so elegantly, its a nice feeling that often comes with keeping classes small. Or in other words, maintaining the Single-Responsibility Principle as part of the SOLID principles. 2. @3:45 .... Having giant classes Ultimately I wouldn't have the Vehicle class implement its own potentials. It would just be a holder/implementer of other potentials that Vehicle know how to use. This way we're still able to obfuscate the unimportant 'inner workings'(which is good) while maintaining the readability of what these potentials are trying to do. It also makes things like 'order of operations' very easy to read and change since Vehicle can call upon its potentials in the order that makes sense to it as method calls. 3. @6:40 .... Having everything be public Yeah so, I don't make anything public unless making whatever public is part of using that class in general such as a ScriptableObject. I'll always differ to creating a GetMethod that returns my data, and if these GetMethods become unruly I would sometimes wrap the data request with a struct in order to decimate large data calls to single requests. Or, I'll use an interface to expose the data I need since these have to be public, may as well have some readability (and some nifty GetComponent possibilities) to go along with my public data needs! 4. @9:10 .... Having setters with side effects get and set, I tend to use set to limit a value then create a new value or just have some sort of conditional contingency if the data is sensitive to mutation get is a good opportunity to implement other strategies of data propagation like grabbing a value from a database, or doing some complex math to return back a value. As such, these gets methods would usually be in a class who's job is to define a data-set that then gets implemented by an object to handle its data. But honestly I don't really use get or set as I love to practice Immutability for all of my data by propagating my values through the composition of objects rather than reading and writing values. I don't know if this is weird, but I think this is one of the funnest parts of coding :P 5. @14:25 .. Having giant prefabs This is exactly what I'm working on right now where I have an Attribute system where a base component 'Player' holds onto various other gameobjects such as 'equipment, statsheet, abilities', which then hold onto other gameobjects 'equipment> weaponSlot, armourSlot etc' that then hold onto other gameobjects 'weaponSlot> weapon' and again 'weapon > mods'. It made me think, did I just make a giant prefab? But no, ultimately, this prefab of player has slots that then propagate additional prefabs which then again grabs a smaller prefab. Larger prefabs do some work, then differ to smaller prefab, which does work then defers to yet another smaller prefab and etc. The ability to change the functions of the core prefab means you just slot in something else. When swapping out base data from a prefab in order to change enemy01 to enemy07, one really cool way is to just use a ScriptableObject that holds all base values along with images and any other Unity-based variable that fits within the limitations of Scriptable Objects. Scriptable Objects are so easy to serialize as well if you want to store them within a simplified data structure on a database. This method gives the benefit of being able to sort ScriptableObjects by querying data on those objects. It helps to know stuff like what enemy has the highest base attack? Sort through a dictionary of simple values that point to a scriptable enemy, then grab that one and use this within the respective battle. 6. @17:05 .. Not using interfaces Firstly, from a website MVC point of view, Interfaces are great ways to simplify complex data needs to a very literal question of "I need this data to do my work, I don't care how you do it or who you are, just give me what I need". So with game applications, any UI component should receive some sort of interface as a resource before it updates its information - this is a nice readable way for a gameobject to source predictable info to a component of UI that it doesn't know anything about nor does it care. 7. @20:45 .. Ignoring Garbage Collection GC its a tricky one where there are beginner related issues and professional related stuff as well. For a beginner these issues show up as null errors where you expect information to exist, but GC has already gotten rid of it. This was and still is a growing pain for me because of how collections work and how complex game calculations can be. Then when it comes to professional use, thankfully Unity has improved the tracking of data within their Profiler tools because even pros can have memory leaking issues. 8. @22:30 .. Sharing and Feedback See the wall of text above, yay! Also, thanks for the TimeStamps, Coco Nut. I think its crazy so many people are asking about state machines when it was briefly mentioned in the video. This is awesome, I often preached that all a video game is, is a data layer paired with a state machine. So good on all of you for requesting this as a video, I bet Jason will do a great job on this - spoiler alert, maybe start looking up how to use 'event' and 'Action' ya know. :D

  • @konstantinliapunov9594
    @konstantinliapunov95944 жыл бұрын

    Hey, Jason! Thanks for your great video. I would like to see a new video about state machines to control game state :) Also, I would like to watch video about prefab variants.

  • @okito
    @okito4 жыл бұрын

    Thank you for all your work

  • @BlueGuitarMusic
    @BlueGuitarMusic3 жыл бұрын

    love to hear more about prefab variants

  • @mechanicallydev4536
    @mechanicallydev45364 жыл бұрын

    I would love to see a video about state machines, how to tie states to animation events, and best practices.

  • @quinnjackson1113
    @quinnjackson11134 жыл бұрын

    Yes I want to see more videos of all those things.

  • @undertalebob3207
    @undertalebob32072 жыл бұрын

    I love your videos. Thank you for all the help

  • @clipartinc
    @clipartinc4 жыл бұрын

    A video on prefab variance would be great!

  • @johnleorid
    @johnleorid4 жыл бұрын

    Please make a video about prefab variance. I think this topic is very important for a good workflow.

  • @mykilpee
    @mykilpee4 жыл бұрын

    Prefab variance sounds fun! I'm guilty of some of these, but prefab variance might help me for prevention.

  • @rhythm421
    @rhythm4214 жыл бұрын

    Would love to see a video about more complex uses of state machines, ie concurrent and nested

  • @ikonfokkah
    @ikonfokkah4 жыл бұрын

    Yes, need video on fsm and not just small example code, but realworld examples. Like Character controller for a beatem up style and how to make them managable

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

    I love the Logic/Simulation/Presentation architecture. There's a Unite talk about that.

  • @francoisneko
    @francoisneko4 жыл бұрын

    Hi, i would really like to watch your video about states machine. I am learning to code with playmaker wich is a state machine. But I struggle to know how to structure game logic, and organise code. I love your videos so far as it get into the general design of code. Would really appreciate a state machine approche of code. Thank you for sharing your knowledge!

  • @android272
    @android2724 жыл бұрын

    3:30 this sounds awesome. Would you please make an update to your state machine logic?

  • @chrisfritz7545
    @chrisfritz75454 жыл бұрын

    State Machine Video, Yes please! You are awesome!

  • @lvx969
    @lvx9694 жыл бұрын

    I would love a video about a game state style manager in Unity. It's something I've been struggling with a lot.

  • @T0mT4yl0r
    @T0mT4yl0r3 жыл бұрын

    Very good tips

  • @sinistermephisto65
    @sinistermephisto654 жыл бұрын

    This is soo funny. I just wrote a state machine to control my code last night. My 1k line GameState class became super modular after that. I don't know if you are releasing this video tomorrow cos I need to verify my method. UI is a plus

  • @SunnyValleyStudio
    @SunnyValleyStudio4 жыл бұрын

    Hi Jason. Great video. I did many of the mistakes you mention. Recently I came across a book by Martin Fowler called Refactoring. Now I am no software architect but I am starting to see that its hard to design the games code structure early on. The best way seems to be to constantly look at the code and refactor it when you add new functionality and something you reuse looks off. At the same time the more solutions you know - like the ones you mention in this video, the easier it is for a programmer to apply them early on. Would you say it is a valid approach according to your experience? Thanks!

  • @shanilwijesinghe5201
    @shanilwijesinghe52014 жыл бұрын

    It's been so hard to find a good state machine tutorial. They're always in the context of animation and AI. I would kill to have one about game control.

  • @FullMe7alJacke7
    @FullMe7alJacke74 жыл бұрын

    I would like to see more unity specific polymorphism. I often run into situations where I'm tempted to use a switch statement or something similar; example. My last project has a single switch statement in the scriptable object on my character's to determine if it's a Rogue, Warrior, or Wizard and then makes new scripts based on an Enum in the ScriptableObject. I recently managed to solve my problem with a combination of more abstraction, addition factories, interfaces, generics and events. But I feel like a more in-depth on using these things cohesively with one another and how to avoid the switch statement anti-pattern specifically would benefit a lot of people. a DOTS series would be amazing too! .... oh and in depth Unity ML Agents!

  • @algebrawithin
    @algebrawithin4 жыл бұрын

    Super useful!!!

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

    great video! I'm new to Unity and have a noob question: What's good practice to organize related assest, prefabs, sounds etc? Should I maka e empty GameObject in the hierarchy and drop everything in there? Or should I stuff it in a folder in the Project window? Cheers!

  • @Notion615
    @Notion6154 жыл бұрын

    i would be very much interested in videos about implementing state machines && using prefab variants.

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

    Good points, but on the interface, didn’t sound like a case for interfaces rather a case against bad abstraction that needs to be overriden a lot

  • @JohnVanderbeck
    @JohnVanderbeck3 жыл бұрын

    Not sure how much I can agree with #4.. I mean that's the whole point of setters/getters in my mind. If all you are doing is making a setter just set the value then there isn't much point having the setter in the first place.

  • @SunSailor

    @SunSailor

    3 жыл бұрын

    I think both is right - Jason is right so far, that there shouldn't be too complex behavior in a setter, beside data management and regarding specific data management, I go totally with you, John. A setter is there to trigger data management to prevent that specific steps are missed, like replication, notifications or persistance. Doing stuff like triggering an animation, complex processing or modifying multiple referenced objects within the setter are a no go and belong into properly named methods. So, at least the examples where not choosen thoroughly, as they mix both spheres.

  • @Kenbomp

    @Kenbomp

    2 жыл бұрын

    Yep keep it simple.

  • @magnusm4
    @magnusm43 жыл бұрын

    I have only found a few videos and Unity's site on state machines and would like more on it. As there's many ways to do it and structure it.

  • @yuuisland
    @yuuisland4 жыл бұрын

    great advice

  • @TheGuyWithTheLemon
    @TheGuyWithTheLemon4 жыл бұрын

    Please do more state machine videos!

  • @michaelplaczek9385
    @michaelplaczek93853 жыл бұрын

    For making worlds, do you want to use an external tool for the whole thing? Or make objects (like a chair, table, etc), and then make the map in Unity?

  • @Thomason1005
    @Thomason10054 жыл бұрын

    good and sound advice. about the interfaces though, is there a deeper explanation on this? i do not fully understand how i can call the same thing ("Itakedamage") on 2 different classes if they do not inherit from the same base class?

  • @Thomason1005

    @Thomason1005

    4 жыл бұрын

    i mean, if the player and crate are based on the same base class and override a shared virtual function, that works. but if they both independently declare a function with the same name, i dont understand how the compiler would allow that.

  • @ravanin
    @ravanin4 жыл бұрын

    More state machines please!!!

  • @Sovreighn7
    @Sovreighn74 жыл бұрын

    You mentioned #5 being Giant Prefabs and breaking them down into variants ect ect… Ever used Synty Studios Modular Characters? They throw all the models into one prefab for male/female/and universal. I was actually curious if that was a good way of doing things but after playing with them for my RPG project I ran into strange issues. So far I took that base prefab and made variants of it for both male and female characters...basically just disabling the parts. State machines would be great or give me a modular inventory system to work with.

  • @MrDingaling007
    @MrDingaling0074 жыл бұрын

    Yes please about the state machines. Also how to use state machines in an RTS style game - eg. send a unit off to chop a tree, and the unit will chop the tree, collect the firewood and return it to a building.

  • @estebansalceek2819
    @estebansalceek28194 жыл бұрын

    I'm in for your tips on state machines for game managers.

  • @Gildar76
    @Gildar764 жыл бұрын

    I'm not a professional game developer, but some of this applies to development in general. You should usually follow this whenever you write code. Decoupling, encasulation, not building huge monolyth classes and so on. I'm guilty of having additional stuff in my setters though. Like a property changes a value and triggers change event. I guess this is hiding complexity in a way, but I've not found a better way to do it. For example. A health property or set method that triggers an event that other things can listen to. If someone else does to much in the event handler, it's the event handler's fault, not the thing triggering the event. That's my point of view, but if you think I should start doing it some other way, please let me know. It's very convenient for UI updates for example.

  • @ChetSimpson
    @ChetSimpson2 жыл бұрын

    Good video but I would suggest clarifying the behavior of a separate "setter" function instead of using a property set. Creating a "setter" function does nothing to actually alleviate the original problem you are attempting to avoid - behavior obfuscation. If I'm calling a SetDamage() function I expect it to validate the input and set the value, nothing more. I would suggest a "mutator" function that better expresses the semantics of the function. In this case something like TakeDamage() or ProcessDamage() (or even OnDamage() I guess) would be much better. The only other thing I would suggest is that people get familiar with the basics of the core principles and good practices of both OO design and OO development. Even having a rudimentary knowledge of these topics can help reduce the amount of problems like this that are introduced into code. You may not understand them at first but over time their purpose and application become a lot clearer. Totally diggin the cactus though!

  • @idlenotgamedev4771
    @idlenotgamedev47714 жыл бұрын

    State Machine for Game Control. Should I have menu states for states before and after the actual gameplay? I'd appreciate vlog on it :)

  • @orlovskyconsultinggbr2849
    @orlovskyconsultinggbr28494 жыл бұрын

    Jason telling all like it is, i found quite funny that on official unity site there some courses which teach to expose public fields trough UI, but well its just more work to deal with states only trough code.

  • @StephenWebb1980
    @StephenWebb19803 жыл бұрын

    I'd love to see a video on state machines.

  • @chrisslampenmann7455
    @chrisslampenmann74554 жыл бұрын

    Yes, Yes, more about state machine plzzz! XD

  • @kanewadel
    @kanewadel2 жыл бұрын

    How work a manager please and how to structure our code when we want to implement a module like metrics module ?

  • @GreenTea-Pose
    @GreenTea-Pose4 жыл бұрын

    state machine tutorial would be a godsend

  • @randomrabbitstudio8368
    @randomrabbitstudio83683 жыл бұрын

    Did you ever do a state machine video to control the gameplay?

  • @clipartinc
    @clipartinc4 жыл бұрын

    Also how would you break a prefab apart based on collision? So when a section of a prefab gets hit it would take damage only on that section of the prefab.

  • @jackoberto01
    @jackoberto012 жыл бұрын

    I would say properties could also do validation like clamping a value if it's out of the valid range

  • @florinpricopie9112
    @florinpricopie91124 жыл бұрын

    What do you think about new way of coding , unity DOTS ? It's going to be a standard ?

  • @alfaaz7146
    @alfaaz71463 жыл бұрын

    For The Last tip I have a Question: Can I post my Code on Unity Forum to get other's opinion? Or is it prohibited on forum?

  • @naaffax6700
    @naaffax67004 жыл бұрын

    Can you please make a tutorial on how to load fbx model files and fbx animations separately and make characters animate through coding during gameplay so that only the needed animations are loaded depending on the user interactions.

  • @SteveTheExploiter
    @SteveTheExploiter4 жыл бұрын

    I would like an example of choosing an interface over a subclass. I use interfaces in UI for inventories, but I use sub classes for my take damage. Maybe I'm doing it wrong?

  • @AmfistomosAtlas
    @AmfistomosAtlas3 жыл бұрын

    +1 for the TuPac Shakur Legacy Book

  • @vitormaluco
    @vitormaluco4 жыл бұрын

    "If you are interested in...." Yes. I am, gimme. For real, I am curious how a pro would do all these things. So i can compare with the way i do and see what i can improve.

  • @kutanarcanakgul5533
    @kutanarcanakgul55334 жыл бұрын

    Can you make a video about unity Extensions? How can we use them in a best way? (Suggestions: DoTween, UniRx, Easy Save 3 etc...)

  • @wokarol

    @wokarol

    4 жыл бұрын

    That's awesome idea, tutorials about generic usage assets will help a lot. DOTween is one of the best tools for adding "live" to the project

  • @JohnSmith-ox3gy
    @JohnSmith-ox3gy4 жыл бұрын

    It's november and I am craving for statemachines.

  • @eduoki8498
    @eduoki84984 жыл бұрын

    thanks alot

  • @beardordie5308
    @beardordie53084 жыл бұрын

    +1 state Machine. For anyone wanting to play with them, check out the free asset Surge, made by the guy who made iTween, PixelPlacement. It has tweening and state machines.

  • @tutukun
    @tutukun4 жыл бұрын

    I would love to learn more about state machine in Unity

  • @soyfandev4925
    @soyfandev49254 жыл бұрын

    more please