5 INVALUABLE Godot 4 Code Patterns (feat.

  Рет қаралды 63,777

PlayWithFurcifer

PlayWithFurcifer

Жыл бұрын

Code patterns help you solve common game dev programming problems and can make your life so much easier. Here are five GDScript patterns that we use all the time and that you should definitely have in your toolkit!
Watch the other half of this collab on GDQuest's channel: • Five Must Have Code Pa...
Watch our "Things About Godot You Should Know" series: • Things About Godot You...
Wishlist our game Furcifer's Fungeon and play the demo:
store.steampowered.com/app/17...
Wishlist our other game, Super Kill-BOI 9000, and play the demo: store.steampowered.com/app/21...
Join our discord server: / discord
Follow us on twitter to stay updated on Furcifer news and tutorials:
/ tweetfurcifer

Пікірлер: 86
@smallguy241
@smallguy241 Жыл бұрын
Awesome video. There’s always a wealth of “hello worlds” out there - prod architecture and design stuff is always far and few between. Thanks!
@eerywax5631
@eerywax5631 Жыл бұрын
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!
@goodwincek
@goodwincek 10 ай бұрын
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!
@bitbraindev
@bitbraindev Жыл бұрын
This is extremely useful. Thank you for this!
@YouTubsel
@YouTubsel Жыл бұрын
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. :)
@terrylyn
@terrylyn Жыл бұрын
Many useful tips there, I will be using these patterns, thanks!
@longdongsilver3267
@longdongsilver3267 Жыл бұрын
Nothing really to say, but I enjoyed this video. Thanks for making and sharing it.
@anarkyworld
@anarkyworld Жыл бұрын
As always a very useful and easy to understand content. Thanks
@PlayWithFurcifer
@PlayWithFurcifer Жыл бұрын
Thank you :)
@kamrielus
@kamrielus 9 ай бұрын
The most useful godot video I've ever seen ❤
@luislodosm
@luislodosm 10 ай бұрын
Amazing tutorials
@NaughtyKlaus
@NaughtyKlaus 9 ай бұрын
Learned a lot, and never knew about the "owner" variable. Still, the sections could have been ordered better in terms of difficulty or complexity.
@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 ;)
@Portponky
@Portponky Жыл бұрын
For ages I thought you were Nathan from GDQuest. If only this video had existed back then.
@krzysztofswierzy4226
@krzysztofswierzy4226 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@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 Жыл бұрын
@@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 Жыл бұрын
@@Gdquest Thank You very much, I will try to incorporate it, I suppose I will understand whole functionality on the way :)
@GabrielVeda
@GabrielVeda Жыл бұрын
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 Жыл бұрын
More content material! Yay!
@NateyC214
@NateyC214 Жыл бұрын
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 Жыл бұрын
@@NateyC214 it started to seem necessary once I realized how unnecessarily slow many amateur games were
@OgGhostJelly
@OgGhostJelly Жыл бұрын
crossover episode? 💀
@PlayWithFurcifer
@PlayWithFurcifer Жыл бұрын
Yeeeeees
@sslaxx
@sslaxx Жыл бұрын
For stuff like score, I've found myself preferring setters/getters.
@Doogin21
@Doogin21 Жыл бұрын
It’s simple. I see a Godot video, I subscribe. EZ
@imjust_a
@imjust_a Жыл бұрын
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 9 ай бұрын
And with json i can use so nice things like jsonnata and co.
@himihub
@himihub Жыл бұрын
you can export google doc as a json
@Marsleader88
@Marsleader88 Жыл бұрын
Going through GD's "Code from Zero" course.. Highly recommend for noobs like me
@eerywax5631
@eerywax5631 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
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!
@pashakurozeev5516
@pashakurozeev5516 Жыл бұрын
Hello! Please make lessons on creating fishing in godot!
@TheSlimHim
@TheSlimHim 4 ай бұрын
I'm interested in seeing the full code for the DebugDrawCollisionShape 8:12
@felixjonsson4471
@felixjonsson4471 Жыл бұрын
Are these projects available somewhere?
@twiederk
@twiederk Жыл бұрын
Does Godot offers functions to read csv files or it is necessary to implement loading csv on my own.
@PlayWithFurcifer
@PlayWithFurcifer Жыл бұрын
There is a csv reader, yes
@Flonkation
@Flonkation Жыл бұрын
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).
@OnyxIdol
@OnyxIdol Жыл бұрын
signal bus is really amazing.. but I dread reworking my current project to use it -_-
@PlayWithFurcifer
@PlayWithFurcifer Жыл бұрын
you can do it!
@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 Жыл бұрын
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 KZfaq that teach good programming principals. Coming from a software dev background myself, most of the stuff out there hurts my brain. Keep m coming!
@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 Жыл бұрын
4.0 allows you to connect callables (functions) directly yea
@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 Жыл бұрын
GDquest have their own channel, and the other two people make videos together here ;)
@jamesodonnell4771
@jamesodonnell4771 8 ай бұрын
@@PlayWithFurcifer kinky
@thetiphon
@thetiphon 16 күн бұрын
5:45 why dont you add instance into dictionary?
@PlayWithFurcifer
@PlayWithFurcifer 16 күн бұрын
idk man it has been a while xD
@alfredogodoy6854
@alfredogodoy6854 Жыл бұрын
noice
@rekiemr4501
@rekiemr4501 Жыл бұрын
brooo pls make tutorial game like a growtopia i hope u can🤗
@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 :)
@GodotWorld
@GodotWorld Жыл бұрын
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.
@LivvieLynn
@LivvieLynn 5 ай бұрын
Any Microsoft text editor scares me when it comes to data. Too many icky special characters and formatting issues.
@Malisti04
@Malisti04 Жыл бұрын
I struggled to keep up with the lady voice unlike the guy. Must be the accent I'm not sure.
@Rogueixpresents
@Rogueixpresents 10 ай бұрын
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
@bagboybrown
@bagboybrown 7 ай бұрын
Anyone who uses vars cannot talk about good coding.
@PlayWithFurcifer
@PlayWithFurcifer 7 ай бұрын
Yeah man, those dirty users of variables...!
@bagboybrown
@bagboybrown 7 ай бұрын
@@PlayWithFurcifer It's just poor practice I don't care who's doing it.
@PlayWithFurcifer
@PlayWithFurcifer 7 ай бұрын
@@bagboybrown You seem very passionate about it tho
@bagboybrown
@bagboybrown 7 ай бұрын
@@PlayWithFurcifer That doesn't even make sense. About what I'd expect from someone who uses vars though.
@PlayWithFurcifer
@PlayWithFurcifer 7 ай бұрын
@@bagboybrown See, you do care a lot :D
@AlexeyTutorials
@AlexeyTutorials Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@PlayWithFurcifer so isn't like C# better choice performance wise? Or it doesn't matter?
@PlayWithFurcifer
@PlayWithFurcifer Жыл бұрын
@@AlexeyTutorials It is, but the vast majority of things you script are not performance critical.
@piousthepious
@piousthepious Жыл бұрын
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 Жыл бұрын
the only performance bottleneck is the thing sitting between keyboard and chair. the language in 99% of times is not related
@leonf8199
@leonf8199 Жыл бұрын
feat. gdquest is awesome!
@ArabGameDev
@ArabGameDev Жыл бұрын
the handle must be like this @Gdquest not this @GDQuest
Avoid BUGS and Work FASTER - 10 Godot Engine Tricks
5:20
PlayWithFurcifer
Рет қаралды 49 М.
10+2 AWESOME ADDONS for GODOT 4
8:36
MrElipteach
Рет қаралды 132 М.
Beautiful gymnastics 😍☺️
00:15
Lexa_Merin
Рет қаралды 15 МЛН
Best KFC Homemade For My Son #cooking #shorts
00:58
BANKII
Рет қаралды 58 МЛН
Using Composition to Make More Scalable Games in Godot
10:13
Firebelley Games
Рет қаралды 209 М.
How Games Make VFX (Demonstrated in Godot 4)
5:46
PlayWithFurcifer
Рет қаралды 327 М.
Immersive Sim in Godot 4: COGITO - Overview
8:22
Philip D
Рет қаралды 36 М.
Godot Debugging Techniques EVERY Dev Should Know
16:23
Bacon and Games
Рет қаралды 24 М.
We made Vampire Survivors BUT in 10 Lines of Code
7:08
PlayWithFurcifer
Рет қаралды 1 МЛН
This Godot 4 Scene Manager Does it ALL
28:50
Bacon and Games
Рет қаралды 22 М.
25 Gamedev Tips for Everyone
15:00
PlayWithFurcifer
Рет қаралды 11 М.
Godot 4 - Tiled Dungeon Environment From Scratch
26:24
DevLogLogan
Рет қаралды 396 М.
10 Godot Engine Mistakes You Might Make (Godot 4 / Godot 3)
10:00
PlayWithFurcifer
Рет қаралды 28 М.
Forcing my Fans to Fight in Factorio for my Amusement
16:29
DoshDoshington
Рет қаралды 104 М.