CUSTOM GRAPHICS (NON-NPC)

The uses and pitfalls of non-NPC graphics.

SMBX allows a certain degree of freedom in customizing levels by allowing the developer to replace its default graphics with most anything they may choose. This works best with NPCs, since they have other properties that allow them to be further customized. There are still many other types of graphics the program lets you replace, but they are all limited in various ways. This guide discusses each and their particular quirks.

-----

Before we begin, it's best to note that SMBX only uses .gif image files for its graphics. This means that custom sprites or edits may appear grainy if saved in certain programs. MS Paint is the worst thing you could use. There are plenty of free alternatives, and learning how to use them will work to your advantage here.

-----

This article is specifically for non-NPC graphics. For help with those, look at these other tutorials.

The different types of graphics you can replace are sorted into different folders in SMBX. They are backgrounds, backdrops (called background2), blocks, levels, paths, scenes, tiles, and various character sprites. Any of them can be changed in the following simple way.

To replace a graphic, all you have to do is put the new graphics in a folder with the same name as the level it affects. So, to change the appearance of a wood block in a stage called 'Plain Plains', you'd make a folder called 'Plain Plains' and put the graphic inside. The wood block's file name is block-1, so that's what you would name its replacement graphic. There's more to it than this, but that's the gist of it. For the record, putting the new graphic outside of any level folder will use it for that entire game.

What you'll need for every custom graphic is the following:

1. The sprite sheet
2. The sprite mask


sheet & mask

The sprite sheet is just the images you're using in place of the program's defaults. The sprite mask is the black and white version of the sprite sheet. It defines what parts of the sprite are normally visible. Without it, sprites will appear semi-transparent. Even worse, the mask of the original sprite will show behind it, creating very bad visuals. They are vital for this reason. However, if you wanted the sprite to be transparent, you could include an all-white version to override the original mask. Masks have the same name as their related sprites, but with the addition of an 'm' at the end. So, since the wood block's sprite is block-1, the sprite mask is block-1m.

The important thing to keep in mind is that these sprites cannot be replaced with something larger than themselves. If you have a custom sprite you want to use, you need to choose something the same size or larger to replace it with. They aren't as flexible as NPCs, so you can't just toss in anything.

These same basic principles apply to all custom graphics, but there are exceptions that will be covered next.

Backgrounds

These are objects that you can place to decorate stages. Most of them are static, but some have special properties. Replacing them is simple enough. Choose one the same size or larger than your custom sprite, and you're good to go. The SMB1 giant castle is handy for larger images.

However, please note that, while most background objects have their own mask files, some do not. If the background you choose doesn't have a mask, you can't make a custom one for it.


background-14

Since this background is perfectly square, it doesn't have its own mask. There is no background-14m, and creating one isn't possible.

Furthermore, if the background you choose is animated, you'll need the same number of frames for your custom sprite as the original has. Otherwise, the sprite will blink.

Backdrops (Background2)

These large files set the horizon line for stages. They come in many varieties, and their specific properties aren't always obvious. Some backgrounds can stretch infinitely in any direction, while others are limited in how far they can go. Stretching one too far can cause artifacts (graphical glitches) to appear. Some backgrounds stack on top of each other when selected.

For example, background2-2 serves as the sky for background2-1. If you were to change background2-1, the cheery clouds of background2-2 may not fit with your replacement. And if you stretched it too high...


artifacts noooooooooo

Choosing which backdrop to replace can be a real trick. It's best to consider how much stretching you'll need it to do, then experiment in the program for a suitable swap.

As with backgrounds, if yours is animated, you'll need to pick an animated backdrop and make sure you have the same dimensions and number of frames.

Backdrops don't require masks.

Blocks

Like backgrounds before them, not all blocks have masks. The perfectly square ones can't be customized as anything but perfect squares. However, changing the shape of a block is a bad idea in general because they cannot be altered for hit detection. A block will behave the same way no matter what sprites you use for it, meaning there's not a lot you can do to customize them. You'll just have to pick one that functions in the same way as yours. As before, animated ones need the same size and frame count.

Also keep in mind that not all blocks are solid. Clouds and bridges can be passed through from below. Sizable blocks can be stretched to any proportion, and are similarly pass-through. Sloped blocks retain their slopes, even if replaced with solid squares. Some blocks bounce when hit from below or the side. Choose what you replace carefully!

Levels, Paths, Players, Scenes, and Tiles

These are grouped together because they're all used on the world map. Replacing them is straightforward, but there are some important things to note about them.

First, they can't go in any level folders if you want them to work. They have to go in the folder with the .wld file instead.

Second, while most of them are safe to alter, replacing some of them can cause the editor to crash. They'll still work just fine in-game, but the editor can't load them. If you have such a tile you want to use, it's best to wait until the game is finished to put it in. Otherwise, you'll have to remove it every time you want to edit the world map.

Characters

The sprites for the playable characters are possibly the most rigid of all. The sprite sheets are so large that it appears they could accommodate all sorts of cool stuff, but nothing could be further from the truth.

As with blocks, character collision properties can't be changed in any way. So, if you used a sprite that was smaller than the original, it would still bump into walls, ceilings, etc. the same way the original did. For this reason, smaller sprites are a bad idea.

Larger images have a different problem. While it'd be easy to position them over-top of the existing sprites, they won't look right in the game because of the way SMBX draws the characters. They are defined by the top-left corner of their sprites. Anything too far above or to the left of that boundary gets cut off.


One frame of Mario's sprite sheet. Yeah, that makes sense.

But even if you lined up the new sprites with the top-left corner, it still wouldn't work out. Remember, the collision bounds can't be changed. Anything below the sprite's bottom would stick down into the ground. Anything to their right would look okay, but would stick into walls when pressed up against. It would also create misleading hit detection for enemies with only the left part of the sprite being vulnerable.

If you're going to make custom graphics for the player characters, they have to be the exact same size as the original. It just won't work any other way.

Yoshi

Like the rest, you can't change his proportions or hit detection. Replacing his graphics is easy otherwise. The only quirk here is that his head is a separate sprite from his body. Also, if you use a custom Yoshi, the sprite mask will be messed up in SMBX's standard credits roll.

Hard-Coded Graphics

While SMBX offers you a great deal of visual freedom even with its limitations, there are still some graphics that can't be changed no matter what you do. Most of them are NPCs you ride in. Specifically, the shoe power-ups and Clown Car. If you try to replace their NPC graphics, they'll revert back to shoes/cars when the player hops in.

There are also some parts of the HUD that don't appear in the program's files, so replacing them is also impossible.

-----

That's about all you need to know. Custom graphics are lots of fun to use and really spice up Mario stages by giving them a new look. Just bear the program's limitations in mind, and choose carefully what you replace. Custom graphics don't help when they don't look good!

Posts

Pages: 1
I really want to know why my selection of mp3s causes a sound glitch
every 10 or 20 levels. That is my ultimate question.
author=Davenport
I really want to know why my selection of mp3s causes a sound glitch
every 10 or 20 levels. That is my ultimate question.
You're doing something wrong. Reread this tutorial and follow the steps precisely.
halibabica
RMN's Official Reviewmonger
16873
I don't think this is the right place to be asking??? This tutorial has nothing to do with custom music. Post your question on the help forum instead.
Pages: 1