Godot 4.5 Tutorial: Modular Level Design with GridMaps (Backrooms Part 2)
563 segments
We have a character, but they are
trapped in a void. To make a true back
rooms game, we don't need just a room.
We need a labyrinth. So, today we're
going to learn how to paint 3D levels
using GDAU's grid maps and then how to
handle the one mesh per cell limit.
Welcome back to GDO dev checkpoint. In
the last video, we built our player.
Today, we're building the world. We're
going to use grid maps, but with a
twist. Since GDAU only allows one item
per grid cell, we're going to build our
world in layers, just like Photoshop
layers, but for 3D. First, we need our
pieces. We need a floor, a wall, and a
ceiling. But we need to make sure they
align perfectly. So, back in our project
here, we're going to make a new scene.
So, scene, new scene, be a 3D scene.
And we're going to rename our node 3D to
mesh pallet.
There we go.
And we need a child node. It's going to
be a mesh instance 3D.
Now rename this to floor.
And the mesh we're going to use with
floor selected and the mesh empty. We're
going to use a plane mesh.
We'll click on the resource here and
change the size from 2x two to four to
four 4x4.
Now to give this some collision, we're
going to do here is go up to this mesh
here in the top toolbar with the floor
selected. So mesh, create collision
shape. And we don't want to be a
sibling. We want to be a static body
child. We want to be a try mesh. And
then create. and it automatically
creates a static body 3D and a collision
shape 3D. That way our player will be
able to walk on it. Now, make sure we
keep this floor at 00 0 where it's
transformed
here. We want to move it. That'll make
more sense when we start placing the
tiles in our level. Now, we need the
wall. So, back in the mesh palette,
right click, add child node, another
mesh instance 3D. I'm going rename this
one to wall.
And for the wall, we're going to use in
the mesh in the inspector, we're use a
box mesh.
And click on the resource here. For the
size of this one, we're going to use
this 4x4
by 0.2.
There's a wall. We also want to move our
wall up so it sits on the floor. going
to scroll down to the transform here.
And we move our Y to two. Since it's
four and go half, we'll bring it up
straight to the floor.
For the walls, we don't want them in the
center of the floor. We want them on the
edges. So, for the other transform,
we're going to use Z2.
That's going to push our wall to the
edge of the floor.
All right. Now we need a ceiling though.
Oh no, wait. Before we do that, we need
a collision. Back on the mesh here with
the for the wall selected. Create
collision shape. Static body child. Try
mesh. Create. Now we have collision for
our wall. Now we need a ceiling. So
right click, add child node, mesh
instance 3D. This one is going to be
another plane. So in the mesh, plain
mesh, we're going to rename this one to
ceiling
ceiling. There we go. Now in the mesh
here, I'm going to change the size to
4x4
and scroll down to transform. You want
to bring this up to the top of the wall.
Our Y is going to be four.
And then we notice here we go down. we
can see right through it. We actually
need to flip this healing tile over so
when our player is in the room, they
look up, they don't see right through
it.
We do that by just going to our rotation
X and 180. There we go. Now our ceiling
is facing down to the player. Great. Now
we need to do the same thing and create
a mesh collider. With the ceiling
selected, mesh, create collision shape,
static body child, try mesh, create. Now
we have a collision on all three of our
tiles.
Now our tiles are made. Back rooms is
known for its yellow wallpaper
and yellow lights. Just the atmosphere.
And here's what we're going to use for
that. On openr.org
is a CCL, so you can use this for
whatever you like. is the back room's
materials. It's even got the pool,
something we can add into there. Also,
the yellow wallpaper and the office tile
ceilings. So, it's perfect.
Either download it from here or I also
have a tutorial assets folder that I
made that's going to have all the files
we reference in this tutorial. So you
can download it from here and just get
everything which has fonts and sounds
and stuff and also the PBR texture pack
or you can download them individually
and put them wherever you like. The
links will be in the description.
So once you have that downloaded from
whichever one you choose, we're going to
go ahead and right click on our file
system, create a new folder called
assets,
and then right click again on the asset,
create a new folder called textures.
I'm going to folder. Actually, I'm going
to rename, right click this, rename
textures to just materials.
Make it a little more
universal. All
right. Now, with the materials folder
selected, I'm going to drag in all the
assets,
select them, drag them in, and drop.
That'll import all the ones we need.
Now, I have the carpet and the ceiling
tiles and the wallpaper. Now, if you
download the pack completely from the
open game art, you'll have a lot more to
choose from. Now, I chose specifically
ceiling tiles, too. And you can choose
whichever one you like.
But if you want to follow along, these
are the ones I'm using. Now, you start
with the carpet or floor selected.
Scroll back up to surface material
override. Now, there is a material
section here in the resource mesh.
But I noticed that doesn't work very
well with how we're going to do the grid
maps. So, we're not going to put the
material in here. It works better if you
put it in the material override here.
So, we're going to do the carpet.
We're going to use the carpet color.
Drop it in here.
And then open up the resource here. Then
we need to go into the roughness.
We're going to add the carpet
material in there.
And then we're going to go into the
normal map. We're going to activate that
and drag the normal map here.
gives our carpet a lot of depth.
Now, here you can change settings and
make it more rough, less rough, right in
the middle.
Also, if you want it less brown, you
could actually use this carpet normal
and then drop this into the texture.
Oh, not the texture, the actual material
drop here. This makes it super yellow.
You can actually turn that down in the
albido
and darken it
quite a bit. Depends what you're going
for. A lot of people have the yellowish
carpet in the background stuff. But for
now, we're just going to keep it at a
default. I'll control Z all that.
Oops.
That didn't do the other thing. Put my
carpet color back there.
Our texture is all back to normal. We'll
keep it like this. Make this zeroed
again. And then we want to do the wall.
Have the wall selected.
And the surface material override.
Go into my wallpaper.
Wallpaper color
here.
Then go into my roughness.
Wallpaper rough
normal map
normal map. Perfect.
Then we're going to go into the ceiling.
Select the ceiling surface material
override
and then our ceiling tiles
the main texture.
Then into our roughness
and then our normal map.
There you go. You can also bl the colors
there if you like, but we'll keep it as
default for now. You might notice how
big our wallpaper looks. That's
stretched out. If you compare it to what
it's supposed to look like, super small.
Well, why? Well, it's because GDAU
stretches one image across the whole
wall. So, we want to actually separate
this into a bunch of smaller images. So,
if that's our 4x4,
is making it one by one. They call that
a UV mapping issue.
And to fix this, we need to activate
thing called triplaner mapping.
So with our wall selected here, we need
to go to the UV1
which is in the surface material
override and click that and expand it.
Scroll down to UV1.
Then we have this thing called trip
planer and select that to on.
automatically you'll see how smaller it
gets. But we have it too small. So our
offset scale here. Actually what we're
going to use is 0.5
across the whole thing.
And that is about the same look as we
have here.
Perfect.
That's what we're going for. Now the
charter can sometimes have performance
costs or weird artifacting on the
corners. So if you notice you have that,
you can actually deactivate this and
then
just set this
scale to four, which is the size of our
our box mesh here. It'll kind of do the
same thing, but the track planer works a
little better like a set it and forget
it kind of solution because they have to
manually adjust
corners and those kind of thing for the
grid map walls. So, we're going back to
0.5
then turn our trier back on. Perfect.
So, either way decide the word works for
you, that's what I'm going to do. All
right. Last but not least, now that we
have all of our tiles, at least the ones
we're using so far,
we need to actually get these into the
world so we can use them. And to do
that, well, we grid maps aren't going to
use a tscn file, which is the scene
file. We need to use something called a
TR file. So, it's a basically a
resource. So, the way we do that is we
go into our scene
uh tab here. We need to go to export as
and we're going to export it as a mesh
library.
And from our root folder here, we're not
going to put in any of these folders.
We're going to make our new folder call
it resources.
And what we're going to call this is
mesh
pallet
there. We're going to tr.
So the TRE file that's what we're going
for. Then we have merge with existing
which is good. Gives me have to reexport
which we will later. We want also want
to apply mesh instance transforms. We
don't do this everything will be set at
0000 including our ceiling and our wall.
We don't want that. Now apply the mesh
instance transforms. Save.
And that's it. We go into our file
system and our resources. Now we have
our mesh pallet resource and we have
access to three of these tiles
individually.
Now there's a little bit of secret sauce
to this one. Now if we try to put a wall
on a floor in the same spot with the
single grid map, GDAU will delete one.
So we need to create separate grid maps
which is where the layering comes in.
So, back in our world, seen here, we're
going to right click the world root node
and add a child node called node 3D.
That's the standard one.
Then, double click that. And we're going
to rename this node 3D to level.
Now, in this level, I'm going to right
click, add child node. We're going to
call something called a grid map. That's
right here. and create that, I'm gonna
rename this one to grid map
Laura.
Then with this grid map selected, you'll
see over here in our mesh library, now
that's what we're going to use with our
mesh pallet because that's going to be
the library we want to use. So in our
resources folder, click and drag and
drop this into our mesh library. Now
you'll see we have our ceiling, our
floor, and the wall we made. We also
want to go to our cell size here and
we're going to change it to the cell
size we chose which is four by 4x4.
Now we want two more maps over right
click and we can duplicate. This one's
going to be called
the wall. We duplicate again. You hold
down control D and it duplicates. Now we
want one called the ceiling.
And now since we're going to make
something new, we do not need our ESG
box we used for testing. We actually
delete this and get rid of that.
And now we can paint our level without
any conflicts. We're going to start with
the floor. Then we'll carve out a maze
with walls. And then we can cap it off
with the ceilings.
All right. Now we can make this spectre
a little smaller. We do our floor here
and make some more room. So you got a
nice grid pattern here. What we want to
do is get the floor section here and we
want to click.
We want to make sure we're in our paint
section here.
You see how we're off center of our grid
map is we are not centered. We don't
want to be centered on Y. Going to turn
this off. Since we have our setup
already 4x4, we turn this center Y off.
Now, our
floor fits perfectly in our nice 4x4
cells. So, we start by doing a like a
10x10.
So, we'll do a 10x10 room here.
I guess that's a 12 x 12. That works.
And now we have our floor. You notice if
I try to put a wall anywhere here. Going
to delete
the cell that it's on. Anything else you
only have one item per cell. Z. Now do
it's why we did the three and click our
wall section. Now we can put walls up.
And then our we're off center here. So
our mesh grid map here. Nope, not that.
Sorry. Use our cell section here and our
center Y and turn that off. So we can
actually be on the line that we set in
our mesh library. We can create a walls
all the way around.
Then you can rotate with S.
S again. Sometimes you got to do it
twice.
Rotate all the way around. There we go.
We have to have the wall away facing
the opposite way of this wall or else it
won't work.
You do S. There we go.
Let's surround our whole area here.
Now we're boxed in. Perfect.
Then we can create a little bit of a
maze here.
Do this.
Maybe we'll do all this.
And for this you can kind of do whatever
you want.
That works for now.
I'm actually make another floor spot
here. Do like a little entryway
about in the corner right over here.
And I want to put some walls here.
Surround this with walls.
There we go.
Right. Now we need the ceilings. The
ceilings. I found it easier to the world
environment. Select that. And change our
color just to white. We can see better.
We go back to our ceiling. Our ceiling
tile. zoom in here
and we want to once again in our cell
section here center on the Y.
That way you see your tiles.
And then if you hover over the floor
where you want the ceiling to be above,
that's how you're going to see it. You
click there. Now we have our ceiling
there.
Then you just keep doing that
there and there.
Now you go through your maze.
All right. Now we have our whole maze
covered.
It's like this. I think I got it all.
Remember, we can't see it from the top,
so it's hard to see that way. I think
we're good.
It works. We have a solid room. Now,
let's apply some maddening buzz and then
some lights.
First, let's turn the lights back out
our world environment. We can
background make it black again.
Now, the backgrounds are scary because
they're dark. They're scary because they
are too bright. Need that uniform yellow
light.
Right click on our level node, add child
node. Node 3D
and call this lights.
Then I'm right click lights. Add an omni
light 3D. This omni light in the
inspector the light.
Change the color of the light to
a yellow. The one I liked was FF
EB0.
Nice cool yellow.
Bring it up to the ceiling.
We are going to need a bunch more of
these. So
click on that. Hold control and then D.
You can duplicate.
Then you can just place them around your
level.
All right, now we have the lights
everywhere. We also want to be able to
hear that maddening buzz from those
fluorescent bulbs.
Do one more thing here with the world
environment. We're going to do is set
the
inspector in the environment tab here,
our tone map. Let's set this mode to
AGX.
Gives a more realistic appearance. Then
we're also going to set the exposure
1.5.
Brighten it up a bit.
Then get these corner shadows that are
less obvious and turn SSAO on.
Now let's add some blending in our
corner our corners.
While over there, check the lights. Make
sure our We're going to turn these
shadows on. So, go to the top light.
Select all the way down to the bottom
one. Let's turn these shadows on.
And then we want to make sure the
attenuation is 1.5.
There we go. We're going to turn the
range up to 10.
Yeah, that's good. Now the shadows
aren't too dark. Let's see how that
looks when you run the game here. Run
current scene.
Yeah,
doesn't look too bad.
Now we need to add that buzz. Let's exit
this. Make the sound in here in our file
system asset folder.
Let's add a
right click, new folder, not a scene.
Right click, new folder. Call this one
audio.
Now, once again, you can get these
assets. I'm going to use the sound one
included in the Google Drive link I have
in the description, or you can use the
resound here
where I got it from the CCO. You can see
you can use it for anything you like.
Either way you get it. Once you do,
I'm going to open that folder up. And
with audio selected, I'm going to drag
in the light bulb buzz sound,
which I named light bulb hum.
And then back up in our
hierarchy here, right click on the world
node. I'm going to use a audio stream
player right here. Now, why not a audio
stream player 3D? Well, 3D player sound
from a specific point. You'd only use
that if you wanted the buzz to get
louder as you walked closer to a
specific light bulb. But since the
background is an infinite mono yellow
hellscape, the global 2D sound feels
more claustrophobic and consistent. So,
we'll select the audio stream player and
with that selected in our stream over
here, we're going to drag our light
bulbs out into it.
Going to make sure we click auto play to
be on. And then in the parameters, we
want looping to be on as well.
We'll see how loud that loud that is
here. Go and select the run current
scene.
There you go.
Yeah, nice creepy buzz. It's bound to
drive anybody crazy. Now, that volume's
too loud on yours. What you can do is
you just turn down the decibels here.
So, you want to go minus 10 and then try
again.
If that sounds better to you, you can go
and do that. Adjust it as you see fit.
All right. And go and close that.
Now we're starting to look a bit more
unsettling. We have the maze and the
player trapped inside it. And by
separating grid maps, we have total
control. We can turn off the roof to
work or swap out the floor style without
breaking the walls. Now, if you're
following along, take a screenshot your
maze and tag me on Blue Sky. I want to
see your level layouts. This still looks
a bit too clean. Looks like a video
game. So, the next video we're going to
make a little more world environment
effects, maybe some fog glow, and also
most importantly, that VHS
post-processing shader to make it look
like real found footage. A special thank
you to our new coffee supporter, ZZZ.
You helped make this possible. And if
you found this helpful at all or fun,
leave a comment on what your GDAU
gamedev goals are. Please like and
subscribe. Hit that notification bell.
It really helps out the channel. And
thank you to all our other current and
past Patreon and coffee members. Your
generous support keeps the channel
moving. And if you want early access to
tutorials, source code, or suggesting
future tutorials, please consider
becoming a member yourself. The links
are in the description. I'm Spaghetti
Syntax. Stay curious. I'll see you at
the next checkpoint.
Ask follow-up questions or revisit key timestamps.
The video tutorial demonstrates how to build a 3D labyrinth for a "Backrooms" game in GDAU, overcoming the limitation of one mesh per grid cell by employing a layered approach with separate grid maps for the floor, walls, and ceiling. It covers the creation of basic mesh pieces (floor, wall, ceiling), applying PBR textures with a focus on correcting UV mapping issues for walls using triplaner mapping, and exporting these pieces as a mesh library. The tutorial then guides through painting the multi-layered level, adding characteristic yellow lighting with environmental effects like AGX tonemapping and SSAO, and implementing a global, looping "light bulb hum" sound to create the unsettling Backrooms atmosphere.
Videos recently processed by our community