foreign
[Music]
and welcome to the last session of the
day
Don't Wait For Godot build a game today
with Paris buttfield Addison
Dr Paris Butterfield Edison is
co-founder of secret lab a game
development Studio based in Hobart
Tasmania Australia I like how that's on
there in this talk Paris will teach the
fundamentals of the completely free open
source game engine Godot
it's powerful amazing runs on everything
and there's never been a better time to
learn please welcome Paris
[Applause]
oh yeah I have a PhD in Computing that
I've miserably failed to use for
anything useful so that's not important
for this talk hi I'm Paris I run a
studio called secret lab where we best
known for a game called not in the woods
which attracted a lot of fans a few
years ago but we also build lots of
narrative video games lots of video game
tools all sorts of things and I am here
today to talk about a game engine which
we're increasingly starting to look at
and increasingly starting to use called
Godot Gadot depending on how you
pronounce it uh it's obviously named
after the play which I saw Sir Patrick
Stewart in a few years ago he pronounced
Godot so I'm going to go with Godot
because Patrick Stewart reasonable okay
so this is my company secret lab has
absolutely nothing to do with the talk I
just want to show you the pretty
pictures we made this is the got our
website
I'm gonna I have no slides by the way
I'm just gonna do things and hopefully
it'll work so I have a copy of
everything that works if everything
miserably falls apart and I'll be
copying pasting some code if I give up
typing but other than that we'll see how
it goes so I put this website up just
because the starting point for
everything I'm about to do this is not a
tutorial please don't try and follow
along you'll melt um
all I did was I downloaded good o4 I say
there's never been a better time to
learn I said that a few months ago when
I submitted this talk it was true then
but it's truer now because godo4 just
came out
very true I have to rewrite the whole
talk around and go to four but that's
fine today I'm using the.net version of
golo okay for a very specific reason
that's because most game developers in
the world
who use Unity will have been very
familiar with C sharp and unity is a
very big popular game engine I think
Gullo supporting c-sharp is a really
good way to bring people over from the
big proprietary engine
so I've been learning I know C sharp
very well from Unity I've been learning
C sharp forgotto over the last two
months getting better at it and I
decided to have a crack at doing it in C
sharp this time normally I would teach
GD script which is the other program
language
but everything I'm about to teach you is
translatable although they're using godo
bits are the same so
all I did to get started here was I
downloaded godo film on my Mac there's
not damn version and then I went and
downloaded the.net SDK from Microsoft
good old technically supports the mono
SDK but I think that's not officially
deprecated but basically deprecated now
I downloaded.net6 I think it supports
both
uh with that other way I thought I'd
just quickly show you this is what GD
script looks like it's kind of like
python but it's an internal programming
language that goto made it's great it's
really cool if you're happy to never
touch these sharp using go through this
is perfectly fantastic
possibly better because it's tightly
integrated with the editor
with that I'm going to go to godo and
now we're going to make a project live
hopefully and not mess it up so I'm
going to talk you through how it works
uh God is very lightweight so Unity is
this thing that consumes multiple
gigabytes of your RAM and takes forever
to download God is like 100 megabytes
and just runs
doesn't contact any sort of Licensing
Service it's absolutely fantastic it's a
breath of fresh air so I'm going to make
a new project here I'm going to call it
uh live platformer
and I'm going to put it on my work drive
so we're just going to go volumes
work and then we're going to go here and
select this folder and we're going to go
create folder
so that's my little platformer folder
I'm going to leave it on the renderer we
don't care about that right now and then
we're creating it
and because God I was written in God oh
it's going to relaunch itself it's
slightly quirky
and we end up with this
so everything in gato is a scene
gotta works with scene files scenes are
an area of your game where you've put
something scene files also get stalled
on disk which I'll show you in a minute
but basically scene files are a thing
which you work with and put stuff in
the contents of scenes are called nodes
so everything in a godo scene is just a
node tree it's just a tree of stuff in
an all called node stage in a scene
other scenes can be embedded within
scenes in gallo and you'll see how that
works as we go through but basically
everything you've got always a scene
with a note in it and multiple nodes and
nodes have nodes under them and so on
and so on so we're going to make a
little game we're gonna make a little
platform game like a traditional little
runny jumpy platform game as quickly as
we can
one thing I'm going to do that I forgot
to do is I'm going to go here and go
this folder that I've got here full of
assets
and I'm going to copy it into the folder
I just made
so what I call it I call it live
platformer
I'm going to drag this assets folder in
and these notes in which I'll show you
later and because I put a folder full of
Assets in these assets are just a bunch
of Sprites as pngs which I'll get to in
a minute
because I put a platform folder in gold
is going to figure it out and put it in
the sidebar over here so it knows we've
got some assets
okay so with that in mind I'm going to
start so the first thing I'm going to do
is I'm going to make a player something
to run around in our little scene
to do that I'm going to go over here and
where it says create root node it's
going to ask me what kind of node I want
to be the root of this new empty scene
it's given me and because we want to
play out we're going to create a
different kind of node we're going to
actually click other node and then got
it gives you this list of stuff where
you can pick from what kind of node you
want and we're going to get a character
body so you can filter at the top can
everyone see that okay is it visible
yeah cool
basically you you learn to kind of do it
very fast and just type the kind of node
you want and it eventually gets there
but I'm going to do it slightly so I
want a character body 3D which is a
specialized kind of node that can be
moved around with script so because God
has a full physics engine like most game
engines these days it mostly defaults to
letting you move things with physics so
like if you give something tell it to
fall it falls we don't really want that
to happen with the player character
because we want to manually be able to
move it around the environment so
character body 3D 2D is a that kind of
object if you play with other games this
might be called a kinematic body
so we now have this scene over here
which has at its root a single node
called character body 3D
I'm going to click that and push return
or enter and rename it to player
very straightforward
and then I'm going to add some other
nodes below it so to add other nodes
below it I can either right click on it
and go add child mode or I can just
click the plus button while it's
highlighted
okay
first note I'm going to add is an
animated
Sprite 2D
this is a Sprite that can be animated
basically
uh I'm going to name its player Sprite
so here we have a tiny Tree in this node
and I've lost my mouse
which is very exciting
I wonder where my mouse is gone
yeah it has I'm just going to disconnect
that and reconnect it is that going to
cause a problem for you recording let's
do that
yep that's unfrozen okay
computers eh
and now reconnected it I see nothing
there we go okay you're back okay cool
no idea what happened my mouse just
stopped working which is always very
exciting anyway player Sprite has a
animated so what I'm going to do is I'm
going to select this player Sprite node
on the left here and then go over to the
inspector on the right which shows you
the properties of the thing you've
currently got selected
and the thing we want to change is the
animation so we want to expand that
animation and then it's got Sprite
frames empty so this is where you place
an asset so if you had an animated set
of sprite frames you could drag that in
there we don't have that yet we're going
to make it so we're going to click new
Sprite frames
and we're going to click that asset and
down the bottom we get this little
inspector thing where you can fiddle
with what the actual animation looks
like so I am going to add an animation
here I want to have an idle player
animation so those assets I dragged in
earlier include a bunch of animations
for moving and idling and so on one of
them is a nice little sprite where the
play just sits there
so you'll see here we have idle so
you'll see here we've got
the Sprites that make up an idle
animation there's just one file
standard animation thing
so there's one two three four five six
seven eight nine ten eleven
so what we're going to do is we're going
to say up here horizontally we go 11 and
1.
1 and you'll see it's put lines between
them at the right I just told it and
then I can select them all
and add them as frames to the project so
now we have this little animation I
happen to know this is a 20 FPS
animation because
I've been playing with it for a while
but you might need to fiddle with that
if you didn't make the animations we're
going to rename that animation to idle
in the bottom there and we're going to
click this little button here which says
it plays automatically
and now my mouse has stopped working
again which is very exciting
what's going on I'm going to move my
computer over here
so hopefully stop leaning on it
then try it
again yeah it's just one
you did not do this earlier when I
tested
this is not good
let's try again
it starts working the second the thing's
not plugged in we shall see we shall see
okay so we're back
for now
we've got this idle animation here with
the 20fps set we're going to click this
little button which says please run it
all the time there's this button here
and then we're going to click the place
right up here and then push F which is
going to focus it on the editor and then
we're going to zoom in
and we can see this little player Sprite
and then we click play
and it works so you might notice if you
play Pixel platformer games it just
doesn't look particularly good it's not
like Pixel Perfect to fix that we're
going to go to the project settings up
here
and set the renderer to
nearest on the texture filtering just so
it doesn't try and do any sort of fancy
filtering and then it'll look nice and
Pixel Perfect so if you're doing a pixel
art or a 2d game you might want to do
that sort of thing how do I try to
explain what that means come and find me
later if you want to talk about it
basically you need to do that for kind
of Pixel Perfect rendering anyway we
have this one single Sprite with a idle
animation
uh that's all we need to do right now
next thing we're going to do is we're
going to save that scene so I'm going to
push command s or control s on Windows
and it's going to ask me for a name it's
going to call it player so I'm just
going to say that as player now that
scene file with the node structure that
we've just made is saved out as a file
on disk
so I'm going to make another scene up
here with the scene menu new scene
I'm going to use the 2D scene root node
that God offers me
and I'm going to rename it level
this is going to be our level so we're
going to make a traditional platform
environment for our player to live in
to do that we're going to use something
called a tile map a tile map is a way of
bringing in a whole bunch of Sprites in
one nicely compressed and neat little
PNG and then picking which bits mean
what and using that to layer level
God has fantastic turbo support so what
I'm going to do is I'm going to add a
child node
the mouse has stopped working yet again
does anyone have a USBC to HDMI adapter
by any chance that's probably what's
causing this problem I would imagine
yeah only one port only one port
this is very frustrating
it's the cold keyboard for the whole
computer phrases not just the mouse
anyway
I'll keep going while we fiddle and then
we can see we can fix it luckily I'm not
doing any sort of fancy things with the
screen so I have a level Sprite I'm
going to add a tile map node
okay so I've added a tile map node I'm
very sorry this is very frustrating
oh let's try this one how exciting thank
you please forgive me thank you
appreciate you
yeah yeah we'll see
let's try that
love I love computers
don't we all
okay
I've added a tile map node a tile map is
basically a fancy version of
a a Sprite an animated Sprite like I was
using earlier but lets you have multiple
spots within it to find different areas
so down here you'll see we have this
empty thing at the bottom so once again
I'm going to create an asset over here
on the right and say I would like a new
tile set a tile Map works with tile sets
we're going to select that tile set
and then we're going to drag in the uh
the resource I've provided you tiles
packed over here and just put it here
it's going to say would you like to
automatically create the tiles yes I
would
and then I'm going to drag this up
and set this to 18 by 18.
because I happen to know that's the
resolution of the titles in this thing
so now we have this task set here which
has a bunch of tiles in it for a
standard platformer so you can kind of
Select them all and they're all
independent tiles
okay so I'm going to use that to lay out
my level so I'm briefly going to make a
little level here so I'm going to go
tile map and then I'm going to use the
painting tool here
I'm going to save this scene as level
and then I'm going to just decorate it
doesn't really matter what you do
as long as it kind of makes sense so you
can you know do all the things you
expect like hold shift and draw lines
which are really good
and you can build little floating in the
air platforms by selecting multiple
things
it's really fun to just play with this
I want to put that one there actually
put that one there put that one there
put that one there and because I haven't
got time to explain how to make a player
that can't go out of bounds I'm actually
just going to build a box around the
whole level
which is really convenient for stuff
like this so I'm just going to go big
line here
big line here
big line big line
I'm gonna go over here a bit more and
then do another one up here
and then you get the idea so I'm just
making a box basically so
nothing bad can ever happen so
he says uh and then I'm going to make
another platform over here
put that one there and then just stretch
that all the way across there oops
stretch that all the way across there
okay
and then for a bit of variety I'll put
some up here as well here here I have no
idea this level's even jumpable with my
character but we'll see
uh that's that's good enough so now we
have this this lovely level
uh
that's fantastic
it's a bit ugly with the background so
if I run this right now God I will
attempt to build it and then show me
what it sees so it's kind of just seeing
the top
the bottom actually which is not great
and that gray background is a bit ugly
so what I'm going to do is I'm going to
add a texture to the background so I'm
going to add another child node called
texture
wrecked which is here which just
displays the texture
and the texture actor is looking for a
texture see it's empty here so in my
assets I've got this green
over here
I'm just going to pick that up drag it
into the empty slot you'll see we've got
this green thing sitting here now
I'm just going to be really lazy and put
that there
set it to tail and then scale it
so we'll end up with this nice texture
behind the level
and you'll see it's currently in front
of my level that's because the ordering
in this thing matters so if I change
this stuff here it'll be behind it
so now we've got this kind of like thing
that kind of looks like Sonic which is
good let's see that's what we're going
for uh we need a player so
you'll still see if I run this so if I
push command r or click the play button
got it will compile this game and run it
for me
uh first I'll actually ask because I've
now got multiple scenes It'll ask me
which one I want the main scene to be I
want it to be the level so I'm going to
say select current but it doesn't
usually matter you'll still see the
perspectives of it wrong we'll fix that
in a minute by adding a camera to the
scene the camera is literally what it
sounds like it shows you what you wanted
to see
so to fix this I'm going to go back to
the player
actually first I'm going to add the
player why not we'll add the player so
I'm going to zoom in on my scene here
and drag remember we saved the player as
a scene you see down here this T scene
thing I'm going to drag that into the
scene
and put it just there
so you'll see it's this entity which
encapsulates the entirety of that player
scene into one thing I mean to put on
the ground there and I'm going to save
that now if I run that we won't be able
to see anything different because it'll
still be that weird perspective but rest
assured the player is up there somehow
I'm doing that deliberately just so you
can see that like it doesn't
automatically show you what you wanted
to show
if I save that command s and go back to
the pliocene so you'll see the scenes
are sort of assembling in tabs up here
and you get a little preview of what
they are
uh I am going to make a camera so
first thing I'm going to add to the
player scene is I'm going to add a
remote transform
with remote transform basically says I
am a position somewhere in the world and
I would like you to be able to tell you
tell something else about my location
we need that because we want the camera
to follow the player so by giving the
player a remote transform the player has
a position that can be broadcast to
other things
so I've added the remote transform and
then I'm going to add a camera
2D
so we have multiple new things in the
scene now and in the camera 2D
we don't need to change anything we just
want to leave it exactly alone we can do
some smoothing so you know like some
games it kind of follows you slightly
behind your actual movement it
automatically does that if you want but
we're not going to do anything there
we're going to go fit on this remote
transform 2D I'm going to click it and
then in the inspector I'm going to say
remote path
assign and I'm going to tell it to
broadcast its position to the camera
so now basically I'm saying camera your
position is wherever the remote
transform tells you to be so I'm going
to save that scene and then I'm going to
return to the level we're going to run
it again
the level which is embedding the player
remember and you'll see now the camera
is kind of following following the
player player can't move but the camera
is following the player
it's kind of tiny I don't really like
that so what I'm going to do is I'm
going to quit that
go up to this project settings
go to the window
and say the window should be 1440 by 900
maybe something like that
oh good my computer's doing weird things
again thank you
thank you computer love that and the
scale should be five or six let's go
with six
now we should end up with
this one looks a lot more like a game
so the camera is actually
in a reasonable position now so if I
could move if I could move this player
this would be great
can't they so
we're going to add a script to the
player the script is going to let us
control the player and dust Its Behavior
make it so it can die and things like
that
gonna go player
go on my player node I'm going to click
the player I'm going to click this
little add script button
and I'm going to say I would like a new
script I'm going to ask for a script
that is in uh C sharp not GD script just
because I don't want to teach you Judy
script today I want to teach you C sharp
with unity I got it it's much more fun
and it's a great way to bring over
people who use Unity
inherits from character buddy 2D which
is the root kind of the no we made the
player and we're going to say we want
the basic movement script so you could
have a completely empty script but godo
comes with a bunch of basic scripts for
things you might want to do so standard
3D and 2D movement that's kind of free
so we're going to let it do that
I'm going to call player.cs because why
not I'm going to correct and it's going
to file up vs code because I've said
that's my preferred external editor
so
here is the default script it's given us
it sets some speed uh jump velocity
it's importing a global property for
Gravity which is just a thing you can
Define how far fast it pulls things down
and we have a physics process function
which is called every tick which is how
we move things into Game World which is
basically checking if you're on the
floor
so if you're not on the floor on the
floor is a function in godo which I'm
going to save this and quit so hopefully
it starts uh Auto completing code
with a bit of luck
there we go okay so on floor is a
function that godo provides that
basically says of course it doesn't
whatever on4 is a function that God
provides it basically says am I touching
something else so if it will return
derivatives if we're not on the floor
we're probably in the air which means we
need to apply gravity that's all this is
doing uh this is checking if a key is
pressed and is jumping if so by applying
the jump velocity to the Y value of the
character and this is checking if you're
pushing left or right and basically
changing the vector you're pointing
accordingly that's all this function is
doing then we call this magic move and
slide function which basically just
magically automatically tells gotta to
move it in goto 3 you just have to pass
the velocity and the the the magnitude
into move and slide now it just uses the
values on the thing it's currently
attached to so whatever you call move
and slide on it pulls the numbers it
needs for you
so now if I run this simply by having a
touch description you'll see now the
player if I select the player and look
at the Players inspector over on the
right you'll see it's got a script
attached
if I run this now after selecting the uh
saving the scene and then selecting the
level scene we can move the player or
can we we'll see
so I can move it so if I'm if I'm really
quick
if I'm really quick while it starts you
see I can
so I do have control over the player but
it's not quite what we wanted
that's because there's no physical
barriers on any of the stuff in this
world so to fix this we actually need to
say there are colliders on things so the
first thing I'm going to add a collider
to is the player so I'm going to go back
to this player scene and go well
actually you can see here this this
little error
which has been there all along has been
telling us the node has no shape so it
can't Collide or interact with lyrics
Just because this thing has a picture of
a player character doesn't mean the game
engine knows that the shape of that
player character maps to that picture so
we need to add a collider so I'm going
to add a child node
of collision shape 2D you'll notice
there's 3D versions of all the things
I'm saying God I just 2D in 3D
sometimes I teach this as 3D if you want
to watch a 3D version of this tutorial
go look at LCA talks from a year or two
ago I did one there with a different
game
uh looking at a collision shape
here
and then I'm going to go over here on
the Collision shape and tell what shape
it is I like to use capsules so I've
created a capsule shape and you'll see
here now we have this little capsule
around the player I'm going to make it a
little bit smaller
and make it touch his feet
and I'm going to save that
so now if we go back to the level
we will not fall through the ground or
maybe not we'll see oh the ground also
needs a collider right so to do this
because we're using a tile map we have
to click the tile map
which is this thing
and then we have to say
over here in the properties of this
timeout we have to say we would like a
physics layer
and you'll see here if you're paying
attention that you can add multiple
physics layers and mask them against
each other so you can have physics
layers that only cause collisions but do
not report those collisions or you can
have physics layers that do not cause
collisions but report when they
intersect something so you can use that
for detecting when you've hit certain
objects we're just going to go with the
simple option and make one physics layer
because I've had the physics I already
to Define what shape belongs to each of
these tiles uh we haven't got time to be
fancy so I'm just going to select the
entire uh whoops that was the wrong
button I'm going to select the entire uh
tile map here just by dragging and I'm
going to click on
this button
and then I'm going to go down to here
and go here I'll explain what I'm doing
one second so I've just selected all
these tiles I haven't I've selected all
of these tiles
in this inspector which kind of is the
inspector for the tiles you currently
have selected there's a physics section
and I'm going to say we need a shape so
you can draw a polygon on here if you
wanted to get fancy and do it manually
but if I just push f
it will fill a shape to the square
so now every single one of these tiles
no matter which one I pick have you seen
on the bottom there has a square
collider on it
that's good for now good enough saving
that running
now we sit on the ground and because
I've mapped the controls it works so
that's pretty good that's a good start
always colliding it's a good start so we
can also we can also jump
which is nice
so we can get up there but we can't do
the traditional platforming thing of
jumping through from the bottom which
kind of sucks
and we slide and we don't animate
which is also a bit crap
uh let's fix the animation first so to
fix animation we're going to go back to
that player in our player see and click
the player Sprite
and add some more animations so I've got
a couple more animations we have jump
which is just a single frame
because when you jump you just want to
basically
right it is still technically 20 FPS but
it doesn't really matter we also want a
move animation
which is not a single frame
that's one two three four five six seven
eight nine ten eleven twelve
twelve by one
so it's segmented again based on what I
just told it
the screen is not updating that is very
exciting
when did it stop updating I am cursed
today
oh good that's that's that's that's
totally mysterious
I've been presenting off this laptop for
weeks with no problem
it's fine okay let's keep going select
all those frames add those frames I just
made so I basically just split the
frames up based on 12x1 so now we have a
nice move animation
it looks great
it's 20 FPS
right
looks fantastic uh what other animations
do I need to add
um
you do not because you're just going to
flip the Sprite
and I'm very lazy that's good for now so
I'm going to save that and then I'm
going to go back into the player script
so to make this actually animate we need
to get a handle on that animated Sprite
node so we can instruct it to change its
animation when different things happen
in the code
to the to do that I'm going to add a
property up here
because my order complete is working it
would never stop working here we go
actually there we go great
animated Sprite 2D you'll remember is
the same type as this node
so we're going to say we want to animate
the Sprite 2D player Sprite
and then in ready
which we don't have currently so we're
going to go public override
void I think it's called ready
yep
so this function is called when
something is instantiated into the scene
only once and because ready we want to
get a handle on the player Sprite
so to do that we get node
of type animated Sprite 2D
and I'll explain what I'm doing a second
then we put the name in here so this
thing is called player Sprite
my biggest complaint with goto now is it
loves strings it uses strings for
literally everything even when you're
using a language where there are better
options
so for whatever reason and it makes
sense with gdscript and made sense long
ago when they created it and it's the
thing lots of other game engines do as
well you refer to everything by its
string name which is just weird to me
but it works
it seems like it could be fragile under
certain circumstances suppose that we're
saying there is an animators brought to
it equal player Sprite and when you
responding to scene please inspect your
node tree and find the animators bright
2D node of name player Sprite and assign
it to that
if you use GD script there is shorthand
which does all that in one go so it's
one of the negatives of using C sharp
anyway we have a handle on the uh the
player Sprite now
so what I'm going to do now is I'm going
to
basically
change the Sprite when we need to change
the Sprite so if you're on the floor
so if you're not on the floor so if
gravity's happening we need to do some
certain certain things so because we're
jumping if we're inside this
right here we are jumping that's what we
need to know so if velocity dot y
is
jumping basically
change the player Sprite
to jump
it'll change that one frame animation of
it going like that
otherwise
play full because we're not on the floor
but we're not jumping which means we're
falling
I'll set the full screen up in a minute
that's what I forgot to do
that's everything we need to do there
otherwise
so if we are not on the floor which
means we are not not on the floor not is
on floor which means we are on the floor
we then need to sorry Mike C sharp code
style is terrible by the way don't judge
me uh if velocity.x is zero
that means we are idle
so we are not jumping we're not falling
we are not moving either
we play idol else player Sprite
play
move
so that's everything we need to do there
I need to go back out of full Sprite so
basically
I'm missing a bracket
on 27 I'm missing a bracket oh yeah
currently it's
up yeah I think it's up but you could
you can change that just to be confusing
down
so yeah so it's the other way around yes
very good
okay so one thing I do on my daily life
is I work with Unreal Engine Godot and
unity and they all have completely
different coordinate systems and it just
does my head in I also program Swift
c-sharp rust and a bunch of other
languages so I forget semicolons
brackets don't mind me I do know how to
program I'm just very stupid
um
so here we have a things by saying if
we're if we're on the floor and not
moving play idle or on the floor and
moving play move if we're in the air uh
and jumping play the jump animation
you'll be in there and fall and play the
full animation
the only and we've got to handle to the
thing that lets us play the animation
the only thing I forgot to do is any I
don't think I added the the full
animation to the Sprite so I'm going to
add another animation here
I think I call it fall
and I'm pretty sure it is just a single
frame of falling I think it's just the
exact opposite of the jump animation
yeah okay I'm going to save that and run
and we'll see what what stupid mistake
I've made
so now he runs he runs backwards still
we'll fix that in a minute and he can
jump
that's pretty good that looks pretty
good to me
so now we're going to make him flip the
other way we need when he needs to go
the other way
um that's a bit disappointing so
in our player script
we're going to go down to the line
this one here
and basically say this is if we are
moving
so if we do not have a zero Vector we're
going to say if velocity dot X is zero
then we want to play it
what have I done oh my gosh
I'm so stupid don't mind me a player
Sprite
dot flip h
and hopefully that's obvious what that
does it flips it on the horizontal else
uh
velocity
dot X is greater than zero then player
Sprite
flip
uh actually I'm gonna do a different way
equals true
so if H equals false sorry I've changed
my mind on that a few times so basically
depending on which direction we're
facing flip the Sprite
so that should now feel significantly
you know around the player scene you can
see what happens I ran the player C
which means we get the player doing
nothing
gotta run the correct side now
so hopefully now go that way it goes
that way go that way it goes that way
pretty good right
so what's on we've got time for a couple
more things okay
so the next thing I'm going to add is
these platforms don't feel very good to
jump at because you want to go through
them and land on the top
thankfully God who knows that you're
probably making a stupid little platform
game and makes that easy
very easy so back in here where we set
up the physics Collision for the
platforms
if I select all of these again
and because I'm tremendously lazy I'm
just going to do it to all of them
realistically you'd want to carefully
map out a polygon for each of these so
you don't end up with all the same thing
so you'll see this polygon is a square
if we go down here to the polygon we've
defined
and take one way
you'll notice they're now all one way
which basically means they only Collide
on the top you can change the direction
that Arrow points and you can give it
kind of like a feather like a a limit
where you can still pass through it and
I'm going to run
yes but I haven't not got time to show
you that but yes you can absolutely do
that so now if I jump up at the
platforms I should be able to go through
them along on the top
which feels good already right
having designs level very well but it's
it's a nice feeling
okay so we have about what 10 minutes
left I think that's probably enough time
to make an enemy so I'm gonna attempt
fate
the enemy is already the HDMI cable but
we'll uh we'll see how this goes
so I'm going to make a brand new scene
okay made a new scene and this scene is
going to be very similar to our player
it's going to have a character body 2D
as the root
you're very mature you don't laugh when
I say root that's great most people most
of the people laugh at all the stupid
things gaming is cool stuff because
you've got like root nodes you've got
like empty children you've got all sorts
of stuff that like people just giggle at
so I'm very impressed with you all we
have an enemy which is just a character
body 2D again I'm going to add an
animated Sprite so the player can
actually see the enemy doing something
enemy Sprite and once again I'm going to
add an animation to that Sprite over
here
and my mouse has stopped working again I
love that
I'm going to give it a second there we
go
use bright click you still see yep okay
cool this player needs a move animation
sorry this enemy needs a move animation
and we're going to add my enemy frames
that is definitely not on my end that is
so weird
not
this is the so I don't know don't know
yeah this is an entirely different
visual
I'm going to go with that something
weird God is doing with the drawing
context it doesn't really like being
projected but uh
we'll see let's see if I can make it
full screen
so yeah no no I don't know what's going
on there that's weird this is very
unique
really you can you can actually see the
mouse cursor but not the con okay we're
going to unplug it and do that again
this is fun it's okay we still have time
to make an enemy
I hate computers I'm ready to give up on
the whole tech industry honestly
um okay
yep can you see this
okay so I'm adding a run animation which
which is uh nine hello twelve
that's so weird
okay select uh clear frames there we go
there's 12 frames of a little frog dude
looks very menacing
we'll play him he's 20 FPS as well
very menacing little frog I'm going to
add a collision shape to the Frog so you
can actually collide with things
and give it another capsule
so he needs the capsule to touch the
bottom roughly yep that's good enough
and I'm going to save this as enemy
and add a script to him
again we're just going to leave it as
default basic movement
so if I left this as it is now we'd be
driving both characters at once with the
input so I'm going to actually delete
all of this so I just wanted to get the
basics
so I'm going to actually go over here
and get a script I prepared earlier
just because I don't want to have to
type all this
I'll explain what I've done so this
player this enemy class gets a handle on
the enemy Sprite Which is the thing we
just made
we're not using that yet so I'll delete
that
and when it's ready it gets it gets a
reference to that
and then as it moves it checks if it's
on a wall we don't want that either
sorry
uh it moves and it flips its spot
accordingly so if it hits a wall so it's
going to run this image it kind of hits
a wall and bounces back and goes the
other way and keeps going so if it hits
a wall it flips its direction
that's all it does so is on wall is very
simple is on floor just checks if you're
touching something on the sides these
are all just convenience functions that
godo provides you could write all this
manually Yourself by checking the
direction of things but you don't need
to
so we say if we flip the Sprite we're
going one way flips otherwise otherwise
we just move
and it just goes back and forth so
that's all this is going to do which
make sure it's called Sprite
and here enemy Sprite I'm going to save
that into the level I'm going to make an
area for this enemy to go because you'll
see there's actually no spot for him to
sit currently so I'm going to go into
the tile map click this button
lay the tile map out
sorry I have stuff click a few things
before it works now I'm going to put a
block here
and I'm going to extend the floor a
little bit
so I can go there and I'm going to put
another block here this is a really
silly level but you get the idea
so now down here we have an enemy we're
going to drag him into the level
and put him there
and I'm going to drag him down onto the
ground
and hopefully
here I run this he'll go back and forth
in that spot is it
nope currently he's not let's find out
what I did wrong who would debugger how
convenient
account instant script make sure the
script exists okay so the problem is
here is this is capital E and the script
is not
so we're just going to rename that
oh my gosh
I'm just gonna I'm just gonna quit Gotto
and unplug and plug back in I'm going to
show you the final version because
clearly that's not fun and we've got
seven minutes left or so
so
basically that enemy was going to go
back and forth in one scene and not do
much of anything
here is the final version of this little
project which I'll give you the source
code to before we finish today
is that can you see anything oh my gosh
mcec
there we go okay this is the final
version that I made to test this
it's exactly the same as the code you
just seen it all just works
except for the freaking room
um
I don't know how to fix this but there
is a full game that you can download on
git I will send you the link now so you
can see it is very very fun for you to
play with this and it means you can
learn so if anyone wants to play with
this outside of the screen that
constantly flickers you can look at my
GitHub which is Paris paparsba and it's
eo23-godo and I have no idea why this is
just flickering At Me Now
I'm going to give it one final attempt
to show you the final version of this
game
and otherwise I'm giving up
but you get the idea goto is a very
simple way to build games out of pieces
and you can basically build things out
of these modular components that make it
very simple to not have to think about
too much flickering not have to think
about too much about what's going on and
whether you need to make things relate
to each other in a certain way because
they kind of all just talk to each other
in a way that makes sense
I'm gonna give it one file attempt to
show you and we'll give up
computer
okay so you can get a copy of the game
here all the source code of the final
version is there
please please play with it it's really
quite fun
all the credits for the art I did not
make any of the up by the way I stole it
all it's all cc0 or CC Buy
um
you can find me on Mastered on there and
we're writing a book on Gotto which will
be great that's not out yet that's just
totally a placeholder page but follow me
on social or bookmark that link if you
want to play with it
um Here's the final version of the game
which is all the same features you just
saw this enemy is exactly the same code
that we were just making he just goes
back and forth and hits the thing
there is another enemy up the top
somewhere which does the same thing but
stays on a platform
that's accomplished by pointing raycasts
which are basically perfect lasers that
tell you when they're hitting something
down on either side and then tell if one
stops detecting something it flips and
points the other way
there are also coins you can collect in
this version so you can jump up on
platforms and collect coins
you'll see the coin go up in the corner
and if I jump on one of these frogs it
will kill me
and respawn me all this code for this
version is in the repo so if anyone
wants to play with this you can grab
this
lots of people the most frequent
question I get asked about God is should
you learn GD script or C sharp
I don't love C sharp I think it's a
great language but I don't love I don't
enjoy using it I think it's got lots of
great features but I don't enjoy writing
code in it that said I think if you want
to do this professionally or make big
games for real you should do C sharp
just because there's a bigger community
of stuff out there and you can bring all
sorts of random dlls in that do all
sorts of good stuff from the massive
library of stuff that people have done
in the mono and.net community
um if you are just doing this for fun
then pick whatever language you enjoy GD
script is really easy to use and there's
lots of convenience helpers which means
you don't need to initialize stuff
already you just say I would like a
handle on my animated Sprite and it
gives you one
it's much easier to use it's also all
built into the god of editor
so I would say GD script for hobby hobby
or using or playing or building games
with your kids C sharp for anything
slightly more serious than that other
than that I'm happy to take questions if
anyone has any questions and my computer
keeps cooperating but thank you for
listening apologies for the tech issues
you've been a great audience regardless
[Applause]
uh thank you Paris that's great and we
should apologize
presented in this conversation center so
many times and something's gone wrong
every time but luckily the next day
people are here because they're actually
good at their job
uh any questions for Paris yes
anyone
I was just wondering do you know if
there's any performance differences
between GD script and C sharp C sharp is
significantly more performant
um you can also Bridge it to cs plus and
all sorts of crazy stuff
um
I say it's significantly more form that
is because that is strictly true whether
that actually makes a difference when
you're building a silly little video
game is another question look at this
it's just working perfectly now
Unity when would you choose to use color
until recently I would not have chosen
to use godo for a professional project
so we build games for a living I've been
doing that for 15 years I would not have
chosen good o until recently
um
I would not choose this HDMI cable slice
this through I'm not good as I've got 04
if you want to make a 2d game it is as
good or better than any other
proprietary options
if you want to make a 3D game it really
depends on what you're doing
it is a lot Messier in the 3D space than
it is in the 2D space simply because God
as I understand goddess started as a 2d
engine
and they kind of added 3D features so it
was an afterthought in terms of the
architecture it works great it's very
powerful you can functionally make
anything in all of these game engines
now they're all equivalent feature wise
if you're willing to put the work in but
goto makes 2D games a lot easier than
Unity right now in my opinion and it's
got a better feature set it's also free
and there's like 100 megabytes of RAM
and 100 megabytes to download and
doesn't require licensing servers and
all sorts of garbage
practically the only consideration where
you would want to use Unity over Godot
for a 2d game that you were starting
right now is if you have an established
team with unity knowledge or and this is
a big or you are deploying to a
proprietary platform like the switch
Xbox or Playstation where you currently
for Myriad Technical and legal reasons
godo makes it difficult
because basically those platform holders
require that you certify the code you're
running on them the open source thing of
God oh can never be certified the same
way as things so you need a proprietary
Fork of goto which is licensed
differently to go through the certain
process of Microsoft Nintendo it's the
user proprietary problem there are
companies that have special license
versions of Grotto will do that porting
for you so if that is actually a thing
you can still solve it's not
insurmountable
not great yeah are these oh sorry oh
sorry my bad I broke the rules sorry
um let's go with this one
first second
my fault sorry
good
um so I've been following Glo Loosely
for a long time and
back in the day there were bindings for
other languages used with the Godot
engine but they're always kind of
cumbersome has that changed with Judy
native and stuff has it gotten a bit
better or are you still kind of
struggling it's a little bit better it's
more mature in that they've like taken
the weird janky thing they had for years
and it's now got an ecosystem
so it's a kind of a janky ecosystem so
it's better than it used to be but it's
still not great uh if you are binding C
sharp stuff from like the whole
world.net that's actually really good
that works great
but if you're trying to do anything else
a bit fiddly yes
I was just wondering if you have run
this workshop with kids and how it how
that works or what age groups it works
with your experience with that look I'm
on this I haven't run anything we've got
it for this is the first audience I've
spoken to God before about just because
it's so new uh We've taught a lot of
kids game development with a lot of
different Technologies kids pick it up
from like seven years old and eight
years old and above they're pretty Savvy
um I would recommend if you're teaching
kids Godot use GD script just because
it's one program you'd have to explain
jumping out to vs code
and like kids don't care about vs code
extensions in the marketplace and
installing the c-sharp it's just kind of
a nightmare you don't need whereas GD
script is just like I would show you if
my computer was actually doing anything
of use
GD script is all in the goto editor it
has a text editor inside the god already
so when you click the script it opens
that in in it's got autocomplete it just
works the documentation is built in
there's a pane you can open it's great
but it's a weird propriet
it's a weird proprietary language that
doesn't exist anywhere else but it's
fine for teaching kids
um has you have you or your team uh
looked at the uh effort that would be
going into refactoring a project from
Unity to uh Godot and uh I guess just
the interoper operability at the moment
between the two um look refactoring a
project is basically a nice way of
saying you would have to rewrite it from
scratch so moving between game engines
it's basically completely right that
said Unity C sharp got O C sharp of
course if you have some underlying
libraries that I'll see Sharp that's
just code that will work so if you
abstracted your game to the point where
you could just call some library to ask
it what you needed to do then maybe you
could Port it relatively simply but so
much of a game engine is assembling
things in some sort of visual sense in a
scene that you would still have to do
all that in Godot and there's no reason
to automatically translate that because
that would just be weird so you could do
it but I wouldn't recommend it it's
basically a rebuilt from scratch
um yeah yeah
um I asked this question as a mobile app
developer who's never done games yeah
but I have heard that uh Unity is a bit
of a pain in terms of Version Control
and yes version management is goto any
better on that fantastic with Version
Control Unity um Unity until recently
was a pain it created these like big
weird binary blobs that basically
required you to use per force if you
wanted to use any sort of Version
Control then a few years ago the unity
remembered that git exists and started
supporting that in the editor
um and that's kind of fine now Gotto
natively supports skit so let's temp
fate here let's
when you create a new project in godo it
asks you
it relaunches when you create a new
project in dodo it asks you if you want
to create Version Control metadata and
currently only Sports git but I think
that's a modular system you can plug
stuff into so it makes it very neat to
work with Git
Works fantastically it could be
different than everything you can diff
the scene file
good timing
I think we could do one or two more I'm
happy to take a couple of questions I've
got otherwise uh yeah we will say thanks
again Paris and another round of
applause
[Applause]