Who doesn't love action RPGs? From pioneers like Adventure for the Atari, to the golden era on the Super Nintendo system, to a budding indie scene that's alive and well today. Action RPGs are here to stay, and in this tutorial we'll look at how to create our own. Throughout this series I'll be using placeholder art, which is a common practice in the games industry, especially during the early stages of prototyping, where you're not sure what's going to stay in the game and what will be discarded.
This placeholder art can be easily swapped out with your own art as you develop it later on, so that with just a few clicks you can transition from placeholders to bringing your game to life with your own artwork. In this first video, we'll look at how to use Unity's tile map system to quickly build a world from scratch. Let's get started. The very first thing we're going to do is head over into our hierarchy, where you can right-click, go down to 2D object, and we're going to be creating a tile map, specifically a rectangular one. When you click on this, you'll notice that a grid arrives on your screen.
That's where we're going to be building our world. But first we're going to need to create some tiles to actually populate our world itself I'm going to change the name of this specific tile map I'm gonna call this one ground and we'll be creating multiple layers throughout this process now to get started You'll notice that at the moment I do not have a tile palette in some versions of unity It may create one automatically when you create your tile map But if it doesn't you simply need to go to window at the top of your screen Head on down to 2D and select Tile Palette. Your palette window will now appear and I like to grab the tab and dock mine down in the bottom corner of my screen. At the moment you don't have any palettes it will give you the option though to create a new one.
I'm just going to call mine RPG Palette. Hit create. It's going to ask you where to save yours. For now I'll just put mine in assets.
And at the moment we now have an empty palette. I'm going to create my first square that I'll put in the game and I'm actually going to head down to my assets folder for this. Right click, go up to create, and then under 2D sprites I'm going to create a square.
I'll just leave it named square. And quite simply what I want to do here is just drag this into my palette. Again, it'll ask you to save each new piece that you put in there. I'll just save it in assets as square.
And I now have a square. I could click on this and start drawing my map. However, I don't really want to have white ground at this point. And so what I'm actually going to do, click on my ground layer here on my grid, and I can change the color.
I'm going to find myself a nice green color. And use this to paint my ground. Once you've created an outline, you can use your paint bucket tool to fill it in. And in fact, I'm going to create a much larger map to start with.
And there we go, I now have a ground layer. One thing that I like to do just to make sure that I have colors that are working well together is to use an actual color palette here. You'll notice I've imported my own.
I'm just going to drag it up into my scene. And then I'm going to enlarge it so that I've got a nice large palette to work with. Move it over here.
And now I can use those as my colors while I'm working. So for example, if I click on ground, I can grab my dropper tool here and head on over to find the color of green that I particularly like. There we go.
Now that I've got my ground drawn in for my level, I can proceed to add some other layers. So for example, let's add in some water next. So I'll click on my grid, go to 2D object, tile map, rectangular, and I'll call this one water. Again, I'm going to be using the same tile palette, I'm just going to change colors for this one.
So I'll grab my dropper tool and head over here to grab a nice watercolor. I'll then grab my paintbrush and I can get a painting. And I'll begin with a river, add an ocean, and then just add a little more land.
You can then repeat this process for whatever else you want to put in here. Like I will make a new layer now for trees. Don't forget to set your order in layer to something higher than your ground layer so that your trees appear on top of the ground. At this point you're ready to just get painting, adding a layer for everything you'd like to add in your world like beaches, mountains, snow, that sort of thing. And slowly you can create the world that you'd like to have to explore.
Alright, there you have it. We now have something of a world that we can walk around in. In the next tutorial, we'll look at how to actually create a character who can walk around.
But in the meantime, let's just put a few obstacles into our tile map here. For example, I might want to make it so that you can't walk across water, mountains, or trees. Now to do this is actually relatively easy. You simply click on the layer that you would like to make unwalkable.
I'm going to click on water here. And then over in your inspector, we're simply going to add a component called a tilemap collider 2D. And when you put this on, it will actually automatically create colliders on everything you've made in that layer.
So in this case, all of my water now has a collider. I can repeat that process with trees, adding my tilemap collider onto my trees, do the same thing to my mountains, and also to my snowy mountains. Adding those colliders will make it so that there are impassable regions on your map so the player cannot just walk through all of the mountains and things.
Hope that tutorial was useful. If you found it particularly helpful, please be sure to click like or to subscribe to the channel.