Build Highly Scalable GODOT Games in Under 10 Minutes!

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

КОМЕНТАРІ • 57

  • @Erbmon
    @Erbmon 2 роки тому +88

    I love your tutorial style, I whould really love to hear your insghts into signals, inheritance, etc... Godot is modular by design but it's rare to find tutorials that focus on the "glue" instead of the pieces, and I will argue that it's the most important thing to grasp at the start.

  • @thehiddenplace
    @thehiddenplace 2 роки тому +25

    This title scheme reminds me of a book I once owned 'Learn C++ in 24 hours.' Took me months to work through, huh...

  • @fortpile
    @fortpile 4 місяці тому +1

    This is one of the most helpful videos on godot I've ever seen yet, probably even beyond Godot, and the fact that it's less than 10 minutes makes it even better. Thank yoU!

  • @luislodosm
    @luislodosm 2 роки тому +28

    I find the hierarchical system difficult to modify if you want to work on different components of an object at the same time. It is also much more difficult to reuse in other projects. I prefer to use a hierarchical modular system, for example:
    modules/
    characters/
    player/
    enemies/
    npcs/
    shared/
    This way, if you want to take the player to another project, you only have to take the player and shared folder.

  • @computer9764
    @computer9764 2 роки тому +16

    If you're emphasizing a scalable approach, it would be a good idea to show a large project.
    I would argue that feature folders are always more scalable than trying to fit everything into assets/scripts/etc. It's easier to think about things grouped together and easier to see when too much is shared in a project. Spaghetti between sub-features isn't as big of a deal as an out-of-control project.

    • @sosasees
      @sosasees 2 роки тому +4

      yes. one of my first Godot projects used the assets/scripts/scenes structure, and it became really confusing really fast. i never want to touch that project ever again.
      now i use only the feature-based structure.

    • @saulmaldonado4607
      @saulmaldonado4607 Рік тому +1

      Yes, from my android app experience it's better to have modules

  • @ygypt
    @ygypt Рік тому +61

    theres a 3rd option that works well with a large team:
    assets/ for binaries like sprites, models, which is hierarchal
    src/ for text (scenes, scripts, etc) which is modular
    this allows the programmers to worry about sorting their files in an object oriented way, and the artists can just dump all their foliage textures in assets/textures/foliage (never go more than 3 folders deep)

  • @panampace
    @panampace Рік тому +3

    I too like to keep my assets within the same folder as their object's scene and scripts. But most tutorials recommend them in a top-level "asset" folder. Glad to know I wasn't doing it "wrong".

  • @javierangelelli1915
    @javierangelelli1915 2 роки тому +6

    This video was the kick i needed to take a breath and reorganize all my code.

  • @veto_5762
    @veto_5762 Рік тому +10

    Hierarchical structure can be useful if you're working with a decently large dev team, so artist only mess with the assets folder, developers with scenes and scripts, musicians/sound designers with sound and so on and so for.
    But for a solo dev doing small projects modular is the way to go in my opinion, it depends on what allows you to organize better what you're working on easily

  • @liamhamilton2719
    @liamhamilton2719 2 роки тому +10

    This is a topic that i don't see enough of, im currently making a complex management game and the hardest part is definitely organisation. Would love to see a video on how to keep scripts organised too!

  • @TheKrensada
    @TheKrensada 11 місяців тому +1

    It is worth mentioning that you don't have to type out the folder in the script window. You can just drag the item from the file system window into the script window. You know...for all those people out there who value their time, and aren't masochists.

  • @Visionsofmortality
    @Visionsofmortality 2 роки тому +13

    Hey Andrew hello again! I think the voice audio in this video is still a bit low but much better than before, you definitely improved that. Useful tips, waiting for more Godot videos!

  • @mapopi-mm
    @mapopi-mm 2 роки тому +2

    Great subject, this kind of care upfront saves a lot of time later on. Thank you for the tutorial, really helpful

  • @geckopeak4033
    @geckopeak4033 2 роки тому +1

    Thanks :). Just started learning how to make games

  • @natecoley160
    @natecoley160 2 роки тому +4

    i think where is also better way - grouping by components, for example.
    player has criteria to be a player, he has input controller, movement behavior, and firing behavior, movenent and firing| has a lot of creatures and could be shared, npcs could have different input (ai input instead of user input), and could only walk, enemy could have enemy ai input, and could walk and fire, so it look really modular,
    also you might group files in "bundles" a set of external plug and play asssets, like bundle for fps, bundle for rpg and so on which could contain solid, tested, modules to warm up development

  • @idle.observer
    @idle.observer Рік тому

    Great video! I have a clear perspective now.

  • @dnbroo
    @dnbroo Рік тому +1

    well made! I have used the second method for a project before, but never really considered the modular method. Just starting a new game and I think ill give the modular method a shot as that seems easier to understand for solo dev. piecing and parting out later on or even testing in new projects sound much easier this way

  • @AudioBoi1
    @AudioBoi1 Рік тому

    Great stuff. I like the second way of organising more 😊

  • @LocherYT
    @LocherYT 5 місяців тому

    i like keeping my scenes and their scripts together while every asset (such as style, textures, sprites, sfx) in the separate asset folder.
    if my character uses components (like walking, talking, interactive, combat), i have a separate components folder. Many different actors can make use of several components that are shared.
    assets/
    custom_ressource
    style
    images
    audio
    content/
    actors
    components
    stages
    systems
    I'll be using this structure until it no longer works but so far it's all cool (especially in cases where many actors share common resources).
    And in case of inheritance, i also keep children together with their parent and make it apparent with a proper naming system

  • @geshtu1760
    @geshtu1760 Рік тому +4

    I keep assets separate like this but I put scripts and scenes together. These always seem to be 1:1 so I'm not sure what benefit there is in having scripts in an entirely separate folder hierarchy. Surely it would be tedious creating a duplicate hierarchy for scripts when Godot defaults to putting them in the same directory. This also helps when reattaching a script to a scene.

    • @el_primer_y_el_ultimo_caiman
      @el_primer_y_el_ultimo_caiman Рік тому +1

      Yeah, there's no need to be so rigid. I like having a core folder for mechanics (base classes, custom resource structures, etc), an assets folder for reusable stuff (skill scripts extending the base one in core, entity scenes, maps...), and a content folder for one-off stuff which bring everything together (missions, dialogue, etc.) aka the actual game

    • @veto_5762
      @veto_5762 Рік тому +1

      If you have scripts used by several scenes could be good having a shared folder for them, but yeah for scripts that are only for a single scene like player movement i think is better just let them together with their respective scenes

  • @bodamat
    @bodamat 2 роки тому

    I'm impressed! I really don't mind how I structure my project, but it every time feels messy. Thank you so much for your suggestions

  • @manofqwerty
    @manofqwerty 11 місяців тому

    In my opinion, stick with the modular structure, if you have an NPC and a Player that both use the same assets or other resource, create an actors folder have shared resources in there and then have modular folders for player and NPC that contain only the things that they need. Another alternative is to just duplicate the assets/resources so you have a 1:1 relationship between module and asset. To some, this seems bad but it does allow you to easily update in the future if you decide to change one of the assets for one of the modules. Duplication is not always the enemy and is often not truly duplication.

  • @AdimasDuvitra
    @AdimasDuvitra 2 роки тому

    I love this! Thanks a lot

  • @-yahya--
    @-yahya-- Рік тому

    by use of composition, the modular approach works best

  • @vigneshs2886
    @vigneshs2886 2 роки тому +3

    This is a lot more improved in Godot 4 when it comes to sharing folders because in Godot 4 everything is uuid based but in Godot 3 it's path based

  • @PedroBrandesitsme
    @PedroBrandesitsme 2 роки тому +1

    Pretty good, thank you

  • @Harald723
    @Harald723 11 місяців тому

    I do it the modular way but i seperate them into diffrent modules like entities, assets and levels.

  • @connorbushnell7684
    @connorbushnell7684 2 роки тому +2

    Have you played around with Godot 4 features yet I heard it was out?
    Also amazing video!

    • @and1hof
      @and1hof  2 роки тому +2

      Not extensively yet, that's on my TODO list - when I do I'll make a video with my findings

  • @dinnerchief
    @dinnerchief 2 роки тому

    I love hierarchy one, and always use it

  • @elxero2189
    @elxero2189 2 роки тому +1

    What's the bell, kind of distracting

  • @badradish2116
    @badradish2116 2 роки тому +1

    see "composition over inheritance".

  • @OUTSEET-ti1mt
    @OUTSEET-ti1mt 2 роки тому +1

    cool thanks for tutorial

  • @baoinh2968
    @baoinh2968 Рік тому

    thank for share

  • @SCALENE5
    @SCALENE5 2 роки тому +1

    Do you think that the cross module dependencies in the first method could be dealt with using some type of interface above the specific module level?

  • @Paruthi.618
    @Paruthi.618 2 роки тому

    Good one 👌

  • @RobertoMaurizzi
    @RobertoMaurizzi 2 роки тому

    Hmmm... I just started using Godot last week and this is one of the first problems I can see coming after the usual "how do I" newb stuff...
    I can't say your video convinced me much 😅 but please correct me if I'm missing something: in addition to the classic hierarchy vs composition problem that can't really be solved without proper component support in the language/engine (yes, I'm a big fan of the ECS approach) in Godot we also have the find nodes from different scenes problem.
    I'm trying to see how much work would it take to create a dungeon crawler game a friend of mine was making (in GameMaker 😱) when his programmer ran away: up to now Godot was fantastic, with a *lot* of high quality and very useful "nodes" that allowed me to put together a very simple prototype in hours, however I need a split user interface with a 3D area, a minimap, character body, inventory, message area (half the game uses a visual novel approach) and organizing cameras, viewports, their references (as Remote reference or getting nodes in GDScript) make me think this problem doesn't have a good solution, only "less wrong" ones...
    What are your thoughts and those of the community about this? 😀

  • @deba123ful
    @deba123ful 2 роки тому

    Can you make a tutorial about how to save various game variables and states into a file and load it?

  • @justindressler5992
    @justindressler5992 2 роки тому +2

    This is part of essential development, naming should be a conscious decision in everything you do as a programmer. It is far too easy to take shortcuts when giving something a name and scope. The classic example is 'var x = 1' this is a big mistake and if you get into this habit your game/program will quickly become unmaintainable. There is no such thing a shortcut here if you don't decide what your doing before you create x or define 1 you have already failed. A more creative approach would be 'var playerPositionX = input.x' there is no use of magic numbers or strange temporary variable even if they are local scope. This helps for self documentation. Simply said decide the scope then decide the name before typing a single character. Also avoid acronyms like pPosX this might make sense to you but your co-worker may not immediately known what 'p' or even 'Pos' means. The code should read like a well form sentence. Consider grammar when naming like verb, adverb, adjective noun eg makePlayerCharacterRunFastLeft(). Sometimes you will use set or get as verbs.
    The second tip is scaffold your code by starting with a bunch of comments describing what you intend to do. Eg '// I need to set player x and y position based on user input from controller, i may need to consider position from keyboard or mouse' by writing this before writing the code you have to think critically about the problem before starting the code.
    Another hint, is planning even a little bit of planning at the start of the project goes along way like this video discusses choosing how the ten's of thousands of resources are stored at the start saves massive amounts of refactoring at the end.
    I usually start any project of scale larger than a proof of concept with a design brief. This describes a brief outline in a form of specification then detailed description of each specification and risk mitigation such as im not sure i can use feature x on mobile among other things. One good tool for this is to use markdown and programs like Obsidian. This way your documents are easily readable and searchable by your IDE in the case of Godot and viewable by anyone with a text editor. Naming as discussed in this video does not stop at the variable but continues to the function the class the file the resource this needs to be a conscious and intentional choose.
    I like using camel casing for variables and functions and caps casing for files and types including classes. All caps for constants with underscore to separate words. This method allows quick searching in many editors for example PlayerCharacterClass can be searched using PCC if the IDE supports it.
    It should almost be possible to search your entire game by logic alone. Also you must always use version control this is a given in this day but GIT is essential. Don't comment out old code delete it if you commit and manage code in a VCS you can always find the old code and restore it but if your search finds commented out code it will increase your cognitive load.

    • @Amipotsophspond
      @Amipotsophspond 2 роки тому

      "search finds commented out code it will increase your cognitive load". so first you make good readable code then you comment it out. Then you restructure it to use reusable functions in a less readable way. Then you replace the workings of those functions with optimize code that uses harder to read things like bit-wise, pointers, and other tricks that you have to get in a mind set to read. like
      ##if a>=b:
      ## return a
      ##else:
      ## return b
      return a ^ ((a ^ b) & -(a < b))
      I think having the old branching commented out code makes the line more understandable, I would much rather have something with too many commented junk then something with too few.
      if it bugs you, you could just make something to remove those lines from a file and replace them with a ##CommentedLines152to163 that way you can put them back in the right place after you are done. make tools to help your self.

    • @justindressler5992
      @justindressler5992 2 роки тому

      @@Amipotsophspond Hi I'm not sure i understand what you mean, but commented-out code is prone to errors. For example, you comment out some old code and make changes in the new code but the comment out code does not get updated later you decide to restore the code but any fixes or changes you may along the way, is vary likely to break the old code. This makes the old code redundant along with this reason and the comment above there is no need to keep old code. As for optimizations, naming has zero impact as the compiled code will be using pointers and memory addresses not names. The problem is alot of programmers are taught to take shortcuts, like x and y this shows how bad the education out there is. As there is never shortcuts in programming nothing is free, and assumptions cause bugs.

  • @thomasbjarnelof2143
    @thomasbjarnelof2143 2 роки тому

    Thanks !
    After fiddling with the design I often find my self with a lot of assets in the folders that are not used in the actual game. Is there a good way to identify that assets ?

  • @kiyasuihito
    @kiyasuihito 2 роки тому

    Good tutorial. I would say an easy way around cross modular references though, is to follow the single responsibility principle with your assets. The downside is that you bloat the project with copies of the same assets, but I could also see myself changing, for example, the NPC sprites as my development progresses. This way, you can make changes independently. I like the idea of modules like this. This way you can make player controllers and easily reuse them in future projects. 👌

    • @Infiny92
      @Infiny92 Рік тому +3

      Loading copies of the same asset a bunch of times in memory doesn’t seem like a good idea.

  • @codexed-i
    @codexed-i 2 роки тому

    I already use the hierarchical one

  • @soran2290
    @soran2290 2 роки тому +1

    You need add more zoom

  • @elxero2189
    @elxero2189 Рік тому +1

    That bell... That bell uhhh

  • @gabrielguitiánestrella
    @gabrielguitiánestrella 2 роки тому

    Awesome

  • @wolf7115
    @wolf7115 5 місяців тому

    Fantastic tutorial, but it took me more than 10 minutes to build my game :(

  • @4.0.4
    @4.0.4 2 роки тому +1

    You have a good "youtubable" face so maybe take a bunch of photos and have a folder ready for thumbnails if you'll put your face on the thumb. Just so they're not all the same lol

  • @60b1in
    @60b1in 2 роки тому

    I don't want to design my project structure. I want to design my game. So I made a framework that does such decisions for me. :)

  • @Ianuarius
    @Ianuarius 2 місяці тому

    That "ding" sound REALLY hurts my ears.