How to Make an RPG in GameMaker Studio 2! (Part 3: Tiles and Simple Camera)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] let's make another new sprite down here and we can call this sprite house tiles so i'm going to open this up and i'm going to turn our grid on which will show us a 16 by 16 grid the way tile sets work is that they pull from a sprite and they will pull it in blocks so each one of these things will be a different tile that we will be able to pick up in place in our room tile sets always start with their first tile blank so we can just go ahead and discard this one in fact a lot of times i like to just put a red block there or something like that just just so i know not to that this is uncharted territory i don't belong here this is going to end up being a very tiny tile set i'm going to end up importing another one that i worked on before i'll show you that one but right now i'm just gonna walk you through making one yourself the kind of ideas you might wanna put into it so first let's say the background color that we wanna do is maybe not a maybe not a black but maybe like a very a very dark color let's do like a kind of darkish purple we'll put this here to have that now we want to make a tile where we can make we'll say this is the walls and let's do a color let's do this nice pink this will be very similar to the one that i import and i'll show you that one so you can copy it if you want to [Music] so that's a really basic tile set let's uh get out of here now we actually need to create the tile set asset this is currently just a sprite and so to make the tile set we can exit out of here we can go over to our tile sets folder right click create an asset go down to tile set surprise surprise so here we can select our sprite go into sprite folder select this right here everything here should be set up perfectly fine you can change a lot of the properties of it like how wide and tall you want the actual tiles to be but everything should be perfect for us right now so we can actually exit out of this oh actually let's name it we'll name this ts house tiles or just ts house whatever you want to call it doesn't matter so we can go back into our room and over here the only two layers we have is an instance layer for our objects and we have a background layer which is just this black box here so let's go to the bottom of this box here and we can add a new tile layer and now we have a tile layer it's under the instance layer currently which is what we want you can move tile layers around you can move all layers around like this but we're going to keep it under the instances because we don't want it to show up on top of the player so we click on our tile layer go down here to the tile layer properties select the tile set we want to use and now we can place stuff around so i'm going to start with our our dark color our wall color so i'm just going to use this square tool fill it up i could have used a little paint can but i didn't um sue me let's go to the pen so i can select one at a time and actually you know what before we do that let's go back to our instance layer and we can just go ahead and get rid of these walls so i'm just holding uh shift and dragging to select multiple things at once and then just the delete key so back to our tile layer i can now add tiles where i want i can draw them in so let's make this like a uh let's make a little room here very tiny room and we'll have a little path that goes into [Music] another little tiny room we can use these to outline this to make it look a little bit nicer so now you see kind of what the point of a how tile sets work you probably knew that already but i said it anyways okay so this looks a little nicer it's still pretty plain but whatever we can go back to our actually we need to add some walls back in but before we do that we can go back to our workspace and open up our wall object so right now it is checked as visible which means when the game runs it will actually show up if we uncheck this then our walls will not actually show up whenever we run the game which is what we want now that we have a tile set that shows us where the walls are and stuff we don't necessarily want these big blue walls to just show up on their own so let's do this let's actually add another instance layer and we will call this walls the benefit of having this on a separate layer is that whenever we are done placing our walls we can turn the layer invisible ourselves anyways just so it's not mucking up the view so let's go back to our assets up here grab our object wall i'm gonna turn this grid back on so that way our walls are snapping properly and i'm just going to outline this room with our walls okay so i placed all my walls here and now i can just turn this layer invisible so it's not bothering me they're still gonna be there it's just not visible to me in the editor and they won't be visible when you run the game another little thing you can do that would actually probably be really helpful is what i always do in our walls even if we can hide them like this it's still kind of weird having them to be completely opaque and cover up the screen like this so we can go back into our wall sprite and we can turn down the opacity we can make it see-through you could either pick a color and then go into that color and turn the alpha down which is the same as the opacity or we could go to the layer that it's on and change the opacity here and i'm going to change it to about maybe like half or a little bit less it doesn't matter as long as it's a little see-through that helps so you see this way if i'm putting a wall somewhere [Music] if i'm putting a wall anywhere in the room you can see you can still see through which is which is very helpful so let's hide this layer again and run the game and see how everything's doing okay so looking good looking good okay but uh this is still a little bit boring just because it's such a small little area here and the camera doesn't move because the room is too tiny so let's make the camera follow the player so that way we can make a little bit bigger room let's exit out of here we can go ahead and make our room a little bit bigger so we'll go back to the room properties which i minimized down here so bring that back up you can resize any of these windows by clicking between them and now let's change the width to let's just say like 500 by 400 so now we have all this space to work with i can close those room settings i might want to make a new little tile path here so back into our viewports and cameras go back to our viewport zero that we set everything up in the beginning and in the beginning you probably noticed this object following so we can select any object here for the camera to follow and obviously we want to select our player horizontal border and vertical border basically mean how far does the object that the camera is following how far does that have to be from the edge of the camera to move it so 32 and 32 would basically mean that the camera only starts following the player once the player is about this far away from the camera and then it will come with it we don't want that we want to just stay centered on the player so really we could just make that half of our camera view 144 and 108. [Music] now you could also you could just set these to like a thousand or something and it would it would be the same thing so horizontal and vertical speed just keeping them at negative one means that it's just going to be following the player as fast as the player is going so we're good let's close out of that and before i forget let's open up our walls again and i'm going to get this wall out of the way because i actually want to actually want to move down here okay all done so hide this again and run the game one more time all right moment of truth hey look at that the camera's falling and everything when we get to the edge of the room the camera doesn't go any farther than the room is so perfect all right okay so this is the tile set that i'm going to be using from now on uh if you want to pause and copy it or whatever you totally can if you're wondering why i didn't just link a folder that has the assets in it for you to download uh i was too lazy but really more than anything just it's good practice to just imitate stuff that you see just copy it you can change it however you want you can change colors it doesn't even have to be like this this is actually a pretty inefficient tile set you see all these these spaces that i've left it's because i i made it really fast and i didn't plan it out very well but regardless if you want to use it you totally can well before i forget to mention in tile sets once you have started using them it game maker counts it as like tile 0 1 2 3 4 5 6 7 8 9 10 11 so basically what happens is if you resize a tile set sprite after it's already in use then what's going to happen is that order is going to get all out of whack and your tiles are just going to show up in the totally totally wrong places you can always make your sprite taller but you can never make it wider so just keep that in mind okay so i've kind of gone back and used my new tile set and you can kind of see what i did here which is like the darkest color is sort of just the outside of the rooms and then there's the lighter dark color which is kind of like the walls a little bit and then the pink which is the floor and now i'm just going to add a couple more things just to make it look a little bit more a little bit more lively so i got like a staircase type thing over here so here's the left side of the staircase we pull that down and the right side now we got a little bit of elevation going on we can add our door here for a room and then maybe a little uh a like little carpet thing in the middle of this got a picture frame put a couple of those on the wall look at that look how much stuff you can do with just just tiles and how cool it looks and then once you just put your walls back around then you have something pretty good looking now what we're going to do is we're going to make some other objects like maybe a dresser maybe a coat rack something like that that you can place in your level and then your player can walk in front and behind it and it adds a bunch of [Music] [Applause] depth you
Info
Channel: Peyton Burnham
Views: 11,885
Rating: undefined out of 5
Keywords: gamemaker, yoyogames, rpg, how to make, how to make an rpg, gamemaker studio, gamemaker studio 2, gms, gms2, tutorial, beginner, beginner tutorial, undertale, omori, top down, pixel art, indie game, how to make a game, rose of starcross, earthbound, platformer, rpgmaker, rpg maker, pixel, from scratch, deltarune, delta rune, easy, coding, code, programming, cute, animation, player movement, collision, parallax, player, depth, tiles, tileset, tilesets, camera, room transitions, warp, rpg tutorial, nintendo
Id: oBo9YK5nWiI
Channel Id: undefined
Length: 12min 2sec (722 seconds)
Published: Thu Mar 25 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.