[Intro] Hello fellow Scratchers!
I’ve been crazy busy working on an epic Scratch RPG project. And I’m dead excited because it’s
destined to be a truly amazing tutorial series. What you are seeing here is my current work in
progress build, still far from complete, but, I thought it would be fun to share with you some
of the journey that got me to where I am now. You just wait until we talk about the level editor,
oh man I love this thing. Please guys, do join in the conversation in the comments below this video,
I’d love to know what you like, dislike, or if you see potential for improvements, you guys can help
direct how this project develops! Just so cool. But let’s start at the beginning.
How did this all begin! [Week 1 – Where it all began]
A month ago, I submitted a poll on my YouTube community tab to gauge the popularity of a
handful of possible tutorials – An RPG, a Sonic game, Puzzle, rhythm game… We had over 8000
responses, and more half of them voted for an RPG – Wow, Exciting!?!
Now the world of RPGs is very diverse, but I had my suspicion that the most popular would be in the
style of Zelda, a link to the past, or Undertale? A quick post in the community tab,
and my suspicion was confirmed, the majority responded very positively to the Zelda theme.
Well ok, so where do we start? Looking over a Zelda wiki page we can find the overworld map,
and we can see that the level is huge! But this huge map is broken into smaller square regions.
And then these regions will scroll, and are made up of a simple grid of tiles. Similar
to our tile scrolling Mario game tutorial. But… the tiles… oh man, the tiles – They are
so glorious, so detailed, and… there’s so many of them! Just looking through the tile sheets in the
wiki gives you a flavour of what’s involved to make this game look as good as it does! And this
is where things might get tricky. How are we going to make our Scratch RPG look as good as this?
[Sprite Sheets] Ok… we have the Scratch paint editor… all we
need to do is draw a super awesome tile set of our own… Like in the Legend of Zelda… Just draw it…
Yeah, scrap that, what can I find on the internet! 😊
The “OpenGameArt” site is a great place to start, full of pre-made sprites by talented bods. But
I have to be careful that it doesn’t feature too many tiles, as the tutorial wants to stay
simple… really minimalist, something simple that didn’t use a lot of tiles… something… exactly like
THIS! Yes! Tiny 16 by Sharm. The perfect tileset for testing out some ideas in Scratch – It even
comes with a cool adventurer sprite, useful! [Importing a sprite sheet into Scratch]
The only problem is that sprite sheets tend to come as single large image files,
like this one. If I import it into Scratch then, well poop – That’s not very useful at all.
To be able to use these individual tiles, we’ll need to split them up,
one costume per tile. Now sometimes, with small tile sets, we can do this my hand!
But… with a lot of tiles… this takes way too long, and there are better ways. For
example – This website I found, ezgif.com (easy gif .com). Packed full of useful tools,
one of which is a tile splitter – Found under the “Split” tab, and “sprite sheet cutter” sub tab.
We just upload the sprite sheet file. Then set the tile size, these ones are 16x16 pixels.
And then “Cut!” – Don’t worry if you miss any of this, I’ll be going over
it again in the official tutorial later on. But yeah! All the tiles are now separated into
their individual files. We download them as a zip, extract the files into a new folder,
and finally upload them in bulk into Scratch.
Boom! All the tiles, perfectly laid out, ordered and ready to rock! What a time saving tip!
[Tile Engine – Clones or Stamping] So, with a set of tiles all ready to go,
what kind of tile engine should we build? Last year we used sprite clones to make the
Mario Tile scroller. This worked really well, and there’d be no issue reusing it in our RPG, But I
never pass up the chance to teach you something new. What do you know about tile stamping?
So, instead of building the visible level from 100’s of tile sprite clones,
we ditch the clones altogether, instead having just one tile sprite, and then actually paint
the screen manually by moving the tile sprite into position and stamping the costume in place using
the pen extension. Then we move it, and stamp again, repeating to fill the entire screen.
The end results should look identical, so the question is,
is there an advantage to doing it this way? Well, using less clones is always good, we can
only ever have 300 and most of these get used up right away. But also, we have a bit more control
over how our screen draws, being able to choose exactly when and how to draw each tile. Indeed,
we can quickly draw more tiles without needing to clone new sprites which will be super useful
when making the level editor for example. A possible downside is that stamping historically
has proved to be much slower than using clones…? But I have a suspicion that this may no longer be
the case. There’s only one way to be sure… I got Scratching and knocked-up a test project,
stamping out a simple grid of tiles so I could time how quickly scratch could draw each frame…
And wow – The performance of sprite stamping in Scratch has seriously improved over the last
couple of years – Indeed it’s tripled in speed bringing it right up to the speed of the cloning
engine. That’s amazing news for us – Thank you Scratch Development Team for your continued work
making Scratch perform so well! [Stamping Editor – version 1]
Cool – It’s settled then, we’ll be learning how to create an efficient tile stamping
engine in Scratch – How exciting! But before I can teach you guys,
I still have a lot of work ahead of me to build the project myself. This avatar sprites
were included in the tile-set, so I added a player, and then got to work building a
minimalist level editor – Always a priority as it’s hard to build levels without one!
And here we are, a simple top down scroller is coming together. It’s amazing what you
can do with just 4 tiles isn’t it! These are the 4 dungeon tile costumes, and then,
up here, we have an overworld zone showing off path, grass and flower tiles. It’s
all very simple, but it gets the job done. The level editor is accessed using the 0 key,
and since we’re using stamping, I was able to quickly code up a simple tile
selection UI across the bottom of the screen – Sweet! But this is going to get
so much cooler – Just you wait! [Week 2 – Taking a step back]
I’m concerned – It’s the second week of my RPG dev work and I’m worried
about how much work is ahead of us – I decided to share my concerns about yet
another long tile scrolling tutorial with the community, was this really the way to go…?
Aw, you guys – Your optimism always gives me a boost! Ok, ok, the majority of you were pretty
confident that tiles were indeed the way to go! Perhaps a change of avatar could spice things up.
This guy is more chunky and… He has an attack animation too! Yeah, I was a bit worried how
I was going to add that to the other guy who didn’t come with one. Cool I like it.
But what about the other tiles? Picking a simple tileset was a winner for simplifying the tutorial,
but I’m worried that everywhere in the level will look the same. And how will we add houses
and rooms like in Zelda? [Take a break]
Ok – so I needed a break to think about things – So I did something
completely different and wrote a new game in Scratch – Eat the Level! You may have
seen it :D – That was such a blast, and just got my creative juices flowing! What fun!
[Week 3 - Text Engine] Week 3, and I’m back on the RPG,
thinking about text engines. All RPGs need these for narrative, and dialog.
There are plenty of cool looking bitmap fonts available if you google for them. I found a few
candidates. Sadly, since they are not fixed widths like the tiles these needed splitting up by hand.
Even so, I got away without having to line them all up by hand, instead building an
automatic sprite measuring script to jigger the letters into the right positions for me. This is
awesome as it supports variable width lettering and handles word wrapping as standard! Do you
smell a backpackable tutorial coming your way? Oh boy yes, so watch out for that.
[Adding Larger Level Props] I’ve had an idea – Perhaps if
I could bring in larger sprite costumes as entities, or props that sit on top of
the base layer of tiles. This would allow us to add larger buildings, or trees into our world.
This one is just manually placed to get a feel for how it might work. And you know,
it’s not that bad. Of course, we’d need to now add sprite ordering to handle being able
to walk behind the props. But we have my clone layering tutorial for that right?
[Week 4 – Expanded Vision & Tile Palette] Week 4 now, and I’ve decided, this simple
tileset and props – They’ve got to go. If we’re going to the effort of creating a huge RPG series,
we might as well do things right and go the whole hog with a far more epic RPG tileset.
With a bit more googling I stumbled upon this little gem,
the “Top Down Adventure Pack” by o_lobster. He’s posted it on itch.io and it’s available
for download to everyone for as little or as much as you wanna donate to him. And,
for those who can’t afford to pay, well that’s ok too… and I tell you, his work is top notch,
very similar to the Zelda style we are after, so huge credit to o_lobster, what a champion!
And my word, there’s a lot of cool tiles here, I use ezgif to split them up,
and wow the overworld tile sheet alone account for an astonishing 250 costumes! Ouch, that’s a
tad more than our previous 10 tile costumes. Our level editor is going to need a serious upgrade!
Luckily, I already have a plan. You’ll notice how beautifully the original tile sheet is laid out.
This making it easy to see how the tiles are intended to fit together. It would be a shame
to lose this layout after bringing them in to Scratch, so I’m thinking we try to borrow the
same layout as a tile picking palette? My first idea was to have a key press
toggle between the level editor, and a full screen tile picker. But,
that would soon become laborious, switching back and forth constantly to choose the next costume.
So, instead I opted to split the screen, leaving a 5 tile wide palette docked to the right.
The palette would need to be scrollable to access the entire tile set. Pretty cool right! And boy,
would this would have been far harder to achieve using clones – Can you imagine - I’m really
appreciating the freedom that stamping brings us, and I’m looking forward to teaching you all
about it too. [Outro]
So yeah, I wanted to keep this dev-log relatively short, so I’ll stop right there – But do join me
next time to learn how I propose we tackle complex collision regions between tiles. What to do about
tile layering with buildings and trees. Do we even want to consider over and under collisions and
layering?!? And what about tile auto arranging, or is there perhaps a better to handle this
considering the huge RPG tile-set we are using? Well, if you enjoyed this video then please smash
the like button, it would mean a lot to me, and don’t forget to subscribe to this channel
now so as not to miss the next video when it comes out – There’s so much more to look
forward to! I’m just bursting to share this stuff with you 😊. If you’re as excited as me,
then you might want to join the early access channel membership to both support the channel
further, and guarantee you get the videos as soon as they are made! How cool is that?
Well, that’s it for today, I hope you have a great week ahead, and Scratch on guys!