Godot 4 Crash Course for Beginners - GameDev 2D Top Down Tutorial

355,575
0
Published 2022-07-05
This guide shows many changes to features like the tilemap tools, how to setup moving characters, and changes made to GDscript syntax in Godot 4 Alpha. The goal is to give a good overview of whats upcoming in Godot 4, since it's still currently in Alpha. Sprout lands assets and chapter timestamps below!

Sprout Lands Download ~ cupnooble.itch.io/sprout-lands-asset-pack
Character Script Downloads for Patreons ~ www.patreon.com/posts/scripts-godot-4-68719570

➣ Downloadable Assets, Video Courses, and Other Places to Follow Me
chris-tutorials.itch.io/
linktr.ee/ChrisTutorials

◢ Chris Recommends ◥
Master Skills with Skillshare Video Courses ►► www.skillshare.com/r/user/christutorials?gr_tch_re…
Save Money Shopping Online with Honey Extension ►► joinhoney.com/ref/qd04c25

Timestamps
0:00 What to Expect
1:02 Creating a New Godot 4 Project
1:38 Interface Overview
2:40 Godot Project Structure
5:03 Scene Hierarchy
5:26 Creating a Player Character
7:34 Character Spritesheet
7:56 Pixel Art Rendering Settings
8:26 Splitting Animation Frames
9:38 Instancing Scenes in Levels
10:21 Collision Shapes
12:04 Player Movement Overview
13:55 Physics Processing in Scripts
14:59 Get Input Direction
17:20 Input Actions Setup
19:29 Moving Player with Move and Slide
21:33 Testing Character Movement
23:06 Animating Character
27:14 Other Directions for Idle and Walk
29:09 AnimationTree Controlling Animations
33:47 Character Starting Direction
39:07 Traveling Animation State Machine
40:42 Map Building with tilemaps and Tilesets
43:08 Random Tile Variations
44:40 Tilemap Layers
46:37 Manual Sorting Priorities
47:23 Tilemap Physics & Collision Shapes
53:52 Follow Camera
55:19 Making Cows - Walk and Idle States
59:42 Timers and Signal Callbacks
1:02:59 Auto Y Sorting for Scene
1:03:55 Creating Extra Objects
1:05:57 Region Select for Spritesheets
1:07:28 Nodes Disappearing from Transform Position
1:08:48 Building a House with 3 Tilemap Layers
1:12:53 Wrapup

Beat Thee by Alexander Nakarada | www.serpentsoundstudios.com/
Music promoted by www.free-stock-music.com/
Attribution 4.0 International (CC BY 4.0)
creativecommons.org/licenses/by/4.0/

