Godot Top-down Shooter Tutorial - Part 1 (Intro and Project Setup)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello everyone and welcome to the first video in this top-down 2d shooter tutorial that we're gonna be making any Godot my name is Joe and I'm really excited to get moving forward with this and and make something cool so just as an overview of what we're gonna actually be making my idea for this series is gonna be kind of a walkthrough on how to make a top-down shooter in 2d now there's a lot of similar tutorials or resources for games like this that you can find out there typically a lot of them sent around either being some kind of like a zombie defense game you know or potentially being like an infinite scroller type of shooter and those are awesome what I kind of want to do just to kind of give another outlet to that is make more of a traditional like military style shooter kind of a more capture the flag or capturing bases kind of thing and I think that's really gonna be cool it'll let us get into some interesting like AI and pathfinding win conditions different types of game modes and just kind of interesting things like that you might not get in your typical top-down shooter tutorial so I'm really excited I think it's gonna be awesome and you can always apply so many of the things we do in this to many other different types of games and I think especially you know like shooting mechanics or AI like those are things that you're gonna learn and be able to apply to any type of game that you make so that's just kind of the idea if you've ever played the game running with rifles kind of a similar feel but more of a top-down thing I think that's a good just kind of base of what we're gonna be going for so yeah I hope you're excited and I hope you will stick around kind of just an overview of all the things that we're gonna cover so first this is gonna be pretty beginner friendly I'm gonna assume general knowledge of programming and also some pretty basic Godot knowledge like done the official tutorial the Dodge the creeps tutorial like if you've gone that far you're you're totally good I can link to that tutorial in the description but basically like you been the editor before you kind of know some of the terminology but besides that it'll be super beginner friendly if you've never used Godot before that's totally fine or never really used it I'll explain you know all the nodes were using how I'm doing things try and just give step-by-step instructions for everything so it should be a really good learning experience whether you've used Godot pretty pretty heavily or it's something that's totally new to you another thing that I want to do is spend a lot of time talking about project architecture and organization how to structure your code how to structure your directories you know just like how to do things best practices and things like that I think that especially if you are a hobbyist or an indie game dev and you're working solo or trying it out for the first time those are things that are really easy to get overwhelmed with and get kind of discouraged and just not feel like you know you know what to do and I do you solve for development professionally full time so those are things that really get me excited like how do we organize this how do we structure this now so that it'll be the easiest to work with moving forward and so I really want to spend a lot of time talking about that because when I first got in a game dev those were things I kind of held me back you know you get that analysis paralysis so just things that I want to make sure we focus on to kind of help you know deal with some of the anxiety or just kind of worry about those issues that can creep in when you're just getting started so I hope that sounds like a good plan I'm excited to get started in this first video we're really just gonna set the project up and we're gonna get like our basic character sprite so right now I've got Godot 3.2.1 installed and you're gonna want to do the same thing real quick I'm gonna drag a Finder window over here so what I did is I opened Godot and I just created a new project I called it top-down shoe tutorial we can call whatever you want and I'm gonna drag over here I've also downloaded the asset pack from caddy the top-down shooter if you don't know Kenny he releases ton of awesome free open-source artwork or not open-source but free to use our work line highly recommend it's great for prototyping so I've downloaded some stuff from him and I've got a copy of it right here so I'm just gonna copy this real quick before I do that though I'm gonna come in here to our empty project click on this icon dot PNG file that comes with a Godot project and I'm gonna come up to the import settings up here and I'm actually gonna change the import settings to be 2d pixel and I'm gonna set this as the default for textures so what I'm doing here is basically making it so that by default any time that I bring in a texture to ghetto it's going to import it as a 2d pixel or 2d pixel texture and the reason we want that at least at the start here is because we're not using really nice high definition textures we're not using things that need a filter kind of a blur any-any like effects applied to it we just want the pixels themselves to be displayed so I'm gonna again you just hit this 2d pixel and that will do it for the current file you have what I also want to hit 2d pixel and then set it as the default for texture and then if I hit reom port it olaria port it we're not actually going to use this icon that PNG but I wanted to set that before I import all the chemi assets so that they will all be imported as pixel art so with that let me pop them in this Finder window so I already copied this top-down shooter I'll do it again just to be safe come back in to this is the folder I made so we have this top-down shooter tutorial folder this is you know the folder that I created the project in I'm gonna create a new folder in here I'm just gonna call it assets typically I like to co-locate assets like graphics or sounds with the things that are gonna use it so you know if you've got a solider character for example wherever you define the script and the scene you would put the artwork and the sounds for it as well right there it just makes it easier to find things but for now I'm just gonna have this like you know basically asset dump folder where you can just put stuff in so I'm gonna paste this in there so we'll see we have top-down shooter great so now if I click back in Godot you'll see it's gonna import all of these I'll just take a second and then once this is done then I can come over here and go back in the same tab so now we've got all the resources we need basically we are good to go to start making things I'm gonna do one more thing real quick actually no I'll do that in a sec so the first thing we need to do is just create a scene right so again just the basic overview in Godot everything is a scene sometimes scenes are just one node sometimes scenes are a collection of nodes like a tree of nodes so we'll just make a scene here this is gonna be our main scene so I'm gonna call it that so it's called main and oh I'm gonna save that I'll just save it in our root directory right now and the hotkey to run your project or run your main scene is command B I don't quite know what it is in Windows it's probably control B but if I hit command B I'll run the project and it will say there's no main scene to find so I'm just gonna hit select and set it to be our main scene so now we're gonna run it and obviously there's nothing there so it's just a blank screen but we have a game that we can run now which is great baby steps so now we have that one thing I want to do um if you notice actually we'll get to that in a sec so I'm gonna come over here and come into our project settings and I'll come down to rendering and then environment or quality sorry actually I think I think I'm still on the wrong one little boy there we go config no no a current display oh my gosh it's early so we're gonna leave these are the settings for how your like your what your games display size is gonna be or your window size we're gonna keep these default width and height settings for now we will most definitely change those later but we'll just keep those and I'm gonna come down to the bottom and change our mode here to be 2d this is our stretch mode and so what this means is that as you resize your window it's going to not keep things the same size like it will expand all of your things as your window increases which will be good so we can try and test you know moving our window size so just a first step to get that out of the way okay and now with that I think we are ready to add our player character I don't think we're gonna get to any movement or anything in this one but we're just gonna add a sprite we're gonna set it up and then in the next video we can really get into how we control that character how we move it around and actually get something that we can play so the first thing we need to do is actually add a player character so I'm gonna make our character a kinematic body to eat so you might be familiar with that turn but basically there's three types of physics bodies in Godot there's a static body a rigid body and a kinematic body so all of them interact with the physics engine a rigid body is totally controlled by physics so it's like you move it and affect it by applying forces and acceleration just like in real life and other things when it collides they will be pushed or pulled so if you have like you know a racing game or a game where there's wind or something or you want to do like you know rolling physics like there's so many types of games or things you can want where you'd actually want the full like physics simulation run then on the other end there's a static body which is for things that are not going to move there's a big performance increase - using static bodies because the engine assumes that their position won't change really so static bodies are things where you want something that can be collided into and is something in the world that other things should interact with but isn't actually going to move itself it's static like the name applies and then somewhere in between is the kinematic body and kinematic bodies are really good for things that are gonna move around but not by physics forces explicitly it's things that you want to control by code which is exactly what we want to do for our player character we want to have some pretty fine grained control over how exactly the player is going to move around and so with that we're gonna add a kinematic body to D I'm gonna call this player so just rename it to whoops player and then I'm gonna start adding one node now which will be a sprite so that we can actually give some artwork to our character so I have this sprite which is a child of the player which is a child of our main scene and now within the sprite to actually add a texture to it I'm gonna open our assets folder down here open top-down shooter and I'm gonna come to sprite sheet this directory that comes in the county assets and I'm gonna find this sprite sheet character file and just drag it right over into the texture drop-down of the sprite and what this will do is it'll set a texture for our sprite which is great except for the fact that we have the entire sprite sheet here and we only want one character so what we want to do is give this a region we don't want to use the whole texture we just want to use a small region so I can come right into here on our sprite and hit the region button and I can just hit region enabled and it will actually give it a texture region and so what I can do is open this texture region button that'll pop up down here come over into here and now it'll actually let me select which part or which region of our texture I want to use so one thing I'm going to do is just turn on grid snap this will just give a nice grid lines around here and I'm gonna come down here so this is this is the character we want to use right here we'll just use a generic soldier and you'll notice that using the grid lines as they are right now I can't actually get the totality of the character like there's a little bit of the arm that's out here so what I can do is make our grid lines a little bit more fine-grained by changing this step here so I'm gonna change these to be 8 pixels actually let's just do this before I think I'll need to anyway okay so I change it to 4 and now you can see I can go right here and I won't get you know any of the next character but I've still got our character and I can bring da it looks like there's a little bit of the gun right there so I think I'll just leave I think we're good I'll just leave it this is good so now we have a texture that's just our character and we can see on the screen up here that it actually works now we've just got the player character which is awesome so now that's how you can add a texture to a sprite how you can select just the specific part of it you want and now what we need to do is actually define and tell the physics engine for the sake of collisions what space this player takes cuz we can see right here all it takes like you know this but the physics engine doesn't know that it can't read that just from the sprite so I'll select our player and I'll hit add and I will add a collision shape 2d and you'll notice right now before I add this that there's this little warning icon by the player and what that warning is is basically saying hey you have a physics body but there's no collision shape to it which is exactly the problem we're going to fix right now so I'll hit create and we'll have a collision shape and I will come over here to shape and I think we'll just do a rectangle shape for now so I added a rectangle shape - you'll notice that warning is calm which is great our rectangle is a little small so we're gonna need to make it a little bit bigger before I do that though I'm gonna similar to what we were doing with the texture region turn on grid snapping up here again just to get some nice gridlines and then when I move stuff around it'll snap to the grid so let me move this here and let's just make this fit hard player I think that's good I don't really want the gun to be totally included in the collision I really just want it to be the player itself and I think that will just make it feel better you know if you've got multiple characters on the screen you know we might change this to be a circle collision shape eventually but this is totally fine for now just a rectangle so with that I think we're good and now what I can do is if I start our game we should see our character he's obviously a little bit out of the screen but what I can do is just grab this and I can go to move mode and then just if I have the players selected just drag the player in any child nodes and move it over here so now when I hit command B we'll see our player right there which is great so you have a great start here I think this is pretty much all the stuff I want to get done in this video we've created our project we've added some of the settings we need just to make sure it appears correctly we've added a character added a collision shape we added the graphics and next video we're pretty much ready to dump or to jump in and get movement working and get a bunch of other cool stuff going so yeah I think this is a good place to stop for this one thanks so much for watching feel free to leave any feedback or suggestions or places you want to see this go in the comments below and I'll see in the next video
Info
Channel: jmbiv
Views: 20,025
Rating: undefined out of 5
Keywords: godot, godot engine, godot 3.2, godot tutorial, godot top-down, godot 2d, top-down shooter, how to make a game in godot, game development, game development tutorial, game development for beginners, godot for beginners, how to make a top down game in godot, how to make a top down shooting game in godot, game dev, indie game dev, indie game development, how to make video games, how to godot, hobby game development, gamedev, godot game engine
Id: gXkkNSfxLRI
Channel Id: undefined
Length: 16min 9sec (969 seconds)
Published: Sun May 03 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.