Let me know if there are any of the scripts you want specific video about! Please checkout my upcoming game Hexagod: store.steampowered.com/app/3059390/Hexagod/
The audio manager would be nice. I kept having issues with coin-collection sounds overlapping, not playing enough, or erroring out because it can't play the sound on the destroyed object. This would be nice!
@@tldmbruno Right? Especially when it's something that would be controversial because then it's also just something any normal person would be likely to say. XD
Great content. Thanks! I'm working on a game now and just beginning to learn about autoloads. I made the game for Brackey's game jam and after submitting it realized I wanted to develop it beyond the jam so now I'm going back and refactoring everything and trying to organize everything into global autoloads to make expanding things easier and this is HUGELY helpful. Keep up the great work!
Congrats! That is one of the reason I love to do game jams. Time constraints can lead to interesting ideas which can then become full projects. Good luck!
Love to see more about your card manager and audio manager. Audio is definitely something I've not really tried to tackle yet. Also, added this video to my playlist of "Godot videos I wanna keep track of, cuz they seem to have super useful stuff in them" (Love the idea of a resource to keep track of colours/textures/etc that is then paired with a global ENUM)
This totally depends on the enum implementation of the language, some are good, some are bad, some don't even have it. If they are integer constants, its good, if they have strings not good, better to have a global file with constand integers for that instead.
This is SUPER helpful. Just understanding globals and loading them into the project is HUGE. Thanks for sharing this :) I'm working on my first commercial project and this might all be handy in developing better systems.
Yes please to the video about your audio manager! I have been thinking/struggling with this recently too. Have found some things that works sort of okay, but not sure how it's *supposed* to function
Nice overview, especially good for beginners and inexperienced & overwhelmed devs/users. Also, you went straight to the it, instead of stretching it to a 45 minutes information lackluster. Keep up the good work, thanks for sharing! 🤗 P.S.: Also, I totally forgot about implementing a signal bus globally being a basic yet totally valid option to track/subscribe to any kind of global game state changes. So, I probably should recall KISS & YAGN principles at least once a day to prevent any over-engineering on my side. Thanks again! 😄
A useful tip you can use: in the script editor window, you can select all the text and hit ctrl + alt + T, and it will automatically delete all the trailing whitespace and clear spaces and tabs out of empty lines. Can also be found under Edit -> Trim Trailing Whitespace.
great vid, i personally struggle the most with project architecture so more in-depth and overall more vids on related topics would be highly appreciated. definitely looking forward to one about your audio manager. thank you very much for all the content you make, keep it up!
Really cool to see what you use in your projects. I feel like this isn’t often showed and newer devs often have to just work it out as they go. Would love to see a video about your audio manager!
That audio manager script sounds like something my current project could really benefit from. Liked and subbed. Hope you get around to making that video!
Gotta say been loving these. I'm the junior dev in our group and just got started on godot and these videos and to support of my buds is really helping to programmer panic not set in lol.
Thank you very much for this. Just last week I was thinking I needed to start building something like this. Particularly for fast starting Game Jam projects. I’m glad I stumbled upon this video.
great content! Love the straightforward honest approach. one thing I noticed that could simplify something I saw in your Refs script: You could use a Dictionary for storing item colors by type. You can use the item type enum values as the keys for the dictionary, and store the colors as the values. This would turn your get_item_color_by_type() function into one line of code: return item_col_by_type[type] instead of a long if-else chain that accesses single variables like food_color anyway just thought I'd return the favor after all the knowledge coming the other way thru the screen
Thanks Aarimous! Loved this video and it was definitely helpful. I'm less experienced with coding, but even so I also look at enums as undervalued and underused! I would really love to see the video on your AudioManager global.
Here is a great video idea I always wish there was more of. Folder structure to keep your project organized from the start, rather then trying to restructure it as the project grows. A method for making a template folder structure to start a project with so, for example, you don't start by just shoving ever script into a single folder as a "later me can solve" problem.
In order of relevance, would like a video about these: Utility, Signal Bus and References. I love me some enums. I put enums on par with first learning about modulus operator, which is also a great tool for cycling through enums.
spawnning_state_changed :D Probably not going to be an issue with autocomplete, but thought I'd mention it. Really impressive to be able to code so well with dyslexia. Interesting to see you've named your enums in plural form - pretty unusual! Love the channel and the videos, keep up the great work!
One tip about enums... if you have enums describing elements that all inherit a custom class (say, food and building materials are all SurvivalResources), you can add the enum in the parent class. In this example, food inherits SurvivalResource, and in the parent script you have an enum TYPE, and each children has an export "type" of that enum then any code can call resource.type == SurvivalResource.TYPE.FOOD to check if it's a food.
Great video! I learned a lot about best practices when working in Godot. Hopefully, I'll see more videos like this-I'm looking for tips and tricks when working with 2D/3D views.
I would definitely like to hear more about that AudioManager script. Im managing my audio in a similar but simpler manner but you have some extra steps there that look interesting.
Super useful video, most of these are things I had implemented in my GMS2 game - but I was interested in their godot implementation, since I'm quite new to it and the engine is a bit confusing at times.
Putting all enums in a single utils class seems like madness to me XD still better than not using enums though For example, I see three enums there that begin with "CARD_": instead, you could just put them inside the "Card" class that you probably have somewhere and they will become much more easily manageable. Then you can just call "Card.Rarity.NORMAL" from anywhere instead of "Util.CARD_RARITY.NORMAL", and you can just use "Rarity.NORMAL" inside Card scripts. Same with Villager.State instead of Util.VILLAGER_STATES, etc. (also, not really important but the name of an enum is recommended by the style guide to be PascalCase and singular, since you can use it as a type).
i just went on a 20 minute rant about how i feltlike you justified me having a 3000 line enum file because i found a person that did the same thing. (i don't have many ppl to bounce programming logic off of)
For audio, you can use a compressor/limiter on an audiobus to prevent the DBS to go past a threshold without removing the satisfaction of a sound that should have played
You can but I think it still sounds bad. I'm not audio engineer so there are likely better ways to do this.. but my solution to simply limit the number of current sound effects has worked very nicely.
@@Aarimous (If I understood this correctly) I think it would make more sense to apply FIFO rather than suppress the latest sounds. Say you are limiting to 5 sounds ABCDE, as soon as F comes you stop A and remove it so you are now going BCDEF. The player gets the sound of his latest interaction. In any case I like your video. I have tried a few different ways to handle colours/palettes (including a couple of plug-ins) but it never occurred to me to just use exported variables. Thanks.
Requesting in-depth video on the Audio Manager. I'm trying to avoid globals, but I'm very interested on your Utils filled with enums and methods. The Signal Bus is a topic that nobody is covering, so you'll have lots of interest if you elaborate on how to use it.
Regarding the cult of the enum, I wish GDScript had algebraic data types like Rust so enums could hold data too and do type comparisons (rather than just being wrappers around ints).
This was an excellent video. I've been a professional developer for over 30 years, though never a game dev (yet!). This stuff really resonated with me. I have a library of useful code that I include in most of my projects, honed from my experience. And the advice to just try something and learn from it is spot on. Dev is something you learn by doing, so when it doubt, write some code and learn from it. Also - Hexagod looks l like fun, but I only see a Windows version of the demo. Do you have plans for Mac support?
great video, started my game dev and programing journey 4 month ago and videos like this expose me to what I don't know I can do. an in-depth tutorial on enums would be great. what is it, how is it used and how it can not be used. thanks for the video
Oh i thought I misunderstood the video, as someone who is really into Godot Script templates I assumed you are going into script templating (the custom base of whenever you are attaching a script to any scene). Nevertheless, teaching about code singletons is important as well. Much appreciated
Great vid! I'd love to see the video about your audio manager script! Also, wouldn't it be good to include that script in a global scene that persists between other scenes, so that sounds like music will carry over when swapping levels et al? Or is there a better way? Would love to see about that!
Having a music scene is a great use case for a global/autoload script. In fact I did this for my first game Chess Survivors and it worked out very nicely.
I think the enum class doesn’t need to be autoloaded. It can be used directly as is. And you can change its class name to Type instead of Util to make it exclusively for enum types.
Very nice and useful video! Question; Why do you make HexUtil a Resource? Usually, I make my utility classes have a class name and use "static" keyword for all functions in there. (So I can call them from anywhere.) (Btw, my first Godot project is open source & """code""" is MIT licensed :3 - It seems like a good way to learn and for other people to tag along.)
Hey, great video! I'm newbie to Godot and GDScript andI have question about params in your Signal Bus. I've seen that you have types/classes/"whatever that is" like EntitySpawnEventData, VillagerEventData. How and where do you define those? I'd assume those are "custom types" that hold data for specific events and I really like the idea but I have no idea how to define them in GDScript.
Hey there! You can use the keywork "class_name NameHere" in a script and you don't need to attach scripts to nodes. So for these signals I am creating small scripts that are named "EntitySpawnEventData" and then only have a few variables defined. I call these sort of scripts data wrappers and it just helps keep things organized when you are connecting the signal. Then when I emit the signal I need to create a new instance of the script by saying something like "var data = EntitySpawnEventData.new()" and then assigning variable values and finally passing that when I actually emit the signal. Hope this helps! If you need to I can make a more granular video about this.
Also, I understand the concept since I have experience with events in other programming languages but more granular video could be useful for people not familiar with programming and good patterns!
Have you done any multiplayer? I noticed RPC doesn't handle custom classes at all, I wonder if you run into this problem. Haven't tried Resource/RefCounted yet though.
Why is, e.g., the TileManager a property of Global? Why is the SignalBus a separate autoload? I’m just wondering why different choices were made for them.
Everyone always says "Don't use global scripts, it's bad practice!" so I've been trying to work my project without them, but then I come across this video and it's like... _why_ am I supposed to be avoiding global scripts...? This looks SO MUCH MORE CONVENIENT than avoiding them! I don't understand the logic. Should I just ignore that advice? Why do people say it so often? There must be a good reason, right??
They say don't, when what they mean is "use Singletons sparingly.. and only after you actually understand concepts like Single Responsibility and Composition" but because they're all making tutorials they just say "Don't" Why? Mostly readability and reusability. NOT using them keeps systems independently functional so they don't rely on your Global implementations.
I also had to make something to manage lots of sounds playing at once. Do you use the limiter or compressor audio bus effects? Because I tried them and got some odd clipping noises. Instead went for a script like yours that lowers volume or refuses to play sounds when the limit is close/reached.
I first found this issue in my first commercial game Chess Survivors and I tried to fix it with a compressor but I also had clipping issues. This solution has been far better to simply say I can only have so many copies of a sound at once. I'll make another specific video about this soon so let me know if you have any questions about how I do it. Cheers!
is it true that using scripts can be dangerous (like collecting data)? then maybe they should check and collect the verified safe ones in a single website
Hey, some tip, i noticed your las class that you showed is a Resource, however you have an _init() method with argumenrs. This is invalid to Godot because Resources are meant to be spawned from ui at any moment and place and tgis throws errors. A way to workaround this without breaking Godot's expectation is having an utility constructor class: static func create(arguments) -> Resource:
At that point I'm talking about the order the listeners to the signal are executed. I've seen that Godot doesn't give you any guarantee for this order so if the order does matter, you'll need to do something like creating some sort of method to handle the order. I actually can't find an official source for this warning, but it's something I've run into over the years.
@@Aarimous it is a very weird problem isnt it? it might just be related to order execution of the scripts of the nodes itself, idrk, but what scenario exactly that requires you to deal with the problem? is it like if multiple signals called at the same frame? is it like the order execution of these signals from the global script itself? it would be helpful for me to know more since you mentioned there is an actual in editor warn on this.
@@Aarimous im looking up potential scenarios for this issue to occur, if my understanding is correct at least, there is one where this issue is common, its when making those room-based camera that adapts itself to areas and all. this issue always happen when you have areas that overlapps each other, thus making it possible for signals to fire in the wrong order which mess things up. this scenario isnt really that complicated to solve, you can just have an array containing the areas you jusy entered from latest to oldest, removing the nodes that you left from the array, which then gives you a nice array to detect which area has bigger priority for the camera to adapt to based on order of entering IF there is decent gaps of time between entering these areas, if you enter two areas at the exact same time (which is kinda stupid on the level design part) you def run to this issue no matter what.
At some point you are going to need a reference to the icon so can then return the proper icon. For me this was a simple, clean, and readable way of doing it.
@@Aarimous For the Refs class, my initial thinking here would be that Resources would be (coincidentally) a type of Resource, and each resource would then be able to export a `@export var color: Color` and `@export var icon: Texture2D`, so if you ever added a new resource type all the related data is defined in one place. I imagine there'd still be some kind of Dictionary defined somewhere which maps a Resource enum to the resource resource, still haven't found a great way to just say "give me all resources of this type" in Godot. Not trying to be "snipe-y" here, just happened to literally be thinking about almost this exact problem the other day. Like you say at the end of this video, this stuff is hard and there are countless ways to do anything. Anyway -- really been enjoying the videos, thanks for making these!
Let me know if there are any of the scripts you want specific video about! Please checkout my upcoming game Hexagod: store.steampowered.com/app/3059390/Hexagod/
The audio manager would be nice. I kept having issues with coin-collection sounds overlapping, not playing enough, or erroring out because it can't play the sound on the destroyed object. This would be nice!
Godot is not a cult, I could quit at any time.
FYI for anyone not seeing the "Globals" tab under Project Settings, in some versions of Godot it is just called "Autoload".
"We're not a cult."
Sounds like something a cult leader would say.
I love the irony of this way of thinking. "We're not X!" "Sounds like something a X would say."
@@tldmbruno Right? Especially when it's something that would be controversial because then it's also just something any normal person would be likely to say. XD
With the current controversy it seems Godot is actually a cult
@@ebanfa Only the foundation, not its users.
As long as I don't see propaganda like in the godot socials I'm fine with it
Great content. Thanks! I'm working on a game now and just beginning to learn about autoloads. I made the game for Brackey's game jam and after submitting it realized I wanted to develop it beyond the jam so now I'm going back and refactoring everything and trying to organize everything into global autoloads to make expanding things easier and this is HUGELY helpful. Keep up the great work!
Congrats! That is one of the reason I love to do game jams. Time constraints can lead to interesting ideas which can then become full projects. Good luck!
Love to see more about your card manager and audio manager. Audio is definitely something I've not really tried to tackle yet.
Also, added this video to my playlist of "Godot videos I wanna keep track of, cuz they seem to have super useful stuff in them" (Love the idea of a resource to keep track of colours/textures/etc that is then paired with a global ENUM)
Lol, I have been a member of the cult of enum for a decade... Can we please stop stringly typing things when enums are safer and cleaner
One of Use ;)
This totally depends on the enum implementation of the language, some are good, some are bad, some don't even have it.
If they are integer constants, its good, if they have strings not good, better to have a global file with constand integers for that instead.
@@fenilli In Godot they are Integers
@@fenilliput the constants in a namespace and it functions similar to an enumerator
Wait until you learn about value objects
This is SUPER helpful. Just understanding globals and loading them into the project is HUGE. Thanks for sharing this :) I'm working on my first commercial project and this might all be handy in developing better systems.
Yes please to the video about your audio manager! I have been thinking/struggling with this recently too. Have found some things that works sort of okay, but not sure how it's *supposed* to function
I'd love a deeper dive video into the card manager and the sound manager scripts!
Noted!
Thats something I'll also love to see
Agreed
Nice overview, especially good for beginners and inexperienced & overwhelmed devs/users. Also, you went straight to the it, instead of stretching it to a 45 minutes information lackluster. Keep up the good work, thanks for sharing! 🤗
P.S.: Also, I totally forgot about implementing a signal bus globally being a basic yet totally valid option to track/subscribe to any kind of global game state changes. So, I probably should recall KISS & YAGN principles at least once a day to prevent any over-engineering on my side. Thanks again! 😄
A useful tip you can use: in the script editor window, you can select all the text and hit ctrl + alt + T, and it will automatically delete all the trailing whitespace and clear spaces and tabs out of empty lines. Can also be found under Edit -> Trim Trailing Whitespace.
great vid, i personally struggle the most with project architecture so more in-depth and overall more vids on related topics would be highly appreciated. definitely looking forward to one about your audio manager. thank you very much for all the content you make, keep it up!
Really cool to see what you use in your projects. I feel like this isn’t often showed and newer devs often have to just work it out as they go.
Would love to see a video about your audio manager!
That audio manager script sounds like something my current project could really benefit from. Liked and subbed. Hope you get around to making that video!
Very good video. Gives an overall insight, which there arent a lot of videos about out there.
Gotta say been loving these. I'm the junior dev in our group and just got started on godot and these videos and to support of my buds is really helping to programmer panic not set in lol.
Thank you very much for this. Just last week I was thinking I needed to start building something like this. Particularly for fast starting Game Jam projects. I’m glad I stumbled upon this video.
great content! Love the straightforward honest approach.
one thing I noticed that could simplify something I saw in your Refs script: You could use a Dictionary for storing item colors by type. You can use the item type enum values as the keys for the dictionary, and store the colors as the values. This would turn your get_item_color_by_type() function into one line of code:
return item_col_by_type[type]
instead of a long if-else chain that accesses single variables like food_color
anyway just thought I'd return the favor after all the knowledge coming the other way thru the screen
I also add a "logger" script that has configurable log levels and writes to console/file
Thanks Aarimous! Loved this video and it was definitely helpful. I'm less experienced with coding, but even so I also look at enums as undervalued and underused! I would really love to see the video on your AudioManager global.
Here is a great video idea I always wish there was more of.
Folder structure to keep your project organized from the start, rather then trying to restructure it as the project grows.
A method for making a template folder structure to start a project with so, for example, you don't start by just shoving ever script into a single folder as a "later me can solve" problem.
In order of relevance, would like a video about these: Utility, Signal Bus and References.
I love me some enums. I put enums on par with first learning about modulus operator, which is also a great tool for cycling through enums.
spawnning_state_changed :D Probably not going to be an issue with autocomplete, but thought I'd mention it. Really impressive to be able to code so well with dyslexia. Interesting to see you've named your enums in plural form - pretty unusual!
Love the channel and the videos, keep up the great work!
I can be wrong as long as I'm consistently wrong ;)
I personally love the time_chaneged signal
Nice just picked up a copy of Chess Survivors, thanks for the tips! Hadn't heard of or scene signal buses before.
New to Godot. Loving your material so far. Definitely in for the AudioManager video :)
One tip about enums... if you have enums describing elements that all inherit a custom class (say, food and building materials are all SurvivalResources), you can add the enum in the parent class.
In this example, food inherits SurvivalResource, and in the parent script you have an enum TYPE, and each children has an export "type" of that enum
then any code can call resource.type == SurvivalResource.TYPE.FOOD to check if it's a food.
Great video! I learned a lot about best practices when working in Godot. Hopefully, I'll see more videos like this-I'm looking for tips and tricks when working with 2D/3D views.
This video was actually pretty helpful! Thank you so much!
Super informative thanks dude! Cult of enums for liiiiife!
well i now know what i need to do with my audio so it does not blow my ear drums out for my bullet hell game, thank you
The hexagod demo is so fun! Can't wait for the full game.
I would definitely like to hear more about that AudioManager script. Im managing my audio in a similar but simpler manner but you have some extra steps there that look interesting.
Super useful video, most of these are things I had implemented in my GMS2 game - but I was interested in their godot implementation, since I'm quite new to it and the engine is a bit confusing at times.
Putting all enums in a single utils class seems like madness to me XD still better than not using enums though
For example, I see three enums there that begin with "CARD_": instead, you could just put them inside the "Card" class that you probably have somewhere and they will become much more easily manageable. Then you can just call "Card.Rarity.NORMAL" from anywhere instead of "Util.CARD_RARITY.NORMAL", and you can just use "Rarity.NORMAL" inside Card scripts. Same with Villager.State instead of Util.VILLAGER_STATES, etc. (also, not really important but the name of an enum is recommended by the style guide to be PascalCase and singular, since you can use it as a type).
Awesome video, I am new to godot and didnt know about autoloads!
Woah this is great advice!!! Thank you!!!
i just went on a 20 minute rant about how i feltlike you justified me having a 3000 line enum file because i found a person that did the same thing. (i don't have many ppl to bounce programming logic off of)
For audio, you can use a compressor/limiter on an audiobus to prevent the DBS to go past a threshold without removing the satisfaction of a sound that should have played
You can but I think it still sounds bad. I'm not audio engineer so there are likely better ways to do this.. but my solution to simply limit the number of current sound effects has worked very nicely.
@@Aarimous (If I understood this correctly) I think it would make more sense to apply FIFO rather than suppress the latest sounds. Say you are limiting to 5 sounds ABCDE, as soon as F comes you stop A and remove it so you are now going BCDEF. The player gets the sound of his latest interaction.
In any case I like your video. I have tried a few different ways to handle colours/palettes (including a couple of plug-ins) but it never occurred to me to just use exported variables. Thanks.
Requesting in-depth video on the Audio Manager.
I'm trying to avoid globals, but I'm very interested on your Utils filled with enums and methods.
The Signal Bus is a topic that nobody is covering, so you'll have lots of interest if you elaborate on how to use it.
ruclips.net/video/Egf2jgET3nQ/видео.html
very cool! my global scripts for Axe Ghost look very similar. Signaller and SoundManager are OP.
your work is great! thanks for sharing!
You have a programmer brain bro! Learned a lot!💪
Regarding the cult of the enum, I wish GDScript had algebraic data types like Rust so enums could hold data too and do type comparisons (rather than just being wrappers around ints).
A video on the Audio Manager would be very much appreciated!!
This was an excellent video. I've been a professional developer for over 30 years, though never a game dev (yet!). This stuff really resonated with me. I have a library of useful code that I include in most of my projects, honed from my experience. And the advice to just try something and learn from it is spot on. Dev is something you learn by doing, so when it doubt, write some code and learn from it.
Also - Hexagod looks l like fun, but I only see a Windows version of the demo. Do you have plans for Mac support?
“Are y’all with the cult?”
_Enums let everyone each the same food, be the same color, have the same texture-_
“Yeah, this is it”
Great advice! I'll be augmenting my global script set :)
great video, started my game dev and programing journey 4 month ago and videos like this expose me to what I don't know I can do. an in-depth tutorial on enums would be great. what is it, how is it used and how it can not be used. thanks for the video
Great idea! I'll add it to the list :)
my favorite part of this video was the cat in the background ❤
Oh i thought I misunderstood the video, as someone who is really into Godot Script templates I assumed you are going into script templating (the custom base of whenever you are attaching a script to any scene). Nevertheless, teaching about code singletons is important as well. Much appreciated
Thanks for sharing your wisdom. This is really useful
Great vid! I'd love to see the video about your audio manager script! Also, wouldn't it be good to include that script in a global scene that persists between other scenes, so that sounds like music will carry over when swapping levels et al? Or is there a better way? Would love to see about that!
Having a music scene is a great use case for a global/autoload script. In fact I did this for my first game Chess Survivors and it worked out very nicely.
Hexagons are the Bestagons, and Amit of Red Blob Games is the best.
I think the enum class doesn’t need to be autoloaded. It can be used directly as is. And you can change its class name to Type instead of Util to make it exclusively for enum types.
The cult of enum now has a new disciple!
😜
that was GREAT, thank you
Very nice and useful video!
Question; Why do you make HexUtil a Resource?
Usually, I make my utility classes have a class name and use "static" keyword for all functions in there. (So I can call them from anywhere.)
(Btw, my first Godot project is open source & """code""" is MIT licensed :3 - It seems like a good way to learn and for other people to tag along.)
I am very interested in a video on the audio manager script. Subscribed.
ruclips.net/video/Egf2jgET3nQ/видео.htmlsi=XHCUCghqdJrC8Vk2
The cult of enum is already here 😤
One of us!!!
couldn't take my eyes off from the cat
just wow, thanks!
Could you make a video about file structure and organisation?
I would be interested in a video on the sound manager.
Great video, thank you!
Glad you liked it!
Thanks for sharing!
Hey, great video!
I'm newbie to Godot and GDScript andI have question about params in your Signal Bus. I've seen that you have types/classes/"whatever that is" like EntitySpawnEventData, VillagerEventData. How and where do you define those?
I'd assume those are "custom types" that hold data for specific events and I really like the idea but I have no idea how to define them in GDScript.
Hey there! You can use the keywork "class_name NameHere" in a script and you don't need to attach scripts to nodes. So for these signals I am creating small scripts that are named "EntitySpawnEventData" and then only have a few variables defined. I call these sort of scripts data wrappers and it just helps keep things organized when you are connecting the signal. Then when I emit the signal I need to create a new instance of the script by saying something like "var data = EntitySpawnEventData.new()" and then assigning variable values and finally passing that when I actually emit the signal. Hope this helps! If you need to I can make a more granular video about this.
@@Aarimous Oh, great to know that I don't have to attach those scripts to nodes. Thanks for answer!
Also, I understand the concept since I have experience with events in other programming languages but more granular video could be useful for people not familiar with programming and good patterns!
Have you done any multiplayer? I noticed RPC doesn't handle custom classes at all, I wonder if you run into this problem. Haven't tried Resource/RefCounted yet though.
I think instead of a function get_resource_color_by_type() I would probably just make a dictionary with the color ENUM types as the keys.
Why is, e.g., the TileManager a property of Global? Why is the SignalBus a separate autoload? I’m just wondering why different choices were made for them.
Everyone always says "Don't use global scripts, it's bad practice!" so I've been trying to work my project without them, but then I come across this video and it's like... _why_ am I supposed to be avoiding global scripts...? This looks SO MUCH MORE CONVENIENT than avoiding them! I don't understand the logic. Should I just ignore that advice? Why do people say it so often? There must be a good reason, right??
They say don't, when what they mean is "use Singletons sparingly.. and only after you actually understand concepts like Single Responsibility and Composition" but because they're all making tutorials they just say "Don't"
Why? Mostly readability and reusability. NOT using them keeps systems independently functional so they don't rely on your Global implementations.
You have to have SOME global functionality. The key is understanding what should and should not be a global responsibility.
I also had to make something to manage lots of sounds playing at once. Do you use the limiter or compressor audio bus effects? Because I tried them and got some odd clipping noises. Instead went for a script like yours that lowers volume or refuses to play sounds when the limit is close/reached.
I first found this issue in my first commercial game Chess Survivors and I tried to fix it with a compressor but I also had clipping issues. This solution has been far better to simply say I can only have so many copies of a sound at once. I'll make another specific video about this soon so let me know if you have any questions about how I do it. Cheers!
great vid
I'm going to remove all enums from all my projects now
Why do you not have 1 million subs?
is it true that using scripts can be dangerous (like collecting data)? then maybe they should check and collect the verified safe ones in a single website
Hi bro just plese comment on these please because i wait every day where you post early so i can comment
Here is just a comment :)
*The cat tho*
Can we start a Hexagon cult instead?
Hey, some tip, i noticed your las class that you showed is a Resource, however you have an _init() method with argumenrs. This is invalid to Godot because Resources are meant to be spawned from ui at any moment and place and tgis throws errors. A way to workaround this without breaking Godot's expectation is having an utility constructor class:
static func create(arguments) -> Resource:
sorry man im taking your cat
Hello can you make a video about the environment like rain, sun, snow?
is anyone notice the cat😺
No please declutter me of these "must haves" - plain refusing.
Your script has spawning spelt like spawnning
Given the recent events, Godot may actually be a cult 😂
Yeah.. my joke is less funny now given the recent drama.
4:49 i meann... await exist, if you have a whole global signal script surely you utilised await to make full advantage of this... right?
At that point I'm talking about the order the listeners to the signal are executed. I've seen that Godot doesn't give you any guarantee for this order so if the order does matter, you'll need to do something like creating some sort of method to handle the order. I actually can't find an official source for this warning, but it's something I've run into over the years.
@@Aarimous it is a very weird problem isnt it? it might just be related to order execution of the scripts of the nodes itself, idrk, but what scenario exactly that requires you to deal with the problem? is it like if multiple signals called at the same frame? is it like the order execution of these signals from the global script itself? it would be helpful for me to know more since you mentioned there is an actual in editor warn on this.
@@Aarimous im looking up potential scenarios for this issue to occur, if my understanding is correct at least, there is one where this issue is common, its when making those room-based camera that adapts itself to areas and all. this issue always happen when you have areas that overlapps each other, thus making it possible for signals to fire in the wrong order which mess things up. this scenario isnt really that complicated to solve, you can just have an array containing the areas you jusy entered from latest to oldest, removing the nodes that you left from the array, which then gives you a nice array to detect which area has bigger priority for the camera to adapt to based on order of entering IF there is decent gaps of time between entering these areas, if you enter two areas at the exact same time (which is kinda stupid on the level design part) you def run to this issue no matter what.
Wait, you use @export for each icon?
Why not write a function that gives you the icon dinamically?
At some point you are going to need a reference to the icon so can then return the proper icon. For me this was a simple, clean, and readable way of doing it.
@@Aarimous but each time you a add a resource, you have too add 2 variables too
@@Aarimous For the Refs class, my initial thinking here would be that Resources would be (coincidentally) a type of Resource, and each resource would then be able to export a `@export var color: Color` and `@export var icon: Texture2D`, so if you ever added a new resource type all the related data is defined in one place. I imagine there'd still be some kind of Dictionary defined somewhere which maps a Resource enum to the resource resource, still haven't found a great way to just say "give me all resources of this type" in Godot. Not trying to be "snipe-y" here, just happened to literally be thinking about almost this exact problem the other day. Like you say at the end of this video, this stuff is hard and there are countless ways to do anything.
Anyway -- really been enjoying the videos, thanks for making these!
That sounds like a valid solution. This is the one I have now and I will likely tweak it in future projects. Thanks for sharing your ideas :)
3:53 Main file line 3
I believe there's a typo: time_chaneged(new_time), should be: time_changed(new_time)
time_chaneged xD. Good content though, learnt a lot.
And just like that, I realize I don't have a flippin' clue what I'm doing.
None of us do, all of this has taken me years to learn. Good luck!
The cat made me subscribe
6:30 All I'm saying is that if you have to tell people you're not a cult... you're probably a cult ¯\_(ツ)_/¯
12:34 length lol!
Glad someone saw that. I think the original edit was like 12:36, but then I found 2 seconds to cut to get it down to 12:34 :)
Great stuff! Thanks for sharing