5 INVALUABLE Godot 4 Code Patterns (feat.

Поделиться
HTML-код
  • Опубликовано: 29 ноя 2024

Комментарии • 91

  • @smallguy241
    @smallguy241 Год назад +49

    Awesome video. There’s always a wealth of “hello worlds” out there - prod architecture and design stuff is always far and few between. Thanks!

  • @bitbraindev
    @bitbraindev Год назад +3

    This is extremely useful. Thank you for this!

  • @eerywax5631
    @eerywax5631 Год назад +4

    This video also led to me fiddling enough with Resources to finally understand how they can be used (and to stop being afraid to use the inspector for them). Thank you!

  • @YouTubsel
    @YouTubsel Год назад +1

    Can't say I completely understood how to use callables yet but I already understood that they are mighty handy!
    Thanks for all your videos. :)

  • @longdongsilver3267
    @longdongsilver3267 Год назад +1

    Nothing really to say, but I enjoyed this video. Thanks for making and sharing it.

  • @goodwincek
    @goodwincek Год назад +2

    Awesome video! I'm still learning so tip #1 was a bit over my head, but tip #2 I think I could immediately start implementing!
    #3-5 I'm definitely bookmarking for later, especially data management! Thanks for the great video!

  • @GreySectoid
    @GreySectoid Год назад

    Many useful tips there, I will be using these patterns, thanks!

  • @daemetheus
    @daemetheus Месяц назад

    Classic Furcifer, always throwing fireballs at dogs jumping on tables and such.
    ‘pestis! furcifer!’ coquus clamat. Thanks, Cambridge Latin.

  • @anarkyworld
    @anarkyworld Год назад +9

    As always a very useful and easy to understand content. Thanks

  • @OgGhostJelly
    @OgGhostJelly Год назад +8

    crossover episode? 💀

  • @imjust_a
    @imjust_a Год назад +5

    Very interesting video; would definitely like to see more explanation for certain topics, though! As a bit of a personal preference, I actually disagree on JSON being "really bad for holding data." I find a lot of strength in its flexibility. Unlike tables in which columns need to exist for every value, JSON allows you to flexibly add and remove values as-needed (as opposed to leaving a column blank if it's not being used, or adding a new column for data that only a handful of rows will use.)
    When loading data from JSON, you can simply have your code check to see if certain values it's looking for exist, and load them if they do (or use a default if they don't.) You can also easily include type names, allowing you to determine what kinds of objects to instantiate -- and within those different objects, use different values that aren't used by other objects.
    Obviously, it's up to personal preference, and each method of data storage has its pros and cons!

    • @Foreversun33
      @Foreversun33 Год назад +3

      And with json i can use so nice things like jsonnata and co.

  • @krzysztofswierzy4226
    @krzysztofswierzy4226 Год назад +7

    Great video, I wish it was uploaded month ago, so I wouldn't have to discover function-callback-argument-queue by myself :)
    About a pattern number five : I am disapointed with resources in Godot. I can't believe there is no built-in data structure, that lets us keep both exported and scripted variables. I often need to keep deeply nested dictionaries as data, and it is very impractical within export functionality. In the same time I have to use export to store data with visual components, like mesh or color. That problem forces me to keep data for every data-heavy object in two separate files :(

    • @Gdquest
      @Gdquest Год назад +5

      Have you tried resources? It sounds like what you need? Instead of deeply nested dictionaries, you can nest resources. Editing arrays of resources isn't amazing in Godot 3, but it's much better than dictionaries. Then if you make the leap to Godot 4, there, editing arrays in the inspector is way nicer.

    • @krzysztofswierzy4226
      @krzysztofswierzy4226 Год назад +2

      @@Gdquest thanks for the answer, it sounds very interesting, but I can't really imagine it ? For example : one resource stores arrays of meshes, colors and packed scenes, representing visual aspect of one themed tilemap. I wish to also store data which arguments pass to which functions for procedural layout of these objects and tiles. Should I introduce resource for every data patch of object-funcref-arguments and nest them into main theme resource ?

    • @Gdquest
      @Gdquest Год назад +6

      @@krzysztofswierzy4226 It's hard to answer because I would need to have the same understanding of what you've done and what you're trying to do as you have.
      Resources allow you to add any serializable fields you want, including other resources. So yes you could define a bunch of resource types and use those, Godot uses that extensively: whenever you create an object on a slot in the Inspector, you're nesting a resource. Mesh data, collision shapes, materials, etc. are resources.

    • @krzysztofswierzy4226
      @krzysztofswierzy4226 Год назад +1

      @@Gdquest Thank You very much, I will try to incorporate it, I suppose I will understand whole functionality on the way :)

  • @Marsleader88
    @Marsleader88 Год назад +3

    Going through GD's "Code from Zero" course.. Highly recommend for noobs like me

  • @GabrielVeda
    @GabrielVeda Год назад +77

    The Furcifer stuff presented was pretty advanced. You could have spent an entire video on each one. You skipped a lot of code that I wanted you to explain.

    • @Purpbatboi
      @Purpbatboi Год назад

      Exactly

    • @revimfadli4666
      @revimfadli4666 Год назад +1

      More content material! Yay!

    • @NateyC214
      @NateyC214 Год назад +1

      I especially would love to see more on the Object Pooling, it may not be seen as necessary but it is very interesting.

    • @revimfadli4666
      @revimfadli4666 Год назад +4

      @@NateyC214 it started to seem necessary once I realized how unnecessarily slow many amateur games were

  • @NaughtyKlaus
    @NaughtyKlaus Год назад +1

    Learned a lot, and never knew about the "owner" variable. Still, the sections could have been ordered better in terms of difficulty or complexity.

  • @kamrielus
    @kamrielus Год назад

    The most useful godot video I've ever seen ❤

  • @sslaxx
    @sslaxx Год назад +1

    For stuff like score, I've found myself preferring setters/getters.

  • @KosinsStuff
    @KosinsStuff 8 дней назад

    I am working on a huge project right now and i am at a point where my code is very spaghettified. Hopefully learning patterns and structures will help me fix that in the future. I think i have like 60 scripts with several thousand lines of code, its a crazy project and i will have to rewrite all that :(

  • @Portponky
    @Portponky Год назад

    For ages I thought you were Nathan from GDQuest. If only this video had existed back then.

  • @Flonkation
    @Flonkation Год назад +4

    So, use object pooling, if you need to? :D but not generally is the tip?

    • @igorthelight
      @igorthelight Год назад

      True!
      If you are NOT making a bullet hell game - you don't need it (most likely).

  • @TheSlimHim
    @TheSlimHim 8 месяцев назад

    I'm interested in seeing the full code for the DebugDrawCollisionShape 8:12

  • @twiederk
    @twiederk Год назад +1

    Does Godot offers functions to read csv files or it is necessary to implement loading csv on my own.

  • @Zahuranecs
    @Zahuranecs 3 месяца назад

    Can this read odf files or do I have to use csv files?

  • @luislodosm
    @luislodosm Год назад

    Amazing tutorials

  • @OnyxIdol
    @OnyxIdol Год назад +4

    signal bus is really amazing.. but I dread reworking my current project to use it -_-

  • @rionhunter
    @rionhunter Год назад

    Instead of using an auto load signal hub, for quick projects I’ve found just adding new signals to the tree root. Also tree meta values ;)

  • @codinablack
    @codinablack Год назад

    The girl, who tells us about how to use self in the other video, she explains how to make resources and the asynchronous callbacks, does she have her own youtube or some place where she shares either tutorials or other learning materials?? I have to say, I really enjoyed both videos you guys did together, but between the three of you, I feel like I think the same way she does, and would love more of her content please!

    • @PlayWithFurcifer
      @PlayWithFurcifer  Год назад +2

      GDquest have their own channel, and the other two people make videos together here ;)

    • @jamesodonnell4771
      @jamesodonnell4771 Год назад +1

      @@PlayWithFurcifer kinky

  • @Doogin21
    @Doogin21 Год назад

    It’s simple. I see a Godot video, I subscribe. EZ

  • @himihub
    @himihub Год назад

    you can export google doc as a json

  • @notarobot22
    @notarobot22 Год назад

    Concerning the first example. I'm not entirely sure about this, but aren't signals inherently asynchronous? If that's the case you should add a Mutex to lock access to your queue to ensure thread safety.

    • @Gdquest
      @Gdquest Год назад +5

      Signals are synchronous: callback functions get called as soon as the signal's emittted. It's the observer pattern but built into the engine.

    • @notarobot22
      @notarobot22 Год назад

      Learn something new every day 🙂
      Really appreciate these videos. There aren't many Godot resources on RUclips that teach good programming principals. Coming from a software dev background myself, most of the stuff out there hurts my brain.
      Keep m coming!

  • @felixjonsson4471
    @felixjonsson4471 Год назад

    Are these projects available somewhere?

  • @thetiphon
    @thetiphon 4 месяца назад

    5:45 why dont you add instance into dictionary?

  • @eerywax5631
    @eerywax5631 Год назад +1

    Hello! I am trying to learn how to use CSV after seeing this. When I use the code from 10:19 (modified for use with 3.3 i.e. FileAccess -> File), it hangs in what seems an infinite loop. I found another tutorial that folows a similar approach but with dictionaries, and, well, same thing. If I stop before looping, and do a file.get_as_text() the output is blank, but printing the file itself confirms there is a File object. If I open my CSV in Notepad I can confirm it has content, and does not go on infinitely. Can anyone clue me in to what might be going wrong?

    • @twiederk
      @twiederk Год назад +2

      I had a similar problem. The problem was everytime I opend the file with the Godot editor, the editor added an extra empty line to the textfile. The solution was not to edit the files with the Godot editor, so no additional empty line was added.

    • @eerywax5631
      @eerywax5631 Год назад +1

      Hey I had given up on this and got back to it today. Finally got it working. For me I never opened the file with the editor, but it always had that extra line anyway. It might not be the smoothest workflow if I have to watch out for this all the time but at least now I know. Thanks!

  • @pythonxz
    @pythonxz Год назад

    I really don't like that Signals call functions by string. I'd imagine there's a better way to handle that which isn't so brittle, right? (I'm new to Gadot)

    • @pythonxz
      @pythonxz Год назад

      Apparently 4.0 supports other ways to assign to signals. That's good.

    • @catgirlQueer
      @catgirlQueer Год назад +1

      4.0 allows you to connect callables (functions) directly yea

  • @pashakurozeev5516
    @pashakurozeev5516 Год назад

    Hello! Please make lessons on creating fishing in godot!

  • @igorgiuseppe1862
    @igorgiuseppe1862 Год назад

    wait do you work for IEEE? thats impressive!

    • @PlayWithFurcifer
      @PlayWithFurcifer  Год назад

      That's not quite how it works. Scientists write and review papers for different journals. I work for a university :)

  • @rekiemr4501
    @rekiemr4501 Год назад +1

    brooo pls make tutorial game like a growtopia i hope u can🤗

  • @alfredogodoy6854
    @alfredogodoy6854 Год назад

    noice

  • @GodotWorld
    @GodotWorld Год назад +1

    It's too bad that Godot doesn't support Sqlite out of the box. Instead of building CSV or JSon files you could read and write from an actual local database without the need for a DB server.
    It's also too bad GDScript is 'python like' and not just python. Imagine all the stuff you could do with standard/advance python packages like numpy, fastAPI, Pydantic, Pandas, SQLAlchemy. Crunch all of the data. (I suppose I could always just learn C#)
    Conversely, PyGame, which does support native python is so much harder to use due to the lack of built-in visual and scene management tools Godot has.

    • @michaelavrie
      @michaelavrie Месяц назад

      Good news--SQL features in development for godot 4.4!

  • @Ianuarius
    @Ianuarius Месяц назад

    One pattern I want to recommend to the creator of the video is deesser

  • @Malisti04
    @Malisti04 Год назад +2

    I struggled to keep up with the lady voice unlike the guy. Must be the accent I'm not sure.

  • @AlexeyTutorials
    @AlexeyTutorials Год назад +1

    Actually GDScript is the only thing keeping me away from trying Godot. Not sure why they chose it over C# or JavaScript (TypeScript) which are more mature and times faster. These things can be done in a much more elegant way there.

    • @PlayWithFurcifer
      @PlayWithFurcifer  Год назад +5

      You can use C# in godot if you want to, it's really well supported.
      But honestly, GDScript is pretty great if you like the python-ish style

    • @AlexeyTutorials
      @AlexeyTutorials Год назад +1

      @@PlayWithFurcifer so isn't like C# better choice performance wise? Or it doesn't matter?

    • @PlayWithFurcifer
      @PlayWithFurcifer  Год назад +6

      @@AlexeyTutorials It is, but the vast majority of things you script are not performance critical.

    • @piousthepious
      @piousthepious Год назад +1

      If you want to use C# you can. There’s support for it. Just not everyone needs C# for their incredibly small game.

    • @whoisthis3038
      @whoisthis3038 Год назад +4

      the only performance bottleneck is the thing sitting between keyboard and chair. the language in 99% of times is not related

  • @Rogueixpresents
    @Rogueixpresents Год назад +1

    i really hate how they are not making C# the main class citizen instead of this python looking ahh, sorry i just hate this syntax lmao

    • @htspencer9084
      @htspencer9084 3 месяца назад

      I'm not the hugest fan of the non-static typing and lack of {} scope markers but you do get used to it and some of the sytax does flow better than C# (like ifs, match(switch) case, and for loops)

  • @bagboybrown
    @bagboybrown Год назад

    Anyone who uses vars cannot talk about good coding.

    • @PlayWithFurcifer
      @PlayWithFurcifer  Год назад +1

      Yeah man, those dirty users of variables...!

    • @bagboybrown
      @bagboybrown Год назад

      @@PlayWithFurcifer It's just poor practice I don't care who's doing it.

    • @PlayWithFurcifer
      @PlayWithFurcifer  Год назад

      @@bagboybrown You seem very passionate about it tho

    • @bagboybrown
      @bagboybrown Год назад

      @@PlayWithFurcifer That doesn't even make sense. About what I'd expect from someone who uses vars though.

    • @PlayWithFurcifer
      @PlayWithFurcifer  Год назад +1

      @@bagboybrown See, you do care a lot :D

  • @leonf8199
    @leonf8199 Год назад

    feat. gdquest is awesome!

  • @ArabGameDev
    @ArabGameDev Год назад

    the handle must be like this @Gdquest
    not this @GDQuest