Space Shooter in Godot 4 - part 1 (introduction)
Summary
TLDRIn this video course, Philip guides viewers through designing and developing a space shooter game using Cuddle Engine, showcasing techniques valuable for various game projects. Key tools like Godot Engine, Blender, and Material Maker are introduced, all available for free. The course begins with setting up the game environment, creating scenes, and implementing a debug overlay for performance monitoring. It emphasizes creating assets from scratch, ensuring a comprehensive understanding of game development.
Takeaways
- 🚀 The video course is designed to teach how to design and develop a space shooter game in Godot Engine.
- 🛠️ All the necessary tools for the project are available for free, eliminating the need for any licensing fees.
- 📚 The Godot Engine is central to the project, with the course using version 4.1.1 for consistency.
- 🎨 Blender is used to create low-polygon models for the game, with the course referencing version 3.6.1.
- 🎭 Material Maker is introduced as a free tool for assigning materials to game assets, streamlining the process.
- 💻 The course starts from scratch, creating everything from the ground up with detailed explanations for each step.
- 🔍 Godot's project manager window is used to create and manage new projects, setting up the workspace for game development.
- 🖼️ The importance of setting up global settings in Godot for different display sizes and resolutions is emphasized.
- 📐 A 3D scene is created with a root node, and additional sub-nodes for light source and camera are added for game setup.
- 🛑 A debug overlay is implemented to monitor game performance and vital aspects like FPS and draw calls.
- 🔧 An Autoload script is created for utility functions, such as checking if a node is valid, to be used across the project.
Q & A
What is the purpose of the video course created by Philip?
-The purpose of the video course is to demonstrate how to design and develop an organ in Cuddle Engine, specifically a space shooter game with 3D models, showcasing various techniques and skills that can be valuable in many other game projects.
What are the tools mentioned in the script that are required for the course?
-The tools mentioned are Godot Engine for game logic, Blender for creating 3D models, and Material Maker for assigning materials to assets. All these tools are available for free, eliminating the need for licensing fees.
Which version of Godot Engine is recommended for following the course?
-The recommended version of Godot Engine at the time of recording the video is 4.1.1, as the scripts developed in the course may not work with earlier versions.
What is the role of Blender in the video course?
-Blender is used to create visually appealing low-polygon models for the game. The course is based on Blender version 3.6.1, but any recent version is likely to be suitable due to the focus on basic operations.
What is Material Maker and how is it used in the course?
-Material Maker is a free tool powered by the Godot Engine used to assign visually appealing materials to game assets. It streamlines the process of preparing game models, with the latest version at the time being 1.3.
What is the first step in setting up the game project in Godot?
-The first step is to open Godot and create a new project, keeping all parameters with their default values since it's a desktop game, and selecting a new folder to create the project in.
Why is it important to set up global settings in Godot before starting the game development?
-Setting up global settings is crucial to ensure compatibility with different display sizes and resolutions, to avoid issues such as distorted texts and visual artifacts in the game.
What is the significance of using a 'debug overlay' in the game development process?
-A debug overlay is significant as it allows developers to monitor vital aspects of the game such as frame rate, draw calls, and other performance metrics, providing valuable insights during the development process.
How is the 'utils' script used in the course?
-The 'utils' script is an autoload script that contains utility functions, such as 'is_valid_node', which can be called from any other script in the project to check if a node is valid and not null.
What is the purpose of the 'autoload' folder in the Godot project structure?
-The 'autoload' folder is used to store scripts that are automatically loaded into the project, making their functions globally accessible without the need to instantiate them in every scene.
What is the recommended approach for handling player data in the debug overlay?
-The recommended approach is to first check if the player object is valid using the 'utils.is_valid_node' function before accessing its properties like global position and rotation to avoid errors.
Outlines
🚀 Introduction to Game Development with Cuddle Engine
In this introductory paragraph, Philip welcomes viewers to a video course focused on designing and developing a space shooter game using Cuddle Engine. He emphasizes the use of 3D models and the applicability of the skills learned to other game projects. The tools required for the course are mentioned, including Godot Engine, Blender, and Material Maker, all of which are free of charge. The Godot version 4.1.1 is specified for consistency with the course content. The tutorial begins with creating a new project in Godot and setting up the project manager window.
🛠 Setting Up the Game Environment and Global Settings
The second paragraph details the initial setup of the game environment in Godot, including the creation of a new project folder named 'shooter' and the configuration of global settings to accommodate different display resolutions. The stretch mode is set to Canvas items with an aspect ratio set to expand, ensuring sharp 2D elements. The option to resize the game window is disabled, and the viewport size is adjusted to 1600x900. The first scene is created with a 3D scene as the root node, which is then renamed to 'main root' for better description.
🔆 Configuring Light and Camera for a Top-Down Perspective
In this paragraph, the focus shifts to setting up the lighting and camera for the game's top-down perspective. A directional light is added and positioned above the game plane with specific rotation values to ensure uniform illumination. The camera is set to an orthogonal projection initially but then changed to a perspective projection to leverage 3D effects, with the field of view reduced to 30 degrees to prevent distortion. The camera's position and rotation are also configured to align with the game's viewpoint.
📁 Organizing Assets and Preparing the Debug Overlay
The fourth paragraph discusses the organization of game assets through the creation of folders for models, materials, scenes, and fonts. It then proceeds to describe the creation of a debug overlay using a new scene with a Label node, which will display vital game information such as frame rate and memory usage. A custom font is imported for consistency across platforms, and a script is attached to the debug label to control its activation and display of game data.
💻 Scripting the Debug Overlay and Player Data Monitoring
This paragraph delves into the scripting process for the debug overlay, explaining how to monitor and display game performance metrics such as frames per second, draw calls, frame time, and video RAM usage. It also outlines the preparation for player data monitoring, with placeholders for the player's position and rotation. A utility function is created in an 'autoload' script to check the validity of nodes, ensuring that player data is only accessed if the player object is valid.
🔄 Finalizing the Debug Overlay and Unit Conversion
The final paragraph wraps up the creation of the debug overlay by addressing the need to convert video RAM usage from bytes to megabytes for readability. It also emphasizes the importance of checking the validity of the player object before accessing its properties to avoid errors. The paragraph concludes with the integration of the 'utils' script for node validation and the final positioning of the debug overlay in the game's user interface.
Mindmap
Keywords
💡Cuddle Engine
💡Space Shooter
💡3D Models
💡Blender
💡Material Maker
💡Game Logic
💡Global Settings
💡Debug Overlay
💡Perspective Camera
💡Autoload
💡Version Control
Highlights
Introduction to the video course on designing and developing an organ in Cuddle Engine with 3D models for a space shooter game.
All the necessary tools for the course are available for free, eliminating the need for licensing fees.
Godot Engine 4.1.1 is the core for developing game logic, ensuring compatibility with the course scripts.
Blender 3.6.1 is used for creating low-polygon models, with basic operations applicable across various versions.
Material Maker 1.3 is introduced for assigning materials to game assets, streamlining the preparation process.
The course starts from scratch, creating everything from the ground up without pre-existing assets.
Setting up a new Godot project with default parameters for a desktop game.
Configuring global settings in Godot for different display sizes and resolutions.
Creating the first scene in Godot with a 3D scene root node.
Setting up a directional light and camera for the space shooter game's top-down perspective.
Establishing a debug overlay for monitoring game performance and vital aspects during development.
Creating a new scene for the debug overlay using a Label node.
Importing a custom font for consistency across different platforms instead of using system fonts.
Scripting the debug overlay to display FPS, draw calls, frame time, and allocated video RAM.
Creating an autoload script for utility functions accessible throughout the project.
Implementing a function to check if a node is valid before accessing its properties to avoid errors.
Adjusting the display of video RAM from bytes to megabytes for better readability.
Positioning the debug overlay at the bottom left of the game view for easy access to information.
Transcripts
hello everybody and welcome my name is
Philip and I created this video course
to demonstrate how you can easily design
and develop your organ in cuddle engine
we'll be crafting a space shooter with
3D models which is a great example to
Showcase a plenty of techniques and
tricks
in fact these skills can be valuable in
many other game projects as well
let's get started
[Music]
I prefer to avoid lengthy introductions
so allow me to briefly outline the
necessary tools we'll be working with
the best part is that all these tools
are available for free there is no need
for any licensing fees which means we
can start working without any initial
investment
first go to four
the Godot engine is a heart of our
project and we will develop all the game
logic in it
to like the stable version at the time
of recording this video was got over
4.1.1
please ensure you have the correct
version of Godot to follow this course
as the scripts we will develop wouldn't
work with earlier merchants
second blender
I will demonstrate how we can utilize
blender to create nice looking low
polygon models for your game currently
I'm working with blender version of
3.6.1 and since we'll primary focus on
basic operations in Wonder it's likely
that any three-point X version would be
suitable
and third material maker
we'll need to assign nice looking
materials to our assets
and material maker is just the right
tool to achieve that
it's a free tool powered by the codo
engine and it proves to be incredibly
valuable in streamlining the process of
preparing game models currently the
latest version available is 1.3
and that's it no additional
installations are required to follow the
along with this tutorial
I've included download links in the
video description ensuring a similar's
preparation of your local environment
so if you are all set we can dive right
into working on the game
let me show you again what we will start
with
go
blender
and material maker
and what we will end with
[Music]
thank you
[Music]
[Music]
[Music]
thank you
[Music]
just to remind we're starting this
project from scratch with no
pre-existing assets textures or code our
approach involves creating everything
from the ground up and I'll make sure to
provide detail explanations for each
step of the process
our first step is to open Godot and
create a new project if you read my book
you know that I usually start with
creating a repository on GitHub I'm
calling it on my local environment
however the video course is strictly
about the game development so I will
skip the step related to a Version
Control
and in this video series we will only
work locally
okay let me switch to my working
environment and I'll start cuddle
on the startup godo displays the project
manager window you can see that I
already have several projects here most
of them are games I'm currently working
on we just click here to create a new
project
we can keep all parameters with their
default values because we'll be working
on a desktop game so I'll only select a
new folder to create a project
okay
where it is here and control
fine and let's give it a name
shooter
good create folder and create an edit
and go to environment opened this is a
blank project nothing is there yet every
other project is different by one or
more scenes so we need to create the
first scene and since we are working
with 3D models and operations our choice
is the 3D scene
but before we create a scene there is
one more important step to take let's
set up the global settings it's here in
project project settings
as we know people who will play our game
usually have displays with different
sizes and resolutions so it's crucial to
be ready for that I personally faced
plenty of problems before my own game
started displaying everything as I
wished I remember that the biggest issue
was with 2D labels and the assigned
fonts as The Wrong settings resulted in
distorted texts that looked bad and were
difficult to read
So to avoid such a situation let's set
this here in the stretch section we'll
set stretch mode to Canvas items
and the aspect should be set to expand
this will ensure that our 2D elements
will always be sharp and without any
visual artifacts
I also recommend disabling the option
for players to resize the game's seed
screen unless you specifically decided
functionality later we will introduce a
feature to modify the window size within
the game now we uncheck this
checkbox
and the game window won't be resizable
anymore
and one last thing let's adjust the
viewport size to
1 6 0 0 by 900.
it fits nicely within my laptop display
with full HD resolution good we can
proceed with creating the first scene
let's do it by specifying its root note
and we will which we will set to 3D
scene there it is it's always a good
idea to rename it to something more
descriptive so let's click it
and give it some
better name for example main root
okay
we save the scene either by pressing
Ctrl s or in the scene menu here save
scene and give it Main tscn
okay we have the scene but it's
completely empty there is nothing in it
we'll start with adding two more
important sub nodes the light source and
a camera
fertilized swords we choose a
directional light 3D as we need at least
at this stage to have all the game
objects equally illuminated let's right
click the root note and add a child node
of the type
directional light 3D
cool okay done
now we need to configure it as you know
we are working on a space shooter and
all its objects will be observed from
the top down perspective which means
that the globe light source should be
located above the exact plane
let's click the node to open it in the
inspector there it is
and set the values of the position and
rotation properties they are located
here in the transform section so the
position of Y should be to 25
now it's above the above the exit plane
and the rotation we will rotate it to
negative 90. to point light source
directly at the plane
we will use the same approach to
configure the camera let's add it to the
scene first
okay child node and Camera 3D
good
now what kind of camera do we need there
are basically two options
they are set here in the projection
first of them order orthogonal we will
choose it to assemble a traditional 2D
game with no depth perception that would
be perfectly fine and sufficient to
create a playable nice looking game
however
I would like to leverage certain 3D
effects in this project so we better
select the second option which is
perspective
with this camera object will be objects
will be perceived from slightly varied
angles and the visual scale will be
influenced by the y-coordinate
furthermore the space can be distorted
at the edges and corners
of the viewport so it's important to
reduce the field of view to mitigate
that
let's do it here fov field of view will
set to 30 degrees
and again we need to change the position
we'll set it above the exit plane
to 130
and rotation just like with the light
source negative 90.
good finally let's prepare several
folders to keep various assets
and may all project better organized we
will right click here in file system the
root note
and create a new folder
uh modals
materials
scenes
and for instance
fonts
good job
let's execute the project
and it seems we didn't set the main
scene yet so we'll do it now go to
already offered us to select the current
one let's do it
and the game opened of course there is
nothing to see but at least the game
started now it's a good moment to add
more elements to the scene
the initial element we will introduce to
our 3D scene is in fact a 2d object why
is that the reason is that we want to
establish a debug overlay which would be
always on top and allows us to monitor
vital aspects of the game such as
creation and deletion of significant
objects fluctuations in frames per
second which is closely related to the
game performance and so on
this debug overlay will provide
extremely valuable during the
development process
so let's create a new scene here in the
file system panel right click the scenes
folder create new and scene and for the
root type we'll choose the last option
node click the node selector and find
label
okay because we'll display only text
let's give it a name debug and ok
great the scene was created now we want
to attach a script to it this can be
done in two ways first we right click
the node and select anti-script or we
can just click this icon next to the
search bar and use the same
functionality it's already prefilled as
debug GD let's use it and create the
script open so we can verify that it
extends label which is exactly what we
wanted
now we will display text which means we
must use some font
actually go to uses system fonts by
default but I don't recommend do that
because fonts could be different on
various platforms so let's instead
download and import a custom font this
can be done uh for example from the site
phones google.com which contains
thousands of free fonts to use so I
already downloaded one suitable font I
have it prepared here let me drag and
drop this file into the fonts folder and
here it is the font was imported let's
select the root node again scroll down
to theme overrides Here we can open
fonts and drag the font to the property
to use it and we will
set the font size to 24 pixels
okay this should be prepared
now it's time to implement the script we
don't need the function ready which was
pre-generated from template let's delete
it
and we will need a switch to activate or
deactivate this debug label because we
don't want to use it once the game is
finished let's add a variable
export
and give it the default value true
this uh prefix this annotation export
means that the variable will be added to
the inspector and can be easily we can
easily change its value here without
modifying the script
now we will need some values to display
let's prepare the variables
okay the first four variables
are related to values we want to monitor
on each frame the last one player this
is just a placeholder because we don't
have a player object yet but we will
want to see some data related to
playership here in the debug overlay for
example its current position rotation
and
Etc so we will just make it ready here
and prepare the function to
initialize it later
okay now we finally need to fill the
text property of this label to display
something so we will start with
verifying if the overlay is
um is active or not
so there will be nothing displayed
and now let's fill the variables
we will use
sorry we will use built-in functions
as godo makes it easy for us
frames per second
then draw calls
would be filled from
rendering server and there is some
method get rendering info
here and I think it is total draw calls
in frame
there this long constant
the next one is frame time
which is actually Delta because
Delta again is prefilled by Godot and it
is the difference ellipse time since the
previous frame which is exactly the
frame time and the last one allocated
video RAM
this will be again taken from rendering
server
get rendering info and the constant is
in this game video mem used I think yeah
this one great
okay now
we will create a long variable to
concatenate these values into one label
let's start
okay the function Str is actually
conversion from number to string because
Godot doesn't have an implicit
conversion like other languages so we
must always convert everything to string
to use the plus operator
it's not too aesthetic but it will so it
exactly what we need to do so
there is no problem with that
very well by the way this backslash at
the end of the line means that the line
continues on the next line so the good
old knows it is not finished here
okay
and now we want to add the player data
but only if the player exists otherwise
good overthrow and error so we need to
check the player is a valid object it's
not null
foreign
almost there just rotation
okay
and finally let's assign this data
object to the text property
cool finished
now let's save the scene
click back to the main scene and let's
drag the new scene as a child note
debug tscn
cool
let's open the 2D View and properly
position position this element
we will set up
the position here
I think it's here in layout yeah not
stop left but let's give it bottom left
and
maybe transform yeah it's already set up
so let's check it
ah here it is
so yeah this is just the basis for the
future debug panel with unnecessary
information
right now we are finished with this part
uh there is one more thing I forgot
because nobody wants to see the vram
value in bytes we should use at least uh
megabytes or gigabytes so we need to
divide it
divide it by
124 convert to kilobytes and
24 convert to megabytes this is one
thing and the other one is that we
should be ready for situation when the
player object exists but it's not valid
so calling the properties Global
position and rotation would end up in
air as well
to do that we will create a global
function that can be called from any
anywhere of the project
and for that we will create a new folder
called autoload
Auto load
there it is and we will add a new script
we'll call it utils GD
okay
let's open it again we won't need these
functions because this is just a utility
class
and now we need to add it to Auto alt
settings this is done here in Project
settings
Auto load and click the folder icon
let's find the script
go to automatically assigned a node name
Auto loads sorry hotels we'll click add
and here it is now each time we need to
access functions from this script we
will just use the prefix utils with
capital u and it can be used from any
other script in this project
let's close and let's Implement a simple
function
is valid node
parameter node
node so which means it's not null and
s
in
tons
valid
there it is
okay and that's it
let's use Ctrl s to save the script
switch back to debug overlay and here
instead of if player we will replace it
with
utils
is
valid note
great let's check it out
yeah
I think it looks fine
Посмотреть больше похожих видео
Start Your Game Creation Journey Today! (Godot beginner tutorial)
How To Make a Topdown RPG in Godot 4: Adding Combo Attacks and an Enemy(Part 2)
Make A Bike Tire in Blender With A Non-Destructive Modelling Workflow
Computer Vision Tutorial: Build a Hand-Controlled Space Shooter with Next.js
Godot 4 Crash Course #4 - Adding Meteors
Cara Membuat Tetris sederhana untuk pemula di Mit App inventor GRATIS 2024 | programmer pemula
5.0 / 5 (0 votes)