10 Tips For Using The Godot Engine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
ah me I really am doing a top 10 list aren't I Jesus Christ okay well let's just get to it I guess we'll start with number 1 which is Singleton's and these are basically scripts don't really attach themselves to any existing node which means they exist outside of the current scene which makes them perfect for things like saving data playing music uninterrupted between scenes or pre loading a bunch of resources to be used later I have got by my count 14 Singleton's in warp tech as we speak so I can tell you I really like using them and for the record that is way more than you should probably have okay so number 2 physics bodies and this is close enough to be a tip right let me just run through the three types of 2d physics body nodes and their usual use cases so kinematic 2d nodes are what I use for most things that need to be moved around so enemies the player other colliding entities are bullets maybe probably not bullets rigidbody 2d nodes are good for physics based movement so if you wanted some boxes for a puzzle game that move and fall like real boxes would then you'd want to know or you'd want to use rigidbody 2d or you could use kinematic body 2d but then you'd have to program all the physics stuff yourself and that's generally not so fun lastly static body 2ds are good for anything that should never move like the walls or the floor easy enough but it's good to know the differences between them number three adequate for number three is the ternary operator now most programming languages have this one and it's the question mark in C++ and in Python is just a thing if condition else other thing in GD scripted is the same as in Python as most things tend to be and it's super useful I realize it's much nicer to just use this simple ternary operator on one line rather than dedicating four lines to an if/else block now number four here's a much more functional tip and it's based off something I actually do in warp tech use a singleton script to preload all of the resources you need to use in the game to speed up in-game performance this way if you want to instance a node you just reference its entry in the monolithic resource script and instance it from there it has in my experience of three loading over a hundred objects maybe 150 even made the game start up maybe half a second slower but it drastically reduces lag spikes that stem from having to repeatedly load or preload resources such as when you're spawning a big blast of 30 to 40 bullets number 5 specifying neighbors in control nodes so have you ever run into the issue where you want a menu to be usable with the arrow keys or a d-pad but Godot just won't direct to the buttons in the proper order well I haven't really because I haven't really considered keyboard accessibility until basically making this list but there is a really neat solution to this problem so any control node will have the focus category and you can see there are a few properties like neighbor left neighbor right neighbor down whatever they basically determine what happens when this button is focused and the specified key is pressed so in case this explanation wasn't perfectly clear I won't go into too much detail I just say play around with it because it is a really simple concept and it's implemented really really well number 6 9 patch recs now this is also related to a control node but trust me this is super useful and it's actually a thing that only just appeared in Godot 3 basically for masochists I had to do manually a size and align all the edges and corners from all the menu panels and stuff for warp tech however I've specified a 3 by 3 grid of what each corner edge and middle piece should look like loaded it into a nine patch react and all you have to do is resize it and it'll automatically scale or tile the corresponding parts of the graphic to fit as size as your choosing it's super convenient while it sometimes takes a moment or two to actually configure it it's definitely worth looking into number 7 have you ever had that issue where you're cooking pasta for a while and you stir it but you're kind of impatient and you think well this is probably good enough and you strain it and you put it into a bowl and you take a bite and it's really crunchy in the middle so you put it back into water but you have to heat up the water again because you used cold water but by the time the pastas boiling again the past has actually dissolved into the water and you're left with a kind of starchy glue but you just had to turn into a soup but you don't even really like soup so you just pour it out and then it blocks the drain because it's still really thicker blazes and then your sink overflows instead of calling a plumber or even turning off the hot water tap you just sit under the table crying and feeling malaise for about you're terribly out of control life all you ate small puddle of water on the kitchen full to reach you and forced you to even cleaning up or deal with the soggy clothes but when it does actually reach you you just realize you don't have the energy or motivation to even get up off the floor for another hour and your clothes get completely saturated and warm starchy water and by the time you do get around to cleaning it up you've done permanent water damage to that stack of important envelopes you've been meaning to pick up off the floor but never got around to oh you've never had that one okay nevermind number eight Auto tiling now of course this one had to be on the list it is a little tricky to get your header and initially what with that bitmask stuff but it's super useful once you do get the hang of it now I won't explain it too much here but trust me learn it it's useful it'll take you say an afternoon at the absolute longest and potentially even faster if you watch my lovely tutorial video which I think exists and usually a better youtuber would you know go back and check to make sure that video exists but I guess I guess not number nine using an external code editor now I did do this for about a day with sublime text before realizing that godot's built-in code editor was fond of my needs but if I had a strong preference for instance if I was a VM or Emacs fanatic then I would be in luck because Godot makes it super easy to use a third-party editor all you have to do is go to editor in the top left edit the settings and under text editor click external and configure to your heart's content now lastly number 10 which is the new audio bus system okay and I don't think this really counts as a tip I will admit it but it's just something I really like about the engine and you got to agree it's a step above whatever the number seven was about basically I generally create two new buses in addition to the master bus and I call the music and sound fairly self-explanatory but the idea is that you've out all the music and sound through the music bus and all the sound effects through the sound bus now if you really wanted to you could have busses for ambient sounds voices whatever the point is that you can make things easier for you when you're adjusting system volume you can make a nice volume slider that directly adjusts the volume of the music bus and another cut that corresponds to the sound bus now this stops you from having to save another variable like music volume and refer to it from anytime you want to play some music anyways that's about all that I've got for today if you have any more interesting things about the engine that you think I in the world know about for real let me know in the comments I'm still learning stuff and everybody watching my channel is still learning stuff so keep it coming kids thanks for watching and stay tuned for more top 10 lists maybe I guess probably not though because this was a pain and really long to fight so goodbye alright so because I can't remember to self-promote to save my life I have to add this bit on the end separately so feel free to like the video subscribe to the channel or leave a comment do all that stuff that's good for the YouTube algorithms and by extension me also I have a patreon so you can get beta copies of warp tech for only $1 a month if you so desire the link to that is of course in the description you complete in absolute gremlin people
Info
Channel: AlexHoratio
Views: 26,106
Rating: undefined out of 5
Keywords: gamedev, indiedev, games, gaming, godot, engine, pixel, art, tutorial, how, to, help, singleton, autoload, ninepatchrect, control, neighbour, controller, support, pasta, shitpost, physics, physicsbody2d, kinematic, rigid, static, body, 2d, autotile
Id: iVRJsQqLzNU
Channel Id: undefined
Length: 7min 23sec (443 seconds)
Published: Wed Oct 24 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.