HomeVideos

Godot 4.5 Tutorial: Modular Level Design with GridMaps (Backrooms Part 2)

Now Playing

Godot 4.5 Tutorial: Modular Level Design with GridMaps (Backrooms Part 2)

Transcript

563 segments

0:02

We have a character, but they are

0:04

trapped in a void. To make a true back

0:06

rooms game, we don't need just a room.

0:08

We need a labyrinth. So, today we're

0:11

going to learn how to paint 3D levels

0:13

using GDAU's grid maps and then how to

0:16

handle the one mesh per cell limit.

0:19

Welcome back to GDO dev checkpoint. In

0:21

the last video, we built our player.

0:23

Today, we're building the world. We're

0:25

going to use grid maps, but with a

0:27

twist. Since GDAU only allows one item

0:29

per grid cell, we're going to build our

0:32

world in layers, just like Photoshop

0:34

layers, but for 3D. First, we need our

0:37

pieces. We need a floor, a wall, and a

0:39

ceiling. But we need to make sure they

0:41

align perfectly. So, back in our project

0:44

here, we're going to make a new scene.

0:48

So, scene, new scene, be a 3D scene.

0:53

And we're going to rename our node 3D to

0:55

mesh pallet.

0:58

There we go.

1:01

And we need a child node. It's going to

1:04

be a mesh instance 3D.

1:08

Now rename this to floor.

1:11

And the mesh we're going to use with

1:14

floor selected and the mesh empty. We're

1:17

going to use a plane mesh.

1:21

We'll click on the resource here and

1:23

change the size from 2x two to four to

1:26

four 4x4.

1:29

Now to give this some collision, we're

1:31

going to do here is go up to this mesh

1:33

here in the top toolbar with the floor

1:36

selected. So mesh, create collision

1:39

shape. And we don't want to be a

1:41

sibling. We want to be a static body

1:44

child. We want to be a try mesh. And

1:47

then create. and it automatically

1:49

creates a static body 3D and a collision

1:52

shape 3D. That way our player will be

1:54

able to walk on it. Now, make sure we

1:57

keep this floor at 00 0 where it's

2:00

transformed

2:02

here. We want to move it. That'll make

2:05

more sense when we start placing the

2:06

tiles in our level. Now, we need the

2:09

wall. So, back in the mesh palette,

2:12

right click, add child node, another

2:15

mesh instance 3D. I'm going rename this

2:18

one to wall.

2:22

And for the wall, we're going to use in

2:23

the mesh in the inspector, we're use a

2:26

box mesh.

2:28

And click on the resource here. For the

2:30

size of this one, we're going to use

2:32

this 4x4

2:34

by 0.2.

2:37

There's a wall. We also want to move our

2:40

wall up so it sits on the floor. going

2:43

to scroll down to the transform here.

2:47

And we move our Y to two. Since it's

2:50

four and go half, we'll bring it up

2:53

straight to the floor.

2:56

For the walls, we don't want them in the

2:58

center of the floor. We want them on the

3:00

edges. So, for the other transform,

3:03

we're going to use Z2.

3:06

That's going to push our wall to the

3:08

edge of the floor.

3:10

All right. Now we need a ceiling though.

3:13

Oh no, wait. Before we do that, we need

3:15

a collision. Back on the mesh here with

3:18

the for the wall selected. Create

3:20

collision shape. Static body child. Try

3:23

mesh. Create. Now we have collision for

3:26

our wall. Now we need a ceiling. So

3:29

right click, add child node, mesh

3:32

instance 3D. This one is going to be

3:35

another plane. So in the mesh, plain

3:39

mesh, we're going to rename this one to

3:42

ceiling

3:45

ceiling. There we go. Now in the mesh

3:48

here, I'm going to change the size to

3:51

4x4

3:54

and scroll down to transform. You want

3:58

to bring this up to the top of the wall.

4:01

Our Y is going to be four.

4:04

And then we notice here we go down. we

4:07

can see right through it. We actually

4:09

need to flip this healing tile over so

4:12

when our player is in the room, they

4:14

look up, they don't see right through

4:16

it.

4:17

We do that by just going to our rotation

4:20

X and 180. There we go. Now our ceiling

4:27

is facing down to the player. Great. Now

4:30

we need to do the same thing and create

4:32

a mesh collider. With the ceiling

4:35

selected, mesh, create collision shape,

4:38

static body child, try mesh, create. Now

