Let's Learn Godot 4 by Making an RPG - Part 1: Project Overview & Setup 🤠
Tags: godot, gamedev, tutorial, learning
Published: 2023-06-21 18:20:22


## Let’s Learn Godot 4 by Making an RPG — Part 1: Project Overview & Setup 🤠

Have you ever wondered what made Arthur Morgan from Red Dead Redemption so iconic? For me, it’s the nostalgic feeling that arises when I get to play in an era that I would never be able to experience in real-time. It’s the magic of fantasy, and that is what brought me to create the rootinest-tootinest 2D RPG game tutorial series out there, made with no other than Godot 4 and GDScript. This tutorial series aims to teach you how to make a game from start to finish, and ultimately show you all the things that you need to know as a beginner Godot developer!

So what exactly is this game that we will be creating about? Well, Dusty Trails is a Western-esque, Wildwest RPG in which our player can run around a full map, whilst shooting and looting enemies and completing quests. Enemies will spawn randomly, and they will roam and chase the player if they are close to the player. We’ll also have NPC’s and a Shopkeeper, which will give our player quests and sell pickup items to our player.

![Figure 1: Overview of our game and the entities.](https://cdn-images-1.medium.com/max/4486/1*-zfbHXUIUAwglVsVBsq5Cg.png)
> Figure 1: Overview of our game and the entities.

---

>  ***What is an RPG?***
>  An RPG, or Role-Playing Game, is a genre of video game where players assume the roles of characters in a fictional setting. Players take responsibility for acting out these roles within a narrative, either through literal acting or through a process of structured decision-making regarding character development. RPGs often involve story-telling, world-building, and character progression.

---

**This tutorial series will cover the following aspects:**

* Player Animations, Movement, and Statistics

* Complete Game UI

* Pickups and Consumables

* Enemy Movement, Animations, and Statistics

* Enemy Random Roaming & Spawning

* Random Loot Drops

* Player & Enemy Death, Damage, and Attacks

* XP and Leveling

* Basic Customizable NPC with a Quest

* Scene Transition (Location Changing)

* Game Music & SFX

* Persistent Saving, Pausing, and Loading System

* Game Map with Collisions & Camera

* Simple Shopkeeper

* Project Exporting

Please note that this tutorial series is meant for beginner GDScript & Godot developers. Also, this tutorial uses [Godot version 4.1.1](https://godotengine.org/download/windows/) — so if you run into errors when using a newer version, please don’t panic as this might happen. I’ll try and update this project as much as possible to work with newer versions of Godot. I’ll also link the sectional source code to each part at the end of the individual chapters so that you can easily compare the projects’ code to yours.
---
>  **WHAT YOU WILL LEARN IN THIS PART:**
>  · How to navigate through the Godot Editor.
>  · How to change your project settings, as well as work with node properties.
>  · How to create scenes.
>  · How to add nodes to scenes.
---
## EDITOR OVERVIEW

Before we get crazy and begin coding, we first need to understand the layout of the Godot Editor. If you are already acquainted with the editor, you can skip to the [Project Setup](#_Project_Setup) section of this part, but if not, I’d advise you to take a tour of the editor with me.

![Godot RPG](https://cdn-images-1.medium.com/max/3840/1*7Ujh0rlGcyZw9lHKxEUTCg.png)

If you haven’t installed Godot yet, head on over to their [website ](https://godotengine.org/)and download the latest version that is available to you. Once it’s done downloading, extract the file, and since Godot does not require any installation, you can just drag this to where you prefer to have it stored on your computer — or open it directly from your Downloads folder.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*gUVUQamJRvUWLIXn8Ro0Nw.png)

Launch the executable, and you’ll be met by the Project Manager window. Here you can create new projects, load existing projects, or scan entire directories to import multiple projects.

![Godot RPG](https://cdn-images-1.medium.com/max/3840/1*gIOScMyYipmslqA9UDZvKw.png)

On top, you will see a menu called “Asset Library Projects”. This is where you can download and find projects, templates, or demos that are made for Godot by community members. It’s similar to other online marketplaces such as Itch.io, Unreal Marketplace, or the Unity Asset Store. The only difference is that everything here is free.

![Godot RPG](https://cdn-images-1.medium.com/max/3840/1*vHIVNOakGSyKciC3tZQI8g.png)

To create our project, we’ll click on “New Project”, and a window will appear where we will choose our project’s save location as well as give it a name. I named mine Dusty Trails but go ahead and call it whatever you want.

![Godot RPG](https://cdn-images-1.medium.com/max/3840/1*R6W427m5qVBdwMFQEHCsZQ.png)
>  ***What are the rendering modes?***
>  **Forward+ mode**, which is for more upscaled game projects that are more graphics and rendering intensive.
>  **Mobile mode,** which is generally used for mobile games.
>  **Compatibility mode,** which uses the same renderer as Godot 3, meaning the graphics and rendering quality is lower making it more suitable for older or more low-spec devices.

You can start your game either in Compatibility or Forward+ mode — it just depends on if your Graphics Driver supports the Vulkan version provided with Godot. You can read more about the new rendering updates [here](https://docs.godotengine.org/en/stable/about/list_of_features.html#rendering).

Select “Create & Edit”, and you’ll be magically transported to the Project Window. On top, we have our workspaces, which is the space in which we complete our tasks. 3D will always be active by default. If you click on the other options, you can switch between the different workspaces.

![Godot RPG](https://cdn-images-1.medium.com/max/3840/1*mYbocY2AnVpCLU1koe1aWw.png)

![Figure 2: Mouse Inputs for Workplace Navigation](https://cdn-images-1.medium.com/max/2560/1*JhWxUA6JkYrR-ScXzoAc3Q.png)
> Figure 2: Mouse Inputs for Workplace Navigation

---

>  ***What are the workspaces for?***
>  The **2D** **workspace** is used to edit and view 2D scenes for 2D games.
>  The **3D** **workspace** is used to edit and view 3D scenes for 3D games.
>  The **Script** **workspace** is the code editor where we write, edit, and view our scripts.
>  The **AssetLib** **workspace** is the Asset Library Projects that you can use in your projects for free.

---

The panel on the left side of the window is the Scene Dock. This lists the content of the current scene that you have open, and you can also add new nodes to your scene in this dock. A scene in Godot is the main holder or container for nodes, and nodes are the main building blocks of your game.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*ISkFzeiTmUI2QW8jojoUpg.png)

Different nodes have different functions, for example, collision shapes and animation sprites each have their purpose, so having the ability to combine them in a singular scene allows us to create components for our game with more complex functions. Scenes can also instantiate other scenes, for example, having enemy scenes in your world scene. I recommend you go and have a look at the Godot Documentation on [Nodes & Scenes.](https://docs.godotengine.org/en/stable/getting_started/step_by_step/nodes_and_scenes.html)
>  ***What is a Scene and a Node?***
>  A scene is a container that holds a collection of nodes arranged in a hierarchical structure — such as our Player or Enemy. A node is the basic unit within a scene that makes up the scene — such as a Sprite or Camera within our scene.

![Figure 3: Example of nodes and scenes. View the online version [here](https://app.mural.co/t/godot5664/m/godot5664/1680196108691/c8c74015cd7e5090492ac132dd78a64656af7fcc?sender=christinecoomans304568).](https://cdn-images-1.medium.com/max/10754/1*TRgp3OghwGFJcArkMFtzTw.png)
>Figure 3: Example of nodes and scenes. View the online version [here](https://app.mural.co/t/godot5664/m/godot5664/1680196108691/c8c74015cd7e5090492ac132dd78a64656af7fcc?sender=christinecoomans304568)

The other panel is called the Import Dock, and this is where you can set or edit the properties of assets such as images, fonts, and audio files that you’ve added to your project folder, and then you can reimport them with those properties saved.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*Lc3anajbTJyBXNskjlzOgA.png)

Below the Scene and Import Dock, you will find the FileSystem panel, which is where you’ll manage your project files, folders, and assets. You can drag new assets into this panel to import them into your projects, as well as add new folders, scripts, scenes, and more.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*K_ef_VGggbh2eSqcqQLXsg.png)

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*pmM8e7_biQ4cP-bhypYG6A.png)

The panel on the right side of the window is called the Inspector Panel, which is where you can view and edit the properties of currently selected nodes.

![Godot RPG](https://cdn-images-1.medium.com/max/3832/1*_R8sli1KazBjgblybngBmA.png)

The Node Panel next to it is where you can hook up [Signals](https://docs.godotengine.org/en/stable/classes/class_signal.html) and add [Groups](https://docs.godotengine.org/en/stable/tutorials/scripting/groups.html) to nodes. Groups can be used to group types of scenes or nodes together, for example, our NPCs, so that our player knows how to interact with those nodes. Signals can be used in many cases, for example, to notify the game that a button has been pressed or that an animation has finished playing. This allows us to then tell the game what to do when certain events have occurred. Most nodes have built-in signals, such as buttons and animation players, but we can also create our own custom signals. We’ll explain these concepts a bit more in-depth later on.

![Godot RPG](https://cdn-images-1.medium.com/max/5766/1*v8AKR0fXM621n3rwXzIJ0Q.png)

![Figure 4: Custom Signal (Left) & Built-in Signal (Right). View the online version [here](https://app.mural.co/t/godot5664/m/godot5664/1680250496630/18827fb6f27e1d2caa971f8f4436cfe65ee62e06?sender=christinecoomans304568).](https://cdn-images-1.medium.com/max/4250/1*pDhl_GpB1aJepScUixrv-w.png)
> Figure 4: Custom Signal (Left) & Built-in Signal (Right). View the online version [here](https://app.mural.co/t/godot5664/m/godot5664/1680250496630/18827fb6f27e1d2caa971f8f4436cfe65ee62e06?sender=christinecoomans304568)

Above the Inspector and Node Dock, you will see the options we will use to play, pause, restart, or stop our scenes. This is where we will launch our game to test it.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*I0lhRvgkrHiuAxZL3UzW_g.png)

At the bottom of the Editor window, there is the Output Panel, the Debugger Console, the Audio Mixer, the Search Results Panel, and the Animation and Shader Editor. They are collapsed by default to save screen space, but if you click on them, they will maximize. Certain nodes that are customizable, such as the tilemap or animation-player node, will add new options to this window.

![Godot RPG](https://cdn-images-1.medium.com/max/2580/1*fWM-iJIKNRNcWvTNhsSmHw.png)

![Godot RPG](https://cdn-images-1.medium.com/max/2580/1*0pwT0-jYzcbrOZUebP1xdw.png)

**Let’s go over each of the pre-existing options:**

* The **output** **console** will return printed messages or notifications that we add to the code for testing.

* The **debugger** **console** is used for — you guessed it — debugging and error handling.

* The **audio** **mixer** is used to edit audio files.

* The **animation** **editor** is used to create animations for the Animation Player node.

In the Ribbon or Menu bar above, you have a few options. Here you can manage your scenes underneath the Scenes tab. Scenes can be added, saved, opened, or closed.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*B2SkPxx_yfa_n-JkWkq5Gw.png)

You can manage your project settings and properties (such as input actions, window size, autoload singletons, etc.) underneath the Projects tab. You can also quit your Project Manager window from here. This is also where we will export our project from.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*YEJwr7PoDK6PyWh8eVqk2g.png)

You can enable or disable debugging tools in the Debug tab, for instances where you want to say, make collisions visible so that you can see if collision events are executing during gameplay.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*aIA2fnjBjv2tkp_9aSP6TQ.png)

The Editor tab allows you to change settings related to the editor, for example, you can change its current layout or theme. You can even take screenshots of your current window.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*kEtxAeicSyGBBWUFlp285Q.png)

And lastly, the Help tab gives you quick access to the Godot 4 documentation and community forum. If you’re feeling a bit more comfortable with working with the editor, we can go ahead and set up our project.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*hc-9FtpQ0bzOBww9n4TpBQ.png)

## PROJECT SETUP

Before I start a project, I generally make a list of steps (or checklist) that I need to take to make the game. This is generally just an outline, and I make different amendments to these steps as I go about actually making the game.

One thing to remember about game development is that this is not supposed to be a linear journey. Everyone goes about this differently, but if you’re interested in what my steps usually look like, you can view this example of the Dusty Trails project’s steps [here](https://docs.google.com/document/d/1486cjDI0bCL2c9y1RodzRv4qfyuKHxLhHe7jht0C744/edit?usp=sharing) and use it as a boilerplate for your own game (or don’t, it’s 100% up to you). I’m also using [this color palette](https://www.color-hex.com/color-palette/7269) that I found online for this game, just in case you were wondering where I got my color scheme values from!

Now, onto the setup. The assets you will need for this section can be downloaded [here](https://drive.google.com/file/d/1lgP59rO2Tn5qmqy6YJ49-hs7XqqV3EKg/view). The credits for these free assets can be found on my [GitHub repository.](https://github.com/christinec-dev/DustyTrails_RPG_Parts/tree/main) Once you’ve downloaded your assets, extract the file, and drag it into your FileSystem panel. We can also go ahead and delete the default icon.svg and README.MD files that are present in your project.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*tCvX2YKqyA4OV_N3Lg3bfA.png)

Right-click on the panel and let’s create three new folders: Scenes, GUI and Scripts. The Scenes folder will contain all of our .tscn files (player scene, NPC scene, map scene, etc.), the Scripts folder will contain all of our .gd files, and the GUI folder will contain all of our UI element scenes (menus, popups, HUDs, etc).

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*r_VC7ZN3e-yHD1xbckHGVQ.png)

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*WF914b7w7BlXEKPKu8QzgA.png)

In the Scenes folder, let’s create our first scene, which will be our Main Scene. The Main Scene is the scene that will serve as the core container for our game elements. It is here where we will add our map, characters, and items so that we can play the game. The Main Scene is also the one that runs automatically when the game launches.

To add a scene, you can right-click on the FileSystem panel and add it like we added our folders, or you can click on the plus icon in our Scene Dock. This is the quicker way, so I will do it that way from here on out.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*PR0sZ1pT_iyHyRVO2J9vFg.png)

You will see that it will prompt you to select a node. The node that you choose here will be the root or parent node. The root node is the highest node in the tree structure and has no parent.

We can always change this node later on, so don’t worry if you choose the wrong one! We need to select [Node2D](https://docs.godotengine.org/en/stable/classes/class_node.html) as the root node. The Node2D node is the base node for a 2D game. We usually use this node in our Main scene.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*0pQ8NNwn2YD20y4FacG8QA.png)

You can also automatically choose this node to be your root node in the Scene Dock “2D Scene” option.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*yL_eLWgRbGkFrjIeK1fZGg.png)

You will now see that a Node2D node has been added as our root, but our Scene hasn’t been saved yet. Save it in the Scenes menu above or use the shortcut CTRL + S. Save the Scene as “Main” in your Scenes folder.

![Godot RPG](https://cdn-images-1.medium.com/max/2128/1*Ykk0oEhHHn7kxjGe7Z1OZw.png)

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*Vio0J5QsuE6VGifYmZdVwQ.png)

Double-click on the Node2D root node to rename it. Let’s rename it to match the name of our scene, just for simplicity.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*Q2vRfdPR9EtXty_VkB_0AA.png)

Now we can add children nodes to our root node. You can do this via the plus icon again. Remember, we are making a 2D game, so nodes that end with “3D” will not work with our node! Let’s add a Sprite2D node for now because I want to show you something. Take note that any node you add will be added to your recent panel in the node menu, so you can easily select it from there next time without having to search for it!

![Godot RPG](https://cdn-images-1.medium.com/max/2846/1*j3R7EevLEJ1nwJDqNyoRHw.png)

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*BHx-XAu9hKsRJxEaGIFUgA.png)

![Godot RPG](https://cdn-images-1.medium.com/max/3264/1*yLaGCXYKwUF4wF5xWkqAig.png)

In the 2D workspace (because we are making a 2D game), select your Sprite2D node and press F on your keyboard to focus on your selected node. With your node selected, in the inspector panel, you will see the option for texture. This is our sprite’s image.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*4jpOtsgh9t1ZkXqIU7Jpig.png)

If you go into your assets folder, you can drag any image you want into that texture property.

![Godot RPG](https://cdn-images-1.medium.com/max/3838/1*DVT32px4ywdWccIpBMkkSg.png)

If you zoom in on your sprite, you might notice that it is a little bit blurry. This won’t do, but luckily, I have a fix for you.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*ffJbdOG6Rxnu0P9CYgfbHw.png)

In your projects settings option underneath Project > Project Settings, change your Textures Rendering from Linear to Nearest. This will scale up our texture rendering so that image assets are always high quality.
>  ***What is texture filtering?***
>  Texture filtering is a technique used in computer graphics to improve the appearance of textures when they are applied to 3D models or 2D images. It becomes particularly important when a texture is scaled, rotated, or otherwise transformed.
>  Choosing the correct texture filtering mode is essential for improving image quality, performance, and the overall visual experience in both 2D and 3D graphics.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*ViM19AAg9KhT0JIw8IrSZQ.png)

Your sprites should now be clear.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*kJu1G7sK83W0mj0RPFqU1w.png)

The last thing we need to do for this part is set our Main scene as well, our main scene. In your Project Settings, underneath Application > Run, you can set your Main Scene here to be our newly created scene. This will then run this scene whenever we run our game. Later on, we will change this to be our menu scene, because you want the player to be greeted by the start menu instead of just throwing them into the game.

![Godot RPG](https://cdn-images-1.medium.com/max/2000/1*7TCldTn261DbRHlPt429-A.png)

Congratulations, you’ve learnt how to navigate through the Godot Editor, as well as work with nodes and scenes — which are the core fundamentals you’ll use throughout your game It would be good practice for you to create your own [GitHub repository](https://docs.github.com/en/github-ae@latest/get-started/quickstart/create-a-repo) for your project so that you can make regular backups of your project.

In the next part, we will set up our game character, i.e., our player, as well as add the functionality to move them around our game. That means more nodes, and you’ll get to work with Scripts for the first time! Remember to save your game project, and I’ll see you in the next part.

**You can also use the official [Git Plugin](https://github.com/godotengine/godot-git-plugin/wiki/Git-plugin-v3) from Godot, but as of July 2023, the Git plugin hasn’t been updated to work with Godot 4.1 and later yet.*

<a href='https://ko-fi.com/J3J2LP2U5' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi2.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>

---
### FULL TUTORIAL

![Godot RPG](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pd9n6khb9jtaj0bynp7e.png)

The tutorial series has 23 chapters. I’ll be releasing all of the chapters in sectional daily parts over the next couple of weeks.

If you like this series or want to skip the wait and access the offline, full version of the tutorial series, you can support me by buying the offline booklet for just $4 on [Ko-fi!](https://ko-fi.com/s/19c32424e5)😊

You can find the updated list of the tutorial links for all 23 parts in this series [here.](https://oops-i-devd.gitbook.io/oops-i-devd/godot-tutorials/dusty-trails/tutorial)