How to Create and Use Room Layers | GameMaker

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
layers are the magic that make rooms work in game maker I'm going to show you how to create and add new layers to your rooms then we're going to do a deeper dive into the properties of each of those layers and what assets they can hold and finally we'll talk about the most common errors that you'll run into when you start using multiple layers in your games let's get started so every room that you create or open is going to have two layers by default the background and the instances layer the background layer holds a solid color or a Sprite and the instances layer holds your objects now to make more of these layers these buttons right down here are what you're looking for the bottom left one is a new background layer you can also press Ctrl B to create that and it makes a new layer on top of the one that we had selected so because I had instances highlighted when I clicked new background layer it put it on top of that next we have new instances layer after that comes tile layers then we have path layers and asset layers and finally filter and effects layers to help organize all that the next button here is creating a new folder so we can click on that and then we can drag these layers into this folder and minimize it and that will allow us to then get organized and stay structured you can right click on any of these and rename and then you can actually put folders inside of folders as well if you have a folder selected and you click on add folder or create a new layer it gets put inside of that folder so you can have nested folders just like in the asset browser the last button over here is the delete selected layers so if we wanted to delete everything we have here we can click on that each time or we can actually highlight multiple ones press the delete key and it does the same thing so stick around we're going to do a deeper dive into each of the layers we just talked about so we're back in a room with just two layers let's go ahead and start with the background layer this is what you can see in the background of your game you can come down here to color and you can choose any color you want which is fine but it's kind of boring it gets a lot more interesting when we use a Sprite this button right here lets us choose a Sprite for the background I'm going to choose a background put out by game game maker in one of their bundles and this is a volcano this is really cool and this is when you can start using the rest of the options down here in the properties tab so we can horizontally and vertically tile the Sprite and we can stretch it now stretching actually makes it larger but it can also make it smaller to fit properly as you can see right here this full volcano Sprite doesn't actually fit in our room so if I click stretch it now fits properly so it can go both ways I'm going to uncheck that right now then we can horizontally tile this now you can't see this until you come down to the speed and if I set this to a speed of 1 and I click play it's going to then move this background at a speed of one pixel per frame to the right if I take off horizontal tile you'll immediately see that the background itself is moving out of the way and only with horizontal tile does it look continuous as one big background and the same thing is true for vertically tiling so I'm going to go and set the speed to zero here now you can set an offset here so if I turn off horizontal tile and I put an offset of 500 it just moves the background because you can have lots of backgrounds in here you might want to set an offset for each individual one so I'll set that back to zero if it's an animated Sprite you can have it play and you can set the animation speed right here and change the time units and you can also set a custom depth and underneath that is the effect type you can apply an effect to every individual layer in your game so if we wanted to give this one something like a heat Haze this whole thing now looks really cool like it's alive and this can be applied to every single layer you put in your game I'm going to go ahead and take it off right now so it's not too distracting next up is the instances layer here is where your objects live so I'm going to drag obj player inside and now we have our obj player in our instances layer and she's animating because this play button was clicked and now she's still playing so down in the properties we can see every instance in it and we can also set a custom depth and apply an effect here so if I apply an effect on this one like changing the color tint it only affects the instances layer it doesn't affect anything else then I'm going to go and take that off and then come the tile layers so if we add a tile layer we need to use a tile set to be able to do anything with it and over here on the right next to assets a new tab has appeared the room editor and with it we can select a tile set I've got another one here from game maker another volcano themed one I can now choose one of these and place it inside you can change the size of that to make them larger you also have custom brushes and libraries these ones already have Auto tiling enabled so if I come in here I can now click here and it will automatically set these to be exactly what they should be based on their position in the room pretty cool then we have the path layer so the path layer is for visualizing the paths that you have in your game so you have to have one so I'm going to go over here and I'm going to choose one that I've already got and you can see here that this path comes into the room and being able to see the path in the room is actually really helpful because now I can come in here and I can actually move these around and put them right where they should be whereas before I didn't quite know the size of the level the things that were in it so putting an overlay in here can be really really great and down here in the properties you have all the options you do in the path editor such as making it straight or curvy making it closed setting the Precision and setting a custom depth the effect here doesn't do anything besides changing it visually in the room editor it won't change anything of how the path actually runs in your game then we have the asset layer the asset layer is for Sprites and sequences so we could come over to our assets and I could grab spr for the player that I've got here and I could put her in and you can see that she's animated and working just as you would expect with an animated Sprite Which is pretty cool the real power comes in when you use a sequence because sequences can actually create instances play sound effects and do so much awesome stuff and they live in the asset layer lastly we have the filter and effect layer this is a layer wide effect or filter so if we were to come up here to the effect type and we were to choose color tint and we come over here to Green we can now see that every single layer is being affected by this and if we grab the effect layer and we move it down we can isolate certain layers to not be affected this is really great when you want to have multiple effects in your room on specific layers you can put them here and you can have them affect just one layer or multiple layers at a time with that and that's our Deep dive for layers up next we're going to take a look at the most common mistakes that you'll run into when you're using lots of layers like this now the most common mistake I see is getting your depth out of order so if we were to drag this background layer to the top it would make everything else vanish that means the background layer is now now in front of everything else they're still there you can see that this asset layer still has the Sprite and this instance layer still has the object but because this is on top this is what we see we can drag it back down and put it where it's supposed to be now you can also do custom depths and that can cause some confusion so if you're using custom depths just make sure that you know what the property should be and that you still have them lined up accordingly for where they're supposed to be at the next common mistake I see is using this lock icon and this eyeball when you don't mean to so you can lock a layer down which means you cannot edit its properties anymore so if you come into this background layer and I try to click on anything you can't it kind of feels like a bug but it isn't we've got this locked down and you can actually lock down every single layer in your game with this top lock icon and then we have this eye icon which can make your layers disappear both in the room editor and in the game the one thing to note here is if you make an instance layer disappear the instances are still being spawned and their code will run you can make every layer Disappear by clicking up here and you can bring them back just the same way and once you start adding in a bunch of layers and you want to be able to click on one of them it can actually be really hard to do so if I wanted to click on the Sprite or this path I can't click on it unless I click on that layer first and then I can select its properties to fix that you can actually come up here and click on this icon and then you can select from any layer you can also hold down P at any time to enable the same functionality so then you can click on any asset from any layer which is pretty handy and lastly what I see is people trying to add assets in when they don't have their layer selected if you try and do that like I've got the path layer selected right now and I'm trying to add my obj player it asks me if I want to make a new layer you can make a new one and sometimes that's fine but also sometimes it's not because if you think you're dragging in your object when it's actually a Sprite and you click create and now you've got a Sprite in your room where you think it's an object then it's not actually going to do anything because Sprites can't run any code and that's all the mistakes that I can think of did I miss anything have you run into anything that you really feel that others need to know about leave a comment below I would love this to be a fantastic resource for all of the mistakes and errors that people can have when using layers in their rooms if you enjoyed this leave a like if you want to see more content from me check out the links in the description down below and as always keep making keep learning and I'll talk to you later [Music]
Info
Channel: GameMaker
Views: 9,268
Rating: undefined out of 5
Keywords: How to Create and Use Room Layers, how to create and uise room layers, gamemaker tutorial, Games, YoYo Games, GameMaker, Game Maker Studio, GameMaker Studio, gamemaker studio 2 beginner tutorial, game, maker, GameMaker Studio 2, IndieDev, GameDev, Indie, How To Use Room Effects FX, How to create adn use room layers, How To make A Moving Background, How to Apply Layer FX, How to Add Asset Layers, What Are Path Layers, Tile Layer, Instances Layer
Id: QFaa-NXPdXI
Channel Id: undefined
Length: 11min 14sec (674 seconds)
Published: Wed Jan 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.