Hello and welcome.
In this lecture we're talking about tall map.
We're going to be setting up a palette and then creating just a really simple, basic platformer for
our game.
So let's get started.
Let's start with a little bit of terminology about the tall map pipeline.
We've already chopped up our sprite sheet to create individual sprites that we can use to turn into
tile assets, which we'll be doing in a moment.
Those tile assets, we can add to a tile palette which is kind of like an artist palette, you know,
the blue that allows you to paint here and the red that allows you paint there.
This is our tile map palette.
And then we're going to add those onto a tile map that will allow us to create our scene with platforms
and background and all that good stuff.
We'll be going through this flow, which is also our challenge for this lecture, creating a simple
platform.
And first of all, we need to create a platforms tile map.
What I mean by platforms is the things that the player runs around and jumps on the actual platforms.
And then we need to be creating a tile palette to paint onto the tile map.
We need to format our tile palette, rearrange things a little bit if we need to, particularly to flip
the things that we've only got, say, a left side of in our assets.
We need a right side as well.
And then we'll paint just a very simple platform, a layout.
So in Unity, let's right click in our hierarchy and create ourselves a 2D object.
This will be tile map and rectangular.
Rectangular gives us all these lovely grids.
This is our tile map.
So basically it's saying in all these particular grids, you can put a thing in here, you can put a
piece of information.
And from tile map, I'm going to rename that to B, let's see, platforms, tile map.
Just so we know it's for the platforms.
Later on we're doing background, we might be doing pickups, etc. and instead of Grid, I'm going to
rename this to be called Tile Map Grid.
Just so it's really clear in the future, I'm not saying what is grid.
I'm like, oh, sorry, tile map easy now.
Next step over in the assets folder.
We want to right click create a folder which I will call tiles.
That's where we'll be saving all these tile related things that need to be assets, but we don't need
to be playing around with them.
So I don't want them to get into way in the way of my sprites.
So in the Sprite folder and also we're going to click on window and bring in from 2D the tile palette.
I'm going to dock my tile palette just to the left next to my scene, give myself a little bit of space
here.
So I've got the palette on the left and the scene on the right.
I think we're ready to go.
So next step is we want to create a new palette.
So click on Create New Palette.
I'll call this Platforms Palette and then click on Create.
Where do we want to save that?
Well, I'm going to find assets and then tiles the folder we just created a moment ago.
Select that folder that'll be saved if we click in tiles.
You see that as a platform palette prefab.
So this is a prefab that we're using as our palette.
Our palette is the arrangement of our sprites, of our tiles that we can then go and scatter it around
our world as our heart desires.
So clicking back on sprites, I'm going to find my rock, grass, water.
So in other words, your platforms, sprite sheet and open that up and click on the first of those highlight.
So scroll all the way down shift click to highlight all of these.
So all of these different elements of the sprite sheet, I'm going to drag that over into my tile palette
and bump it will ask us why we want to save that once again, assets, tiles and that folder.
Yes, select folder.
It'll convert them into assets which I'll just pop over to the tiles directory.
You can see all these little assets now these are individual tile palette assets asset and we have in
our tile palette our particular tiles.
Now let's do a little bit of painting over in our window over here.
You can see if I click on say the top left and place that down, we get a top left tile.
If I click on a tile next to that and place it down, I get the next one and next one and so on.
If I want the green ones, maybe on all of these I can click and drag across all these and place all
of the green ones down and place some place, some place.
However, I want to do it so you could highlight all of these and plop them down to your heart's content.
Not that you would do that because it looks a bit odd, but I just want to show you that if you do that,
it will overwrite exactly those particular squares.
So this is not going on top.
On top, on top.
It's just saying in that particular square, if I click on this left hand green thingy and I'll say
this square, that is what is in that particular square on our particular tile map in this particular
occasion.
Lots of particulars in there.
Now, we can also in here use the erase so you can see up top right second from the right there is the
erase brush.
Click on that and I can erase certain things in there very handy.
I can also move by clicking on the Move tool and then click on Move.
This is a little bit trickier, right?
You'd think I'll click on Move and then grab and move.
You have to do it the other way around.
Thank you, Tom, that you click on the selection and then you select a particular thing and then you
click on Move and now we can move that particular thing where we want to.
So that's a little bit clunky in my opinion, but that is how we click and select and move things.
Now if you have a look, we've got our top left and our tile palette that's come from our sprite sheet.
If I go and pop that in the world and then grab the next to put.
That.
Put that, put that, like, cool.
Now I want to round this off and have the right hand side, but we don't have the right hand side in
here.
So what I could do a couple of ways I could click on this top left, pop that in the world and then
click on my selection tool, top left in the tile palette.
Click back on the tile in my scene.
Now we get all of the information in the inspector about that tile, what's it called and where is it?
And I can in the scale I can select that and turn that to minus one.
So that's a way of flipping this particular tile on the x axis.
However, you don't really want to do that for this tile and that tile and that tile in your world,
you want to have this particular tile you can place anywhere.
And we don't have it in our asset pack because the artist is saying, Well, I don't need to create
this a bazillion times.
You've got that one asset there.
It's exactly the same.
You just flip it.
I'll only put one on there, so it'll save space on the sprite sheet.
But it means we need to do something to create that at the tile palette level.
And I just remembered something that I've taken care of because we've gone through this process.
But you might be importing stuff that is from a different asset pack or is from the original asset pack.
If you click on the Sprite, go to the original sprite sheet on the rocks here, we've got to change
the pixels per unit to 32.
So that means that this particular thing on the sprite sheet, this thing here we've already created
is a 32 by 32.
That's the size that it literally is from our sprite sheet, 32 by 32.
And that means that when we place it down in the world, it's the right size.
If I just click on my Sprite sheet and change this to say 64 now and hit apply now, all of my tiles
are going to appear to small.
And usually when you bring things into unity, it starts off at 100 pixels per unit clicking apply.
So everything is way too small.
So we've had to make ours 32 because that's the actual size in pixels they are.
But if you are working on something, say the original asset pack that I took this from is 16 pixels.
So if you use the original, you need to set this to 16.
I increase the size of these to get a bit more fidelity.
I made them 32 by 32 when I did my modifications to them.
A quick message from Rick from the future here.
If you find that you've got a white line that's appearing between your tiles, when you paste them into
the world, then sometimes that's fixed by changing pixels per unit to 31, which makes the tiles just
a tiny bit bigger, and they snap together more nicely and you don't get that issue.
So something to play around with.
You might want to put pixels per unit to 31 later on.
Many videos down the track, I'll be doing that myself to fix the problem I see on my screen.
But you might want to just know about that now and be doing that from this point on.
Let's come back to what we were doing, which was flipping our assets.
That was a random Rick Segway.
Now I'm going to show you the quicker way to flip things so that you flip them once and you can paint
them a gazillion times.
I want to make a little bit of space.
I want to rearrange my tile palette here.
So I'm going to let's see, show you how to edit in the tile palette.
Let's do that.
If I highlight these three, say four, I want to move them all over to here.
How do we do that?
Well, first of all, we click the edit button, so select them first, click on edit.
Now we click the Move tool.
Now I can drag that selection over to here.
To start rearranging, I'm going to click back on the selector tool, grab these top to click on the
move tool, drag them over, select the tool.
These bottom two just there that I know are the bottom elements.
Click on the move tool, drag them on over as well.
Now that's great.
I want to do the right hand side.
So we've got click on the selector.
We've got this left, top left just here.
I could paint that and flip it, then paint that and flip it, paint that and flip it.
But I'm going to select all four of these white I'm going to do that is by clicking on the Eyedropper
Tool, Selecting all four.
And now this is what I am using as my brush from my tile palette.
I click in the spot I want just there to drop it into place.
Now I'm going to click on the selector again, select all of these and then over on the right hand side
you see that we've got the grid selection properties under scale, we've got X and we'll change that
to minus one that flips them all and has it a nice rounded outside edge on it, which is cool.
Next up, I'm going to just pop in the middle here.
The two elements that I've got that belong in the middle.
I'm going to once again click on them, click on the move tool, drag on over, click on the Eyedropper
Tool, and now I can paint them straight down.
So the paintbrush is what we're using to paint that's on usually automatically by default.
But sometimes when you click on the eyedropper, then you select the thing and then it'll switch over
to the paintbrush tools you see here.
Now, if you go back over into your world, it will let you paint things down even when you're in edit
mode.
But if you come back over here in an edit mode and click again, it'll also be painting things down.
So I'm going to undo all those things I just did.
Click out of edit mode.
Now if you were to paint over in here, you're not going to be out of paint over here, over on the
palette.
The palette is going to be how you select things once again instead of painting.
And then if you jump back over into your scene, then you can paint these things down into the world.
So what I'll do is just delete all of my nonsense that I've created just here by clicking on.
The Eraser tool, and I'm still selected on this area that I'd selected on.
So you see, I get this nice big four.
What is it, five by five?
Nope, four by four grid that allows me to erase nice and quickly.
Next up, what we're going to do is just our very quick paint down, a little platforming type thing.
That's the last part of our process here.
So I want you to go through do that now as a challenge, pause a video and take that on.
Don't overinvest in this because it's definitely going to change as we put more effort into our gameplay
mechanics.
But for now, just create a little bit of a level layout.
I'm going to do that.
You're welcome to watch along.
I'm going to speed up the video so you don't have to watch it in slow time.
So let's make our platform.
Okay.
There we go.
You can see if I scroll in here, I've used these nice little curvy roundy bits to make a curvy roundy
bit around there.
So that corresponds this one here is corresponding to that bit there just makes it look nice and curved.
But there we go, just a little level, just to do some basic platformer stuff.
So good stuff.
I will see you in the next lecture.