4:42

we have a collision on all three of our

4:43

tiles.

4:45

Now our tiles are made. Back rooms is

4:49

known for its yellow wallpaper

4:52

and yellow lights. Just the atmosphere.

4:56

And here's what we're going to use for

4:57

that. On openr.org

5:00

is a CCL, so you can use this for

5:02

whatever you like. is the back room's

5:04

materials. It's even got the pool,

5:07

something we can add into there. Also,

5:09

the yellow wallpaper and the office tile

5:13

ceilings. So, it's perfect.

5:16

Either download it from here or I also

5:20

have a tutorial assets folder that I

5:23

made that's going to have all the files

5:26

we reference in this tutorial. So you

5:29

can download it from here and just get

5:30

everything which has fonts and sounds

5:32

and stuff and also the PBR texture pack

5:35

or you can download them individually

5:37

and put them wherever you like. The

5:39

links will be in the description.

5:42

So once you have that downloaded from

5:43

whichever one you choose, we're going to

5:45

go ahead and right click on our file

5:47

system, create a new folder called

5:50

assets,

5:53

and then right click again on the asset,

5:55

create a new folder called textures.

6:00

I'm going to folder. Actually, I'm going

6:02

to rename, right click this, rename

6:04

textures to just materials.

6:07

Make it a little more

6:10

universal. All

6:12

right. Now, with the materials folder

6:14

selected, I'm going to drag in all the

6:17

assets,

6:19

select them, drag them in, and drop.

6:22

That'll import all the ones we need.

6:24

Now, I have the carpet and the ceiling

6:27

tiles and the wallpaper. Now, if you

6:30

download the pack completely from the

6:31

open game art, you'll have a lot more to

6:34

choose from. Now, I chose specifically

6:36

ceiling tiles, too. And you can choose

6:39

whichever one you like.

6:41

But if you want to follow along, these

6:42

are the ones I'm using. Now, you start

6:45

with the carpet or floor selected.

6:47

Scroll back up to surface material

6:50

override. Now, there is a material

6:53

section here in the resource mesh.

6:57

But I noticed that doesn't work very

6:59

well with how we're going to do the grid

7:01

maps. So, we're not going to put the

7:03

material in here. It works better if you

7:06

put it in the material override here.

7:08

So, we're going to do the carpet.

7:14

We're going to use the carpet color.

7:17

Drop it in here.

7:19

And then open up the resource here. Then

7:22

we need to go into the roughness.

7:25

We're going to add the carpet

7:28

material in there.

7:30

And then we're going to go into the

7:32

normal map. We're going to activate that

7:35

and drag the normal map here.

7:39

gives our carpet a lot of depth.

7:41

Now, here you can change settings and

7:43

make it more rough, less rough, right in

7:46

the middle.

7:49

Also, if you want it less brown, you

7:51

could actually use this carpet normal

7:54

and then drop this into the texture.

7:58

Oh, not the texture, the actual material

8:02

drop here. This makes it super yellow.

8:05

You can actually turn that down in the

8:08

albido

8:10

and darken it

8:12

quite a bit. Depends what you're going

8:14

for. A lot of people have the yellowish

8:17

carpet in the background stuff. But for

8:20

now, we're just going to keep it at a

8:21

default. I'll control Z all that.

8:26

Oops.

8:27

That didn't do the other thing. Put my

8:30

carpet color back there.

8:33

Our texture is all back to normal. We'll

8:37

keep it like this. Make this zeroed

8:39

again. And then we want to do the wall.

8:43

Have the wall selected.

8:46

And the surface material override.

8:49

Go into my wallpaper.

8:51

Wallpaper color

8:54

here.

8:56

Then go into my roughness.

8:59

Wallpaper rough

9:02

normal map

9:05

normal map. Perfect.

9:07

Then we're going to go into the ceiling.

9:10

Select the ceiling surface material

9:12

override

9:14

and then our ceiling tiles

9:17

the main texture.

9:19

Then into our roughness

9:22

and then our normal map.

9:26

There you go. You can also bl the colors

9:28

there if you like, but we'll keep it as

9:30

default for now. You might notice how

9:34

big our wallpaper looks. That's

9:38

stretched out. If you compare it to what

9:40

it's supposed to look like, super small.

9:44

Well, why? Well, it's because GDAU

9:45

stretches one image across the whole

9:47

wall. So, we want to actually separate

9:49

