Sprite tutorial

This tutorial is made for RPG Maker MV, but it's possible that other versions work similarly (specially MZ). I won't teach you how to draw or how to use a drawing program, you should know that or investigate on your own. I will explain how sprites work in the engine and some tips in general.

Index


Tile size

Tile size is 48x48 pixels.

Your sprite can be any size you want, but you have to keep in mind the tile size will stay the same. This means that your character will have a hitbox of just one tile, a 48x48 square.

So, if your character is absurdly huge, it may look strange in certain contexts.

When sprites are two tiles tall (96 pixels) or lower they won't give you problems. But if you make them taller than that, some star tiles (the ones that you can walk under) may not render properly. There are workarounds (I do that!), I'll explain later in the advanced part.

When sprites are wider than 48, they will be centered in the tile, like this.

But as I said earlier, their hitbox is still that one tile in the middle. So, when you put two wide sprites together, this happens:

They will overlap. Have this in mind. You may use a wide NPC with transparent non-passable events on their sides to prevent your character from overlapping, for example. I just don't recommend making your protagonist too wide.

Also, if your sprite is less wide than 48 pixels, it will get centered horizontally as well (but not vertically).

I recommend always testing when you're unsure of how a sprite will behave. As much as I explain, it may be easier to see for yourself in your game. You can always draw it poorly just to understand it first.


Sprite sheet format

This is important. It is necessary for sprite sheets to be formatted a certain way, the program cannot guess your character size and frames.

Let's take a look at the RTP characters (RTP means default assets). They're in your project folder / img / characters. I edited the background of this picture to explain it easily, but by default they have a transparent background (and that's how they should be, normally).

These characters are all 48x48. You can make them a different size, but let's start here.

As you can see, there are 8 different characters, 4 up and 4 down, each has their zone. Inside each character's zone, they all have the same layout too:

The center column (and second frame of each character) is the one that will show when your character isn't moving. All three will show when your character moves (the order is, 1-2-3-2, looping).

Knowing this, you can make your sprite sheet! What if you want them a different size? You just need to keep the proportion. Let's make calculations.

These RTP sprites are 48x48.
48 x 3 = 144. That's one character's zone width.
144 x 4 = 576. That's 4 characters' zones next to each other, making 4 columns of characters.

48 x 4 = 192. That's one character's zone height.
192 x 2 = 384. That's 2 characters' zones next to each other, making 2 rows of characters.

So, RTP default sprite sheet is 576 x 384 pixels.

What if you want to make your characters 96 pixels tall and 48 wide? The width would stay the same (576), but the height would be like this:
96 x 4 = 384. That's one zone's height.
384 x 2 = 768. That's the height of two zones, one on top of the other.

This is how that sprite sheet would look. Again, I colored the background so you can see the zones, but it should be transparent.

And yes, every character in the sheet must be the same size. If you only have one character with a certain size, you must still leave the appropriate room blank, like the previous image. Or you can do the other option, which I will explain later.

It is very important that you align your characters properly. If they're offset, they will look wrong. I can't teach you all digital drawing programs, but you must find one that lets you set custom grids. Set them using your character's size, and then center all frames in their correct place.

In my case, Clip Studio Paint won't let me set a grid that isn't a literal square, so I simply give my character a "zone" with a colored background, like this:

And then, when I format the sprite sheet in a different canvas, I only have to copy the character and the background together, which serves as a guide to align everything properly. When I'm done, I hide the backgrounds.

Everyone has their own way to go about this, so find whatever is most comfortable to you. I recommend drawing your character first and then formatting the sheet, so you can preview your animation before you export it.


Non walking animations

Walking is cool, but what about special animations? Unless you use a plugin, your animations will be a little limited. Mainly, to 4 frames at a time. This is actually how some RTP sprites work, let's take a look at !Chest.png

You see there are 8 "characters", right?
The way to animate them would be to simply select one of these "characters", and then make them "look" down, then left, then right, then up for this opening animation to take place. Or reverse for closing.

In fact, you see that all three frames of each direction is the same picture, right? If you were making your own sprite, you could set only the middle one and leave the others blank. This is because you don't need these sprites to "walk", so you won't need a walking animation. Make sure you don't make them walk, though. Only change the direction they're "looking" at.

See the next image where I highlighted which options those are. And remember to add waits between "turns" when you animate this way.

Technically, you can string different "characters" together to make an animation longer than 4 frames, since you can keep changing the "character" graphic from here or creating new event pages. And for the player, there's the "change actor images" command. But this is quite annoying and it's easier to use an animation plugin (like QSprite).

An important detail you may have noticed: this sheet has "!" at the start of its file name. This is because characters in RPG Maker, by default, are moved up by 6 pixels ("so they look better"). But in case you need objects to stay exactly placed on tiles, you need to add ! at the start of the file name.

What happens if you don't want characters moving a few pixels up by default? You can use my plugin BF_cosas, which has that option (this is what I do in my game, making that number 0). Using that you can avoid having to use "!" in filenames.

If you don't want to use a plugin, you can change a line in the main code of your project. In your project folder / js / rpg_objects.js, find line 6483.

Change that 6 into a 0, voilà.
It's not recommended to edit these files in this way, in case you mess up and you don't remember how it was before, that's why people write and use plugins. But see, you have like three options to do the same thing.


One character per sheet

It's a pain having to leave blank space in your sheet when you just have one character. Well, you don't need to! I tricked you into understanding basic sprite sheets. But you can definitely have one that only contains one character. RTP has some too. Look at !$Gate1.png

As you can see this also uses "!" just so it won't be moved 6 pixels up.

By adding $ to the beginning of the file name, your sheet will be treated like just one character. In this case, each row has 3 copies of the same frame because this is an object, but you can also make a normal walking sprite.


Advanced: tall sprites

What happens with sprites taller than two tiles (96 pixels)? This.

This is how this tile looks in the tileset editor:

Because I want characters to be able to walk behind the second tile of the street lamp, I have to set it to star. Yet this is what makes sprites taller than two tiles look wrong: the star tile is being drawn on top of the sprite, as it "should", without considering that maybe it shouldn't when your character is in front of it.

There are (supposedly) plugins that fix this issue, but I never got them to work for me. You can do your own search, but if you don't mind eventing it, here's how, using regions:

And with this logic you can achieve star tiles. It's a little cumbersome, but if you already have everything set up you can just copy and paste the events, changing only their graphics if necessary.

Additional advice:


Advanced: more frames

If you need your characters or events using more than 3 frames when walking, or more than 4 when moving their directions manually, you need a plugin. I personally recommend QSprite (for MV). You can select the number of frames, how many frames per second, idle animations and special animations too.

However, even though you decide the logic of your sprite sheets with this plugin (as you can see in the next image), you still need every frame to be the same size and for them to be placed correctly next to each other. QSprite uses another program to interpret how many zones your sheets have. It's not super hard, but you need to be patient and carefully read the instructions.

I can't just write a whole QSprite tutorial because it has too many features, and I don't even use all of them. But I recommend it. It sometimes has unexpected bugs that need to you work around a little, but even with that it's the best sprite plugin that exists for MV (that I know, and I assure you I've investigated).

