Sites


Godot Game Engine

Project setup

From a producer point of view, making a game is not just having a good idea, but also making it real. This will often involve several people (at least some who program and some that do the artwork). As the project grows, needs of organization is increasing. This will sometimes result in a director application or at least some practice accordance.

In Godot, the first organization concept is the Project. Here, a project is basically a configuration file that will hold some of the game properties. From there, a few commons steps will be needed to quickly get a running game that could be used as a first prototype of our idea.

In this section, we will try to keep hands on the keyboard as much as we can. To demonstrate the basics step of the game production, we will use a simple Flappy Bird clone example. We will call it HappyBat, and it will then be up to you to adapt it to your own project. 

If you are impatient to see game samples, you can have a look at the demos provided with Godot for example the classical Pong in the demos/2d/pong folder. But for this, you'll need to know how to run them in a project context.

Download

Get a Godot binary for your desktop platform from www.godotengine.org.

The Server variant is a headless version (without GUI) meant for remote computing.

Create the project

So, once the idea is clearly defined and that we decided to use Godot, the first thing is to create the game project.

  1. When you launch Godot, the first window you'll see is the Project Manager. This will give you a quick access to all the projects you are working on.
    Godot project manager
  2. In your file browser or command line, create a new folder for your project. All the ressources of your game will need to be added inside. You can alternatively create it via Godot's file browser in the next step. A project should have its own folder as all its contents will be part of the internal filesystem.
  3. Click the New Project button and use the Browse button to select the folder you just created (or alternatively create one now).
  4. Give a project name which is completely free. It is used by default as the title of your game window, so it should likely be the name of your game.
  5. Once this is done, the project appears in the list and the folder has been populated with some files: engine.cfg which contains default properties for the game, an icon.png file to visually identify the game and an associated icon.png.flags to set some processing flags for the icon.
  6. You can then select the project and click Edit (or double click on the project). You are directed to the editor.

After this first step, the engine.cfg contains minimal information.

[application] 
name="HappyBat"
icon="res://icon.png"

Afterwards, if you already know the kind of ressources your project will need, you can create subdirectories in your game folder right now. There could be a scripts one, as well as assets which could include textures, sounds, musics, backgrounds, sprites… depending of your needs. Your project will use the filesystem as its main organization method, so use your preferred method and tools to organize your assets the way it works best for your team.

If your project manager is cluttered with too many entries, you might want to find a quicker way than looking to each one by one. You can basically use two approaches:

  • use the search engine provided in the project list. It will select the project names or paths matching as you type
  • select the projects you don't need anymore (there will certainly be some in the few hours if you follow us), and click the Erase button on the right. This will clear it from the list but data and ressources will be kept, so that the project can be reopened later with the Import option of the Project Manager.
If you want to import all projects of a folder at once (e.g. the official demos), choose Scan in the Project Manager, choose the folder where projects are stored and click Run.

Define game settings

Once the project is created, we can immediately work in the editor or begin by defining the game settings available in the  Scene > Project settings menu. Here, we will find many predefined properties. As you can see in the window title bar, this window is a graphical editor for the engine.cfg file so that changes made here will be saved into that file and inversely.

Actually, we can see only two properties activated: name and icon in the application category. But there are many other possibilities. Especially in the Display category, we could define if the game launches in fullscreen mode, its default orientation or sizes and so on. Just tick the checkbox before the property name to activate it and change the value in the right column if necessary.

For example, to support fullscreen, do the following:

  1. Enable fullscreen mode by clicking the box at the left of the fullscreen label. This will make fullscreen mode available.
  2. If you set it on in the Value column, it will be the default display mode in which the game will be launched.

This is what our engine.cfg looks like in the first step

[application] 
name="HappyBat"
icon="icon.png"

[display]
fullscreen=false

and after second step

[application] 
name="HappyBat"
icon="icon.png"

[display]
fullscreen=true

Saving is automatically done as you close the window.

It's important to keep options consistent with other options or design decisions. If you enable fullscreen, you may think of the way your game may adapt. If you enable touchscreen emulation, you should take care to make it easy to use for users…

We will need to come often to this window, for example to define runtime options and improve performance, but also for more basic thing like the mandatory definition of a main scene, as we will see in the next chapters.

Godot is storing information in text files when it is possible. That way, it makes it easier to maintain, and to share, even during production time, especially when using a version control system like git or mercurial.

Il y a une erreur de communication avec le serveur Booktype. Nous ne savons pas actuellement où est le problème.

Vous devriez rafraîchir la page.