All Comments (21)
  • @willisplummer
    In Godot 4.1, they've changed the way the state machine transition arrows work in the AnimationTree flow chart (where you draw the lines to show which states transition to which). They now default to automatic, which causes it to cycle through all of the animations really fast and basically look like nothing is happening. To fix, select the arrows between idle and walk and in the Inspector, under Advance, change mode to Disabled
  • @bungofungus
    37:37 for people using the full release of godot 4, the ≠ used in the code can be typed out using !=. They do the same thing, but the engine can read !=
  • Great tutorial, thanks for sharing. There is a minor problem with walking diagonally (walking in two directions at the same time, e.g. up and left). The input direction vector will be a bit longer than the vector when only walking in one direction. The effect will be a slightly higher walking speed when walking diagonally. This is because the diagonal d in a square is d = a * sqrt(2) when a is the length of the squares sides. To fix this problem, when calculating the velocity of the character, instead of "input_direction * move_speed" use "input_direction.normalized() * move_speed".
  • @quintinwood4397
    A quick reminder with movement vectors is to use the normalized() function. So when we made the input_direction for the player, just add a .normalized() at the end of the closing parenthesis : var input_direction = Vector2( Input.get_action_strength("right") - Input.get_action_strength("left"), Input.get_action_strength("down") - Input.get_action_strength("up") ).normalized() if you don't do this you'll notice your player moving a lot faster if you walk diagonally. Normalizing makes it where your speed is always 1 rather than the 1.4 you get otherwise.
  • Hey! Godot 4 actually has a bunch of new Input methods that I think you should check out in the docs! I haven't watched the whole video yet (work) so forgive me if you mention this in the video. Anyways, two new ones that are very useful are Input.get_axis and Input.get_vector. These are basically shorthand for Input.get_action_strength("positive action") - Input.get_action_strength("negative action") but in one function. Input.get_axis is for platformer-type movement (left and right) while Input.get_vector is for top-down type movement (up, down, left, and right). You just pass the positive ("right") and negative ("left") actions and it returns the proper input. Great video so far! I can't wait to finish it!
  • @GraniteFaun
    I like the tut so far, it's nice to get into 4.X from 3.X but, just leaving this here if people might into problems: 33:34 They changed up the autoadvance a bit with 4.1.1 I think, it's active by default it seems (under Advance -> Auto). And you have to set it to "enable" on the links between walk and idle animation for the Dude to idle and not just spazz between the two states indefinitely. 36:27 also I've noticed that I had to set the blend values to the full ends ( 1.1 , -1.1) or it creates some funky results of animation blending. The Default behaviours are probabyl set differently in 4.1.1 Okay nevermind the blend mode has to be changed... xD 43:38 You can also do that with the rektangle tool, when you draw a rectangle you just get a few of the special tiles.
  • @crack64
    This tutorial is fantastic, you get into exactly the right amount of detail for everything, love it!
  • @Zantom07
    Thanks for the video, very informative! I'm new to Godot but not new to game dev, so this was a great way to get up to speed with how Godot works differently from other engines.
  • @veldtwalker
    Might have been me, but a couple notes since some stuff have changed since this was recorded. So hopefully this helps some people. I am using - v4.0.beta13 - Some of the inspectors have changed slightly, so just open up some the other caret/caron menus ">, v" (not sure the term, haha) and you might find the option you are looking for. - Animation Tree for each connection "->-" between idle and walk, click on them, Inspector>Advance>Mode, Set to "Enable", keep the "Start"->-"Idle" as "Auto" || Looking at the tutorial I noticed the interface for AnimationTree was different, so poking around and that is how I fixed it. - As pointed out in the comments if you can't easily type ≠ you can type != instead (plus some dummies ruined ≠ ) I may have missed it being mentioned but for the cow animations you add "Animation>[animation]" and not "BlendSpace2D" like you did with the playercat animation
  • @Moohasha1
    I followed a tutorial series for Godot 3.2 that included how to use a TileMap and TileSet. When I tried to use one in Godot 4.1, it was completely different and I had no idea what to do. Thanks for explaining it!
  • @daniridao
    I've been testing godot 4 for a bit, so I new all this stuff, but I have to say I could have used this video when I started with Godot, or something similar back then. It comprises a lot of different things that are very useful for beginners, so this is a 5/5. Very much appreciated the effort, it's great seeing people making Godot tutorials!
  • @PlatedGuy
    Last time I tried game dev Godot was in some early 3.0 alpha I think. I saw Godot 4 release and some spark inside me lightend up and made me try gamedev again. Thank you for your tutorial man ❤❤
  • @andrewg2998
    Just simply a great tutorial. Please make more godot game dev content in the future!
  • @codyclarke24
    39:54 If you are having trouble getting your animations to travel between states in 4.1.3, adjust the call by added an additional parameter of false: state_machine.travel("Walk",false) state_machine.travel("Idle",false)
  • @adrianpinto1011
    Excellent tutorial, just what I was looking for! Thank you.
  • Fantastic intro video, I'm a first timer and followed along no problem. Thanks! :D
  • @IscariotSolia
    Thank you for doing godot tutorials, I really hope you do more in the future.