I also recommend drawing less than 8 frames, because this was a pain to draw. But hey, you do you.


Advanced: lighting and blend modes

I put this in the advanced area but it's actually very simple. This is the way I add light to my street lamps: it's not a plugin, they're just events. I learned this trick from the forum user JohnDoeNews.

First thing I did was to take a screenshot of the street lamp in my game, and then in my image editor I tried different ways of drawing light until I liked one. The one I liked used a layer in this blend mode called "Add (glow)" in Clip Studio Paint.

Now the trick lies in remembering that sprites get centered horizontally and they get placed from the bottom. When you're drawing your sprite, if you have your game's screenshot as a background and you align everything to the 48x48 grid, it will work.

And then you just have to make a sprite sheet like I explained before, leaving blank space. Since you only need one frame here, the easiest way is to multiply the width by 3 and the height by 4, and save the image like that (assuming your frame stayed in a corner).

Going back to RPG Maker, you only have to place your sprite, set it as "above characters", and add "custom autonomous movement". Remember to set the highest speed and frequency. And then in route you only have to add "Blend mode". There you can choose between normal, additive, multiply or screen. In my case, additive is the exact same as add (glow) in Clip Studio, so I select that one. Remember to uncheck "repeat movements" and that's it.

What happens if you need it to move on loop? Then it would be best to apply this transformation from a different event, since "set movement route" works for any event on the map. Make an automatic event that does this and then use "erase event".

By the way, I had some trouble with my street lamps because I couldn't place them literally below the lightbulb, since on certain maps I use events just to paint pieces of the street lamp due to the layer limits on tiles.

But this is easy to fix... by placing the light event to the left and editing the sprite so it has blank space to its left that makes up for this deviation. Remember that sprites get centered horizontally on the tile you place them, having this in mind you can draw almost whatever you want.


Advanced: sprites for transparent events

This isn't hard either, and again I didn't think of it first, I took this advice from Yanfly.

Basically, I use this file named $eventos.png with a few squares with text on them. If I need a transparent automatic event in the middle of a map, but I want to stop forgetting which one is which (since transparent events pile up easily), I use the A icon (if it's parallel, the P icon, if it's transfer, the TRANS icon, if it's the one for my star tiles, the star icon...).

To make sure the icon is never visible in game, I only have to keep this first page of the event (the one that has the graphic) blank, then make a new page, the real one, with its actual contents and no graphic. Neither of them has any condition to activate, so the page with the graphic will never appear in game, but you will see it in the editor.

It has a setback, which is that when you open the event to edit it, it will always open this useless page. But it's not so bad, specially if your events normally have more than one page that you're gonna have to select each time anyway.

The icons you use are for you to decide, you can use mine or make up some for yourself.


And that's it for the sprite tutorial. If I learn something new, I may add it. It's also possible that I made a mistake somewhere, in which case please tell me. But I hope it was helpful. And if you want to thank me... you can always donate, or play my game, which is free.