Introduction

In this intermediate to advanced-level series, I’ll guide you through the creation of a simulation game about resource gathering, crafting items, and building and powering machinery.

I’m François, also known as Razoric, co-author of Shader Secrets, PCG Secrets, and our open-source AI framework for Godot. I’ll be your instructor for this series.

In this chapter, we’ll cover:

In the next chapter, which will focus more on the user interface, we’ll cover:

Pre-requisites: this series assumes you’re comfortable with Godot, GDScript, and object-oriented programming.

As always, we welcome your feedback and questions, which you can leave directly under any lesson on the course’s platform.

Downloading the project

You can find the fully completed project on the Godot 2D Builder as well as a starter Godot project. You can also find them inside the course’s downloads.

The starter project contains:

What you’ll create

Let’s quickly look at what you’ll create in the complete course. I invite you to open the final project and test it to see how it plays for yourself.

First, you can move about the map with the WASD keyboard keys and interact with the world and inventory with the mouse.

You can toggle the inventory with E. The inventory includes the crafting system and toggling dragging of inventory items.

You can interact with entities in the world that have an inventory like furnaces, generators, and chests with a Left-click.

You can remove entities from the world by holding down the Right-click over them. That is unless they need a tool, like trees that need an axe. In that case, you must equip the appropriate tool to gather those.

You can assign items to your item bar at the bottom of the screen and press the corresponding number key on your keyboard to select them. When you selected an item, you can Left-click on a grid cell around your character to place it in the world.

You can place power generators, wires, and machines that consume energy to build a factory.

Engines require fuel to burn and generate electricity, which travels down wires to machines like the battery or electric furnace, the latter of which takes ores to generate metal ingots for further crafting.

That’s a brief look at the game we’re trying to build here. We’ll cover more mechanics and subtleties as we go.

Note that in this chapter, we won’t build the inventory or the user interface. We’ll focus on building the game’s foundations, particularly the power system that allows electricity to flow between machines.