this into a bunch of smaller images. So,

9:51

if that's our 4x4,

9:54

is making it one by one. They call that

9:56

a UV mapping issue.

10:00

And to fix this, we need to activate

10:01

thing called triplaner mapping.

10:05

So with our wall selected here, we need

10:08

to go to the UV1

10:12

which is in the surface material

10:14

override and click that and expand it.

10:18

Scroll down to UV1.

10:20

Then we have this thing called trip

10:22

planer and select that to on.

10:25

automatically you'll see how smaller it

10:27

gets. But we have it too small. So our

10:30

offset scale here. Actually what we're

10:33

going to use is 0.5

10:36

across the whole thing.

10:39

And that is about the same look as we

10:41

have here.

10:44

Perfect.

10:45

That's what we're going for. Now the

10:47

charter can sometimes have performance

10:50

costs or weird artifacting on the

10:52

corners. So if you notice you have that,

10:56

you can actually deactivate this and

10:58

then

11:00

just set this

11:02

scale to four, which is the size of our

11:07

our box mesh here. It'll kind of do the

11:10

same thing, but the track planer works a

11:13

little better like a set it and forget

11:15

it kind of solution because they have to

11:18

manually adjust

11:20

corners and those kind of thing for the

11:22

grid map walls. So, we're going back to

11:25

0.5

11:27

then turn our trier back on. Perfect.

11:30

So, either way decide the word works for

11:33

you, that's what I'm going to do. All

11:35

right. Last but not least, now that we

11:38

have all of our tiles, at least the ones

11:40

we're using so far,

11:43

we need to actually get these into the

11:45

world so we can use them. And to do

11:48

that, well, we grid maps aren't going to

11:51

use a tscn file, which is the scene

11:53

file. We need to use something called a

11:55

TR file. So, it's a basically a

11:58

resource. So, the way we do that is we

12:01

go into our scene

12:03

uh tab here. We need to go to export as

12:07

and we're going to export it as a mesh

12:10

library.

12:12

And from our root folder here, we're not

12:14

going to put in any of these folders.

12:16

We're going to make our new folder call

12:18

it resources.

12:20

And what we're going to call this is

12:22

mesh

12:25

pallet

12:29

there. We're going to tr.

12:32

So the TRE file that's what we're going

12:35

for. Then we have merge with existing

12:38

which is good. Gives me have to reexport

12:42

which we will later. We want also want

12:44

to apply mesh instance transforms. We

12:48

don't do this everything will be set at

12:50

0000 including our ceiling and our wall.

12:53

We don't want that. Now apply the mesh

12:55

instance transforms. Save.

12:59

And that's it. We go into our file

13:01

system and our resources. Now we have

13:04

our mesh pallet resource and we have

13:06

access to three of these tiles

13:08

individually.

13:10

Now there's a little bit of secret sauce

13:11

to this one. Now if we try to put a wall

13:13

on a floor in the same spot with the

13:16

single grid map, GDAU will delete one.

13:19

So we need to create separate grid maps

13:21

which is where the layering comes in.

13:24

So, back in our world, seen here, we're

13:28

going to right click the world root node

13:31

and add a child node called node 3D.

13:36

That's the standard one.

13:38

Then, double click that. And we're going

13:40

to rename this node 3D to level.

13:44

Now, in this level, I'm going to right

13:45

click, add child node. We're going to

13:47

call something called a grid map. That's

13:50

right here. and create that, I'm gonna

13:53

rename this one to grid map

13:58

Laura.

14:01

Then with this grid map selected, you'll

14:03

see over here in our mesh library, now

14:06

that's what we're going to use with our

14:08

mesh pallet because that's going to be

14:09

the library we want to use. So in our

14:11

resources folder, click and drag and

14:14

drop this into our mesh library. Now

14:17

you'll see we have our ceiling, our

14:18

floor, and the wall we made. We also

14:21

want to go to our cell size here and

14:24

we're going to change it to the cell

14:26

size we chose which is four by 4x4.

14:31

Now we want two more maps over right

14:36

click and we can duplicate. This one's

14:39

going to be called

14:41

the wall. We duplicate again. You hold

14:45

down control D and it duplicates. Now we

14:48

want one called the ceiling.

14:54

And now since we're going to make

14:55

something new, we do not need our ESG

14:59

box we used for testing. We actually

15:01

delete this and get rid of that.

15:06

And now we can paint our level without

15:08

any conflicts. We're going to start with

15:10

the floor. Then we'll carve out a maze

15:12

with walls. And then we can cap it off

15:14

with the ceilings.

15:16

All right. Now we can make this spectre

15:18

a little smaller. We do our floor here

15:23

and make some more room. So you got a

15:26

nice grid pattern here. What we want to

15:28

do is get the floor section here and we

15:32

want to click.

15:34

We want to make sure we're in our paint

15:37

section here.

15:39

You see how we're off center of our grid

15:41

map is we are not centered. We don't

15:45

want to be centered on Y. Going to turn

15:47

this off. Since we have our setup

15:50

already 4x4, we turn this center Y off.

15:54

Now, our

15:56

floor fits perfectly in our nice 4x4

15:59

cells. So, we start by doing a like a

16:03

10x10.

16:04

So, we'll do a 10x10 room here.

16:14

I guess that's a 12 x 12. That works.

16:17

And now we have our floor. You notice if

16:20

I try to put a wall anywhere here. Going

16:23

to delete

16:24

the cell that it's on. Anything else you

16:27

only have one item per cell. Z. Now do

16:31

it's why we did the three and click our

16:33

wall section. Now we can put walls up.

16:39

And then our we're off center here. So

16:41

our mesh grid map here. Nope, not that.

16:45

Sorry. Use our cell section here and our

16:49

center Y and turn that off. So we can

16:53

actually be on the line that we set in

16:55

our mesh library. We can create a walls

16:58

all the way around.

17:07

Then you can rotate with S.

17:12

S again. Sometimes you got to do it

17:15

twice.

17:21

Rotate all the way around. There we go.

17:24

We have to have the wall away facing

17:27

the opposite way of this wall or else it

17:30

won't work.

17:35

You do S. There we go.

17:39

Let's surround our whole area here.

17:50

Now we're boxed in. Perfect.

17:54

Then we can create a little bit of a

17:55

maze here.

17:57

Do this.

17:59

Maybe we'll do all this.

18:22

And for this you can kind of do whatever

18:24

you want.

18:30

That works for now.

18:33

I'm actually make another floor spot

18:35

here. Do like a little entryway

18:39

about in the corner right over here.

18:43

And I want to put some walls here.

18:46

Surround this with walls.

18:52

There we go.

18:55

Right. Now we need the ceilings. The

18:57

ceilings. I found it easier to the world

19:00

environment. Select that. And change our

19:02

color just to white. We can see better.

19:07

We go back to our ceiling. Our ceiling

19:10

tile. zoom in here

19:13

and we want to once again in our cell

19:16

section here center on the Y.

19:20

That way you see your tiles.

19:24

And then if you hover over the floor

19:27

where you want the ceiling to be above,

19:30

that's how you're going to see it. You

19:31

click there. Now we have our ceiling

19:33

there.

19:35

Then you just keep doing that

19:37

there and there.

19:40

Now you go through your maze.

19:55

All right. Now we have our whole maze

19:59

covered.

20:01

It's like this. I think I got it all.

20:05

Remember, we can't see it from the top,

20:06

so it's hard to see that way. I think

20:10

we're good.

20:12

It works. We have a solid room. Now,

20:14

let's apply some maddening buzz and then

20:16

some lights.

20:18

First, let's turn the lights back out

20:21

our world environment. We can

20:25

background make it black again.

20:28

Now, the backgrounds are scary because

20:30

they're dark. They're scary because they

20:33

are too bright. Need that uniform yellow

20:36

light.

20:37

Right click on our level node, add child

20:39

node. Node 3D

20:43

and call this lights.

20:47

Then I'm right click lights. Add an omni

20:49

light 3D. This omni light in the

20:53

inspector the light.

20:56

Change the color of the light to

20:59

a yellow. The one I liked was FF

21:05

EB0.

21:09

Nice cool yellow.

21:11

Bring it up to the ceiling.

21:16

We are going to need a bunch more of

21:17

these. So

21:20

click on that. Hold control and then D.

21:22

You can duplicate.

21:25

Then you can just place them around your

21:26

level.

21:44

All right, now we have the lights

21:47

everywhere. We also want to be able to

21:49

hear that maddening buzz from those

21:52

fluorescent bulbs.

21:55

Do one more thing here with the world

21:57

environment. We're going to do is set

22:00

the

22:02

inspector in the environment tab here,

22:05

our tone map. Let's set this mode to

22:08

AGX.

22:10

Gives a more realistic appearance. Then

22:13

we're also going to set the exposure

22:16

1.5.

22:19

Brighten it up a bit.

22:21

Then get these corner shadows that are

22:23

less obvious and turn SSAO on.

22:30

Now let's add some blending in our

22:32

corner our corners.

22:35

While over there, check the lights. Make

22:37

sure our We're going to turn these

22:39

shadows on. So, go to the top light.

22:43

Select all the way down to the bottom

22:45

one. Let's turn these shadows on.

22:50

And then we want to make sure the

22:52

attenuation is 1.5.

22:57

There we go. We're going to turn the

23:00

range up to 10.

23:04

Yeah, that's good. Now the shadows

23:06

aren't too dark. Let's see how that

23:08

looks when you run the game here. Run

23:11

current scene.

23:15

Yeah,

23:17

doesn't look too bad.

23:20

Now we need to add that buzz. Let's exit

23:23

this. Make the sound in here in our file

23:27

system asset folder.

23:30

Let's add a

23:33

right click, new folder, not a scene.

23:36

Right click, new folder. Call this one

23:40

audio.

23:43

Now, once again, you can get these

23:44

assets. I'm going to use the sound one

23:47

included in the Google Drive link I have

23:50

in the description, or you can use the

23:53

resound here

23:56

where I got it from the CCO. You can see

23:59

you can use it for anything you like.

24:01

Either way you get it. Once you do,

24:04

I'm going to open that folder up. And

24:06

with audio selected, I'm going to drag

24:08

in the light bulb buzz sound,

24:12

which I named light bulb hum.

24:15

And then back up in our

24:19

hierarchy here, right click on the world

24:21

node. I'm going to use a audio stream

24:27

player right here. Now, why not a audio

24:31

stream player 3D? Well, 3D player sound

24:34

from a specific point. You'd only use

24:37

that if you wanted the buzz to get

24:39

louder as you walked closer to a

24:41

specific light bulb. But since the

24:43

background is an infinite mono yellow

24:45

hellscape, the global 2D sound feels

24:48

more claustrophobic and consistent. So,

24:51

we'll select the audio stream player and

24:54

with that selected in our stream over

24:57

here, we're going to drag our light

24:58

bulbs out into it.

25:00

Going to make sure we click auto play to

25:03

be on. And then in the parameters, we

25:05

want looping to be on as well.

25:10

We'll see how loud that loud that is

25:12

here. Go and select the run current

25:14

scene.

25:18

There you go.

25:21

Yeah, nice creepy buzz. It's bound to

25:24

drive anybody crazy. Now, that volume's

25:26

too loud on yours. What you can do is

25:29

you just turn down the decibels here.

25:31

So, you want to go minus 10 and then try

25:35

again.

25:38

If that sounds better to you, you can go

25:40

and do that. Adjust it as you see fit.

25:44

All right. And go and close that.

25:47

Now we're starting to look a bit more

25:48

unsettling. We have the maze and the

25:50

player trapped inside it. And by

25:52

separating grid maps, we have total

25:54

control. We can turn off the roof to

25:56

work or swap out the floor style without

25:57

breaking the walls. Now, if you're

25:59

following along, take a screenshot your

26:01

maze and tag me on Blue Sky. I want to

26:03

see your level layouts. This still looks

26:06

a bit too clean. Looks like a video

26:07

game. So, the next video we're going to

26:09

make a little more world environment

26:11

effects, maybe some fog glow, and also

26:15

most importantly, that VHS

26:17

post-processing shader to make it look

26:19

like real found footage. A special thank

26:22

you to our new coffee supporter, ZZZ.

26:25

You helped make this possible. And if

26:28

you found this helpful at all or fun,

26:30

leave a comment on what your GDAU

26:31

gamedev goals are. Please like and

26:34

subscribe. Hit that notification bell.

26:35

It really helps out the channel. And

26:37

thank you to all our other current and

26:39

past Patreon and coffee members. Your

26:41

generous support keeps the channel

26:42

moving. And if you want early access to

26:45

tutorials, source code, or suggesting

26:47

future tutorials, please consider

26:48

becoming a member yourself. The links

26:50

are in the description. I'm Spaghetti

26:53

Syntax. Stay curious. I'll see you at

26:56

the next checkpoint.

Interactive Summary

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.

Suggested questions

5 ready-made prompts