Moving from Unity to Godot an In-Depth Handbook to Godot for Unity Users

Total Page:16

File Type:pdf, Size:1020Kb

Moving from Unity to Godot an In-Depth Handbook to Godot for Unity Users Moving from Unity to Godot An In-Depth Handbook to Godot for Unity Users Alan Thorn Moving from Unity to Godot: An In-Depth Handbook to Godot for Unity Users Alan Thorn High Wycombe, UK ISBN-13 (pbk): 978-1-4842-5907-8 ISBN-13 (electronic): 978-1-4842-5908-5 https://doi.org/10.1007/978-1-4842-5908-5 Copyright © 2020 by Alan Thorn This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein. Managing Director, Apress Media LLC: Welmoed Spahr Acquisitions Editor: Spandana Chatterjee Development Editor: James Markham Coordinating Editor: Divya Modi Cover designed by eStudioCalamar Cover image designed by Pixabay Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation. For information on translations, please e-mail [email protected], or visit http://www. apress.com/rights-permissions. Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales. Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book’s product page, located at www.apress.com/ 978-1-4842-5907-8. For more detailed information, please visit http://www.apress.com/ source-code. Printed on acid-free paper Table of Contents About the Author ................................................................................vii About the Technical Reviewer .............................................................ix Introduction .........................................................................................xi Chapter 1: Introducing Godot: Why Migrate? .......................................1 Getting and Installing Godot ..................................................................................2 Why Use Godot? ....................................................................................................3 Godot Is Free ...................................................................................................3 Godot Is Open Source ......................................................................................4 Godot Is Evolving .............................................................................................5 Godot Is Supported ..........................................................................................5 Godot Is About Games and Experiences ..........................................................6 Godot and C# .........................................................................................................6 Getting Started with C# in Godot ...........................................................................9 Summary.............................................................................................................14 Chapter 2: Godot Fundamentals .........................................................15 Godot Projects .....................................................................................................16 Editor Interface ...................................................................................................20 Creating and Editing Scenes ...............................................................................21 Scenes and Nodes – Adding a Cube ...................................................................26 iii TABLE OF CONTENTS Navigation and Transformation ...........................................................................33 Zoom ..............................................................................................................35 Pan ................................................................................................................36 Frame and Orbit .............................................................................................36 First-Person Controls .....................................................................................37 Selecting, Moving, Rotating, and Scaling Nodes............................................38 Local and World Space Transforms .....................................................................40 Scene vs. Game Mode ........................................................................................41 Resources ...........................................................................................................50 Summary.............................................................................................................52 Chapter 3: Scripting with C# in Godot: Common Tasks ......................53 . NET and Build Problems with C# .......................................................................55 Building a Hello World Program ..........................................................................61 Working with Nodes ............................................................................................67 Iterating Through Child Nodes.............................................................................68 Finding Nodes by Name ......................................................................................70 Finding Nodes by Path ........................................................................................71 Godot Groups vs. Unity Tags ................................................................................73 Accessing Variables in the Inspector ..................................................................78 Variables As Properties – GetComponent? ..........................................................80 NodePaths and Node References........................................................................81 Set an Object’s Position ......................................................................................83 Make an Object Move Smoothly .........................................................................85 Make an Object Rotate Smoothly ........................................................................86 Detecting When an Object Enters a Trigger .........................................................87 Viewing Spatial Nodes ........................................................................................96 iv TABLE OF CONTENTS Reading Player Input ...........................................................................................98 Summary...........................................................................................................103 Chapter 4: Making a 2D Game ..........................................................105 Configuring a 2D Project ...................................................................................106 Importing Assets ...............................................................................................110 Creating the Player Character ...........................................................................112 Building a Level – Tilemaps and Tilesets ..........................................................128 World Collisions ................................................................................................139 2 D Lighting ........................................................................................................148 Pickups .............................................................................................................152 Timers and Countdowns ...................................................................................156 Summary...........................................................................................................160 Chapter 5: 3D Lighting and Materials ...............................................161 Lighting Fundamentals .....................................................................................162 Exploring Light Types ........................................................................................165
Recommended publications
  • Evolution of Programmable Models for Graphics Engines (High
    Hello and welcome! Today I want to talk about the evolution of programmable models for graphics engine programming for algorithm developing My name is Natalya Tatarchuk (some folks know me as Natasha) and I am director of global graphics at Unity I recently joined Unity… 4 …right after having helped ship the original Destiny @ Bungie where I was the graphics lead and engineering architect … 5 and lead the graphics team for Destiny 2, shipping this year. Before that, I led the graphics research and demo team @ AMD, helping drive and define graphics API such as DirectX 11 and define GPU hardware features together with the architecture team. Oh, and I developed a bunch of graphics algorithms and demos when I was there too. At Unity, I am helping to define a vision for the future of Graphics and help drive the graphics technology forward. I am lucky because I get to do it with an amazing team of really talented folks working on graphics at Unity! In today’s talk I want to touch on the programming models we use for real-time graphics, and how we could possibly improve things. As all in the room will easily agree, what we currently have as programming models for graphics engineering are rather complex beasts. We have numerous dimensions in that domain: Model graphics programming lives on top of a very fragmented and complex platform and API ecosystem For example, this is snapshot of all the more than 25 platforms that Unity supports today, including PC, consoles, VR, mobile platforms – all with varied hardware, divergent graphics API and feature sets.
    [Show full text]
  • Cloud-Based Visual Discovery in Astronomy: Big Data Exploration Using Game Engines and VR on EOSC
    Novel EOSC services for Emerging Atmosphere, Underwater and Space Challenges 2020 October Cloud-Based Visual Discovery in Astronomy: Big Data Exploration using Game Engines and VR on EOSC Game engines are continuously evolving toolkits that assist in communicating with underlying frameworks and APIs for rendering, audio and interfacing. A game engine core functionality is its collection of libraries and user interface used to assist a developer in creating an artifact that can render and play sounds seamlessly, while handling collisions, updating physics, and processing AI and player inputs in a live and continuous looping mechanism. Game engines support scripting functionality through, e.g. C# in Unity [1] and Blueprints in Unreal, making them accessible to wide audiences of non-specialists. Some game companies modify engines for a game until they become bespoke, e.g. the creation of star citizen [3] which was being created using Amazon’s Lumebryard [4] until the game engine was modified enough for them to claim it as the bespoke “Star Engine”. On the opposite side of the spectrum, a game engine such as Frostbite [5] which specialised in dynamic destruction, bipedal first person animation and online multiplayer, was refactored into a versatile engine used for many different types of games [6]. Currently, there are over 100 game engines (see examples in Figure 1a). Game engines can be classified in a variety of ways, e.g. [7] outlines criteria based on requirements for knowledge of programming, reliance on popular web technologies, accessibility in terms of open source software and user customisation and deployment in professional settings.
    [Show full text]
  • Game Engine Review
    Game Engine Review Mr. Stuart Armstrong 12565 Research Parkway, Suite 350 Orlando FL, 32826 USA [email protected] ABSTRACT There has been a significant amount of interest around the use of Commercial Off The Shelf products to support military training and education. This paper compares a number of current game engines available on the market and assesses them against potential military simulation criteria. 1.0 GAMES IN DEFENSE “A game is a system in which players engage in an artificial conflict, defined by rules, which result in a quantifiable outcome.” The use of games for defence simulation can be broadly split into two categories – the use of game technologies to provide an immersive and flexible military training system and a “serious game” that uses game design principles (such as narrative and scoring) to deliver education and training content in a novel way. This talk and subsequent education notes focus on the use of game technologies, in particular game engines to support military training. 2.0 INTRODUCTION TO GAMES ENGINES “A games engine is a software suite designed to facilitate the production of computer games.” Developers use games engines to create games for games consoles, personal computers and growingly mobile devices. Games engines provide a flexible and reusable development toolkit with all the core functionality required to produce a game quickly and efficiently. Multiple games can be produced from the same games engine, for example Counter Strike Source, Half Life 2 and Left 4 Dead 2 are all created using the Source engine. Equally once created, the game source code can with little, if any modification be abstracted for different gaming platforms such as a Playstation, Personal Computer or Wii.
    [Show full text]
  • Games: Gdevelop, End of the Sun, Untrusted, Ravenfield and More
    Published on Tux Machines (http://www.tuxmachines.org) Home > content > Games: GDevelop, End of the Sun, Untrusted, Ravenfield and More Games: GDevelop, End of the Sun, Untrusted, Ravenfield and More By Roy Schestowitz Created 08/06/2020 - 2:10pm Submitted by Roy Schestowitz on Monday 8th of June 2020 02:10:48 PM Filed under Gaming [1] FOSS game engine GDevelop gets a sweet new dark theme [2] GDevelop is a wonderful free and open source game engine, one that's cross-platform and it continues to get more powerful. It also has theme support with a new dark theme landing that looks great. The new dark theme "Nord" is based on the the palette from nordtheme.com, and it fits in very nicely with the GDevelop editor UI. In fact, it actually looks a little like the Godot Engine theme. Dark themes can at times be a little too dark, light themes blinding and this new Nord theme seems to have a nice contrast to it, makes tinkering with it feel better along with the recent UI adjustments the GDevelop team did to reduce useless padding everywhere. First-person slavic fantasy adventure The End of the Sun is fully funded[3] The End of the Sun, a slavic first-person fantasy adventure has managed to run a successful Kickstarter campaign. Against their initial $12,000 goal, 741 backers pledged $18,001 to help make it. What is it? A strange sounding tale that's what, interesting though. Set in the world of Slavic rites, beliefs, legends, and their everyday life.
    [Show full text]
  • Game Engines in Game Education
    Game Engines in Game Education: Thinking Inside the Tool Box? sebastian deterding, university of york casey o’donnell, michigan state university [1] rise of the machines why care about game engines? unity at gdc 2009 unity at gdc 2015 what engines do your students use? Unity 3D 100% Unreal 73% GameMaker 38% Construct2 19% HaxeFlixel 15% Undergraduate Programs with Students Using a Particular Engine (n=30) what engines do programs provide instruction for? Unity 3D 92% Unreal 54% GameMaker 15% Construct2 19% HaxeFlixel, CryEngine 8% undergraduate Programs with Explicit Instruction for an Engine (n=30) make our stats better! http://bit.ly/ hevga_engine_survey [02] machines of loving grace just what is it that makes today’s game engines so different, so appealing? how sought-after is experience with game engines by game companies hiring your graduates? Always 33% Frequently 33% Regularly 26.67% Rarely 6.67% Not at all 0% universities offering an Undergraduate Program (n=30) how will industry demand evolve in the next 5 years? increase strongly 33% increase somewhat 43% stay as it is 20% decrease somewhat 3% decrease strongly 0% universities offering an Undergraduate Program (n=30) advantages of game engines • “Employability!” They fit industry needs, especially for indies • They free up time spent on low-level programming for learning and doing game and level design, polish • Students build a portfolio of more and more polished games • They let everyone prototype quickly • They allow buildup and transfer of a defined skill, learning how disciplines work together along pipelines • One tool for all classes is easier to teach, run, and service “Our Unification of Thoughts is more powerful a weapon than any fleet or army on earth.” [03] the machine stops issues – and solutions 1.
    [Show full text]
  • Volumetric Real-Time Smoke and Fog Effects in the Unity Game Engine
    Volumetric Real-Time Smoke and Fog Effects in the Unity Game Engine A Technical Report presented to the faculty of the School of Engineering and Applied Science University of Virginia by Jeffrey Wang May 6, 2021 On my honor as a University student, I have neither given nor received unauthorized aid on this assignment as defined by the Honor Guidelines for Thesis-Related Assignments. Jeffrey Wang Technical advisor: Luther Tychonievich, Department of Computer Science Volumetric Real-Time Smoke and Fog Effects in the Unity Game Engine Abstract Real-time smoke and fog volumetric effects were created in the Unity game engine by combining volumetric lighting systems and GPU particle systems. A variety of visual effects were created to demonstrate the features of these effects, which include light scattering, absorption, high particle count, and performant collision detection. The project was implemented by modifying the High Definition Render Pipeline and Visual Effect Graph packages for Unity. 1. Introduction Digital media is constantly becoming more immersive, and our simulated depictions of reality are constantly becoming more realistic. This is thanks, in large part, due to advances in computer graphics. Artists are constantly searching for ways to improve the complexity of their effects, depict more realistic phenomena, and impress their audiences, and they do so by improving the quality and speed of rendering – the algorithms that computers use to transform data into images (Jensen et al. 2010). There are two breeds of rendering: real-time and offline. Offline renders are used for movies and other video media. The rendering is done in advance by the computer, saved as images, and replayed later as a video to the audience.
    [Show full text]
  • Webgl: the Standard, the Practice and the Opportunity Web3d Conference August 2012
    WebGL: The Standard, the Practice and the Opportunity Web3D Conference August 2012 © Copyright Khronos Group 2012 | Page 1 Agenda and Speakers • 3D on the Web and the Khronos Ecosystem - Neil Trevett, NVIDIA and Khronos Group President • Hands On With WebGL - Ken Russell, Google and WebGL Working Group Chair © Copyright Khronos Group 2012 | Page 2 Khronos Connects Software to Silicon • Khronos APIs define processor acceleration capabilities - Graphics, video, audio, compute, vision and sensor processing APIs developed today define the functionality of platforms and devices tomorrow © Copyright Khronos Group 2012 | Page 3 APIs BY the Industry FOR the Industry • Khronos standards have strong industry momentum - 100s of man years invested by industry leading experts - Shipping on billions of devices and multiple operating systems • Khronos is OPEN for any company to join and participate - Standards are truly open – one company, one vote - Solid legal and Intellectual Property framework for industry cooperation - Khronos membership fees to cover expenses • Khronos APIs define core device acceleration functionality - Low-level “Foundation” functionality needed on every platform - Rigorous conformance tests for cross-vendor consistency • They are FREE - Members agree to not request royalties Silicon Software © Copyright Khronos Group 2012 | Page 4 Apple Over 100 members – any company worldwide is welcome to join Board of Promoters © Copyright Khronos Group 2012 | Page 5 API Standards Evolution WEB INTEROP, VISION MOBILE AND SENSORS DESKTOP OpenVL New API technology first evolves on high- Mobile is the new platform for Apps embrace mobility’s end platforms apps innovation. Mobile unique strengths and need Diverse platforms – mobile, TV, APIs unlock hardware and complex, interoperating APIs embedded – mean HTML5 will conserve battery life with rich sensory inputs become increasingly important e.g.
    [Show full text]
  • Legends of Learning and IGDA Game Design Challenge Lesson Plans
    Legends of Learning & IGDA Game Design Challenge About the Game Design Challenge With many schools adopting a virtual or hybrid plan this school year, students are missing out on the opportunity to engage in hands-on STEM experiences with their friends and classmates. To help fill this void, and encourage learning, computational thinking, and fellowship, Legends of Learning and International Game Developers Association (IGDA) are hosting a month-long Game Design Challenge. This virtual experience will enable K-12 students to learn more about game development and practice critical thinking while expanding their portfolios. This packet contains lesson plans for the Game Design Challenge to assist teachers with integrating this experience into their classrooms if they would like their students to follow along. Each lesson week will also have at least one live-streamed talk for students to watch as well. We are excited to provide all learners with an opportunity to design a game, no matter their device-access, age, or previous experience. Depending on the grade level and experience of the participating students, there will be two different tracks they can participate in: ● Fully build out a video game, using their choice of platform ○ Examples: CORE, Unity, Game Maker, Scratch, RPG Maker ● Create a paper prototype and game design document Lesson 1: Game Development Concept & Planning The first step of any large project is to determine the base components of the project and make a plan on how to bring those together. In this lesson, students will work to create an initial design for their game. Then they will make a plan to bring that design to life.
    [Show full text]
  • Games: Godot Engine, Defold, and Many Titles
    Published on Tux Machines (http://www.tuxmachines.org) Home > content > Games: Godot Engine, Defold, and Many Titles Games: Godot Engine, Defold, and Many Titles By Roy Schestowitz Created 12/02/2021 - 10:31pm Submitted by Roy Schestowitz on Friday 12th of February 2021 10:31:26 PM Filed under Gaming [1] Godot Engine - Release candidate: Godot 3.2.4 RC 2 [2] Godot 3.2.4 is shaping up nicely, and a number of issues have been fixed since the first Release Candidate two weeks ago. So it's now time for a RC 2 build to give it another round of testing before the stable release! And rejoice macOS users, this release is the first to have the Godot editor binary signed and notarized. Thanks to Prehensile Tales for signing it on behalf of the Godot contributors. (Note: Only the "standard" build is signed for now.) Godot GDScript REPL [3] When experimenting with Godot and its GDScript language, I realized that I missed a good old REPL (Read-Eval-Print Loop) to familiarize myself with the language and API. Defold game engine planning Linux improvements through 2021 [4] Defold, a free game engine with the source code available under a reasonable open license has released a roadmap for 2021 and it's sounding pretty good. While not actually open source, the licensing terms are still quite friendly and still far better than some other much more closed licensing like with Unity, Unreal and Game Maker but not as open as something like Godot. Defold is progressing on though and their roadmap for 2021 mentions their plan to continue to improve their Linux support.
    [Show full text]
  • Capítulo 3. Unity 3D
    TRABAJO FINAL DE GRADO TÍTULO DEL TFG: Diseño de patrones para construir un Juego Serio de forma fácil y rápida con Unity. TITULACIÓN: Grado en Ingeniería Telemática AUTOR: Miquel Delgado Losada DIRECTOR: Dolors Royo Vallés DATA: 8 de Julio 2016 Título: Diseño de patrones para construir un Juego Serio de forma fácil y rápida con Unity. Autor: Miquel Delgado Losada Director: Dolors Royo Vallés Data: 8 de Julio 2016 Resumen Los videojuegos son una de las formas de expresión más universales y amenas que hay en la industria de los contenidos digitales. Por eso, desde que comenzaron a programarse, se ha buscado aprovechar sus puntos fuertes para implementar mecanismos que ayuden al aprendizaje o al trabajo en equipo. Está demostrado que, gracias a los videojuegos, es más fácil para las personas, memorizar fragmentos, acciones o entender conceptos que de una forma tradicional. Así mismo, también es más fácil cooperar y trabajar en equipo cuando se tiene un objetivo común y cuando este objetivo se consigue de forma más fácil cooperando, al revés que realizándolo de forma individual. Debido a los avances tecnológicos, hoy en día no solo encontramos videojuegos en una sola plataforma, sino que los encontramos en diversos medios como ordenadores personales, móviles, tablets, consolas de sobremesa o consolas portátiles entre otros. Para ello se utilizan los motores de videojuegos, herramientas que ayudan a los desarrolladores a crear el mundo virtual que va a contener en su videojuego, con ayudas para crear el mundo en 2D, 3D, físicas, iluminación y otros aspectos necesarios para que la experiencia de juego sea agradable para el usuario.
    [Show full text]
  • Game Programming with Godot Foss-Gbg 2019-10 // Johan Thelin What We Will Look at Today
    Game programming with Godot foss-gbg 2019-10 // Johan Thelin What we will look at today ● Intro to the editor ● 2D and 3D games ● Intro to VR using Godot ● Intro to deployment using Godot Intro ● I encourage you to code along! ● All examples can be found at https://github.com/e8johan/godot-tutorial . ● Assets the raw assets ● 01_flippable 2D intro example ● 02_platformer 2D platformer ● 02b_platformer_animated 2D platformer with animated hero ● 03_on_a_roll 3D example ● 04_on_a_roll_vr 3D VR example Bio Johan Thelin - co-founder of Kuro Studio Autoliv → XDIN → Bitsim → Trolltech → Pelagicore → Kuro I’ve done lots and lots of embedded devices with Qt, Linux, etc Absolutely zero game programming experience :-) What is Godot Modern game engine Visual editor Open source www.godotengine.org Getting Godot ● A ~25MB download from https://godotengine.org/download ● Available for Linux, Windows, MacOS and Server ● The download contains the executable - just download and run ● … or use your distro’s package manager ● Today, we will focus on the standard version - no C# or other external deps ● I’m using version 3.1 The Editor ● Main view ○ 2D ○ 3D ○ Script ● File system ○ res:// ● Scene ● Inspector Let’s create! ● You will learn about ○ Nodes ○ Scenes ○ Scripts ● Create nodes ○ Node2D ■ Sprite x2 ■ Area2D ● CollisionShape2D The flipper script extends Node2D onready var front = $Front onready var back = $Back func _on_Area2D_input_event(viewport, event, shape_idx): if event is InputEventMouseButton: if event.is_pressed() and event.button_index ==
    [Show full text]
  • 2D Multiplayer Game Development Using Unity
    Vol-6 Issue-2 2020 IJARIIE-ISSN(O)-2395-4396 2D MULTIPLAYER GAME DEVELOPMENT USING UNITY Kumaresan G1, Sharath A2, Sheshanth B P3, Somesh A4 1 Assistant Professor, Department of Computer Science and Engineering, SRM Valliammai Engineering College, Tamil Nadu, India 2 UG Student, Department of Computer Science and Engineering, SRM Valliammai Engineering College, Tamil Nadu, India 3 UG Student, Department of Computer Science and Engineering, SRM Valliammai Engineering College, Tamil Nadu, India 4 UG Student, Department of Computer Science and Engineering, SRM Valliammai Engineering College, Tamil Nadu, India ABSTRACT Video games are common these days. The games have been developed for various purposes including entertainment, informational purposes, marketing, and advertising purposes. Game developers are continually developing multi- platform games that can be played on computers, mobile devices like iPads and smartphones and other video game devices. Today, mobile games consume a huge market share within the games industry. Considering that nearly two billion mobile devices are running a Unity-made game, it is probable that quite a large majority of these new companies will be using Unity to develop mobile games. Mobile games are becoming more and more popular and well-received by different types of users around the world. A lot of frameworks that allow developers to create the games in a faster and easier way. The Unity 3D engine is employed by an outsized majority of developers to make games. It owns a forty-five percent market share and is considered one of the biggest development tools today This project involves the approach of creating a 2D mobile game using Unity.
    [Show full text]