1. Introducing Godot: Why Migrate? – Moving from Unity to Godot: An In-Depth Handbook to Godot for Unity Users

© Alan Thorn 2020
A. ThornMoving from Unity to Godothttps://doi.org/10.1007/978-1-4842-5908-5_1

1. Introducing Godot: Why Migrate?

Alan Thorn1 
(1)
High Wycombe, UK
 

This book helps you convert easily from Unity to Godot. It assumes you’re already familiar with Unity (at least the basics) but are completely new to Godot. This book translates Unity terminology to Godot terminology. Plus, it features comprehensive tutorials and guides to get you started quickly in Godot. Godot is a completely free and open source game engine that’s growing rapidly in popularity, acceptance, and adoption, especially for independent games. More and more developers worldwide are happily joining the Godot community to make great games together, and there’s never been a better time to start learning. In this chapter, we explore what Godot is, how to download and install it, and strong reasons why we should use it compared to other engines, like Unity or Unreal. So let’s get started.

This book was written for the Godot 3 release cycle. This includes 3.0, 3.1, and later releases in the 3 cycle. You may be using a later release than the one featured in this book; but most of the content presented here should be good for the near future.

Getting and Installing Godot

If you’re using Unity, you probably already know what Godot is! Godot is a game engine. It’s software for making games and interactive experiences. It features a world creator, a graphical interface, a code editor, a complete API, and build tools for deploying your game to different platforms as a stand-alone application. In short, imagine a game engine that’s very similar to Unity in its ease of use, but it’s completely free and open source. That’s Godot.

You can download Godot from its home page https://godotengine.org/. Simply navigate a browser there and click the Download button from the top menu. This takes you to the Download page. From there, be sure to download the Godot Mono Version C#. See Figure 1-1.
Figure 1-1

Download and Install the C# Godot Version for Your Operating System

Multiple versions of Godot are available for download, all for multiple operating systems. Specifically, Godot natively supports Windows, Mac, and Linux; and it’s available in a Standard Version and a Mono Version. The Mono Version lets you make script files in the C# scripting language – like Unity – while the Standard Version supports Godot’s custom language, GDScript, only. This book uses the Mono Version and writes script files in C#. Using C# not only makes the transition from Unity to Godot simpler; it’s also a great language offering premium level runtime performance. So I recommend choosing the Mono Version in all cases. Godot features full support for C# 8.

Why Use Godot?

So why use Godot at all? That’s a good question! After all, there’re tons of apparently free and spectacular game engines available today. For example, you can download Unity, Unreal, or Lumberyard right now and make games with them. These engines are well documented, widely used, and are responsible for many well-loved games on the market. So why use Godot instead? This section lists important reasons for choosing Godot as opposed to its alternatives.

Godot Is Free

Godot is completely free of cost. You pay nothing for using Godot or for selling your Godot games. Really. This is actually very different from Unity and Unreal even though many people think they’re fully free. Unity and Unreal are, in fact, not completely free. True, you may download and use them free of charge, but you’ll need to pay up if you release a game commercially and its revenue surpasses a specific threshold. The amount differs per engine. But let’s put this into perspective as of November 2019. For Unity, if your company earns more than 100,000USD in a single financial year, then you’ll need to purchase a Unity Professional License. This costs 125USD per month. See the Unity FAQ page here: https://unity3d.com/unity/faq/2491. In future, this pricing structure could increase! Similarly, for Unreal Games, you’ll need to pay 5% of your gross revenue (before tax) after you earn 3,000USD (see www.unrealengine.com/en-US/faq). This could amass to a huge sum if your game becomes successful! So, neither Unity nor Unreal is fully free. But Godot is. You pay nothing for using Godot, ever. Simple.

Godot Is Open Source

Godot is completely open source. This means you can download, inspect, edit, and compile its source code immediately. Plus, you can use and redistribute any derived versions you may make. Open source should be reassuring to a game developer. This is because their work won’t depend on a closed foundation of proprietary code that’s maintained by a third-party developer whose agenda may be very different to yours. The engine is licensed under the MIT License, which is summarized by Godot:

You are free to download and use Godot for any purpose, personal, non-profit, commercial, or otherwise. You are free to modify, distribute, redistribute, and remix Godot to your heart’s content, for any reason, both non-commercially and commercially.

Godot website (https://docs.godotengine.org/en/3.1/about/faq.html)

This book doesn’t cover compiling Godot from source. It assumes you’ll be using a fully built version that’s downloadable from the Godot website. For more information on compiling from source, visit the Development website here: https://docs.godotengine.org/en/latest/development/compiling/getting_source.html.

Godot Is Evolving

Godot is always evolving. It was established in 2014 by software developers Juan Linietsky and Ariel Manzur, and it’s continued to grow in popularity and features year after year. Godot has a full range of features that any Unity developer will recognize and expect from an engine, plus really interesting features that may pleasantly surprise you. Godot supports Light Baking, full Global Illumination, Navigation Meshes and Path Finding, Visual Scripting, Constructive Solid Geometry (CSG), and 2D functionality for sprites and User Interfaces. Godot currently supports two scripting languages, namely, GDScript and C#; the former is more established in the engine, while the latter is newer. Godot is actively maintained by a strong development community, and many people financially support the project through Patreon, here: www.patreon.com/godotengine.

Godot Is Supported

Godot is strongly supported by a growing community of game developers, educators, and creative evangelists. Together they have a ton of experience. They have a shared purpose in promoting Godot, helping each other, and helping newcomers learn the tools. Online documentation, books like this, videos, and video courses are all available to help you learn Godot from scratch and to continue using Godot professionally. Godot has comprehensive online documentation that should be used frequently as a reference, in conjunction with this book, as you progress chapter by chapter. It’s available here: https://docs.godotengine.org. Furthermore, you’ll also want to check out https://godotsharp.net for a C#-oriented reference and also my YouTube channel BeIndie.biz (www.youtube.com/channel/UCF1X3sTIj-pCIcR_C2wg6SQ/) for regular tutorials on Godot.

Godot Is About Games and Experiences

If you attend game conferences, you’ll find a growing community of game developers discontented with the strategic direction of both Unity and Unreal right now. These developers are seeking alternative options, and understandably so. There’re several important reasons for this search worth mentioning here. Some consider Unreal too expensive and technically burdensome, especially for small development teams with less specialist needs. Some see Unity as focusing too heavily on architectural and automotive visualization features at the expense of games. And some feel that both engines have just gotten too wrapped up in the arms race toward photorealism, the sense that both are “growing too big to fully understand the needs of independent developers and small teams.” There’s a sense, either real or perceived, that in both Unreal’s and Unity’s most recent growth (especially in the latter), there’s also a significant detachment from their original user base. In this search, then, many people are now finding their ideal in the Godot engine – driven by and built by the game development community. Godot is first and foremost a game engine. Its structure, tools, feature set, and build options have games (and interactive experiences) in mind from the outset. Its source code is open and its development road map are constantly under an open discussion by the developer community. The full development road map can be found on GitHub here: https://github.com/godotengine/godot-roadmap.

Godot and C#

As a Unity developer, you’ll be familiar with C# for scripting – unless you use a Visual Scripting plug-in like Playmaker. C# is a versatile, powerful, and easy-to-learn language that delivers comparatively excellent runtime performance. And so it’s likely you’ll want to continue using it on migrating to Godot. After all, you probably don’t want to learn a completely new language and syntax just because you’re moving to a new engine. Thankfully, you can bring your C# knowledge with you! This is because the Godot 3.1 Mono Build (or higher) supports C# as a scripting language. However, there are some important limitations to using C# that you should know. These limitations may be ironed out in later releases, but as of 3.1 they apply:
  1. 1.

    You can’t build C# projects for the Web or mobile devices.

    Godot lets you build games for many platforms, including desktop, Web, and mobile – using the GDScript language. However, C# projects build only for desktop systems – both Web and mobile are currently excluded. C# support may be added soon, but this is in development.

    You can keep track of the development status for these features, as follows:

    Android

    https://github.com/godotengine/godot/issues/20267

    iOS

    https://github.com/godotengine/godot/issues/20268

    HTML5

    https://github.com/godotengine/godot/issues/20270

     
  2. 2.

    You won’t get C# code completion or syntax highlighting for the native script editor.

    Unlike Unity, Godot provides an integrated text editor for creating scripts as part of the main editor interface; see Figure 1-2. This is the script editor window. You can use this window to type C# script files, but it lacks full language support. It’s designed for GDScript. So you won’t get full syntax highlighting or code completion or any coding assistance for C#. To get this, you’ll need to use external code editor! This book will show you how to use Visual Studio Code with Godot – complete with syntax highlighting and code completion. Visual Studio Code is supported on Windows, Linux, and macOS.

     
  3. 3.

    It’s easy to break the metadata for your C# project.

    As you add and remove files to and from your project, Godot maintains metadata. This tracks connections between files and resources, and it maintains lists of script files needed for compiling. In C# projects, it’s currently easy for anybody to accidentally break the metadata. This causes compilation to fail. Don’t worry though. These issues can usually be fixed easily and manually, and we’ll see how soon.

     
Figure 1-2

The Godot Editor Features a Scripting Window for GDScript and C#. However, Third-Party Editors Are Better for C#, As We’ll See

Getting Started with C# in Godot

So you’ve finally downloaded and installed the Godot Mono Version for your OS, as mentioned earlier in this chapter. Great! Let’s now take the next steps to configure Godot for C# scripting. Once set up, we’ll be ready to start making games. Open up a web browser and download Visual Studio Code to your computer. See Figure 1-3. The URL is https://code.visualstudio.com/.
Figure 1-3

Downloading Visual Studio Code for Your Operating System. This Book Supports All Platforms for Godot, Although I’m Using a Mac for Screenshots and Examples

After running Visual Studio Code for the first time, select the Extensions tab and install the OmniSharp C# Extension for syntax highlighting and code completion support. See Figure 1-4.
Figure 1-4

Installing the C# OmniSharp Extension for Visual Studio Code

Next, Open Godot and create an empty project from the Project Creation Window. Click the New Project button and enter your project name and location. You can name your project anything and store it anywhere. We only need to create a new project to access the Editor Settings window from the main interface. See Figure 1-5.
Figure 1-5

Creating a New Godot Project

From the main Interface, select the menu item EditorEditor Settings. This displays the Editor dialog where you can customize application settings. See Figure 1-6.
Figure 1-6

Accessing the Editor Settings Window

From the Editor Settings Window, choose MonoEditor from the list view and then select Visual Studio Code from the External Editor drop-down menu. This sets Visual Studio Code as the default code editor for Godot. This means that Visual Studio Code will open automatically whenever you open script files from the Godot File System (Project Panel). See Figure 1-7.
Figure 1-7

Setting the Default Code Editor

Excellent! You’ve now configured Visual Studio Code as the default code editor for Godot. This editor will now open to display script files in your project. You’re now all set to get started!

You can view a free YouTube video tutorial on configuring Visual Studio Code on my BeIndie.Biz channel here: www.youtube.com/watch?v=ra-BJ-fJ6Qo&t.

Summary

On reaching this point, you’ve now downloaded and installed Godot Mono, and you’re ready to start coding games using C# for any desktop platform – Windows, Linux, or Mac. Godot is an excellent, free, and open source engine; and by using this tool, you can create great products. Now let’s jump in and learn Godot quickly. I’ll be converting your Unity knowledge to Godot knowledge. Let’s go!