Creating Graphics for the Mega Drive
This tutorial is most likely not compatible with versions of SGDK above 1.70. Unfortunately, I simply do not have the capacity or ability to update them right now. Read more about it here. Sorry.
Ninja Time!If you like 90s platformers, check out my new game Chibi Ninja Shino-kun!
When it comes to making graphics for the Mega Drive, there are a number of programs available that you can use. It doesn’t really matter if you’re using software specifically designed for retro pixel art or more modern graphics suites like Photoshop or GIMP, as long as your program supports the use of palettes. However, even when your software is capable of creating images that SGDK can process, there are still a number of restrictions you have to keep in mind when designing and drawing your sprites and tiles. I thought I’d give you a quick rundown on what you need to keep in mind to create your own graphics for your Mega Drive game.
1. Color Depth
The Mega Drive uses a 9-bit RGB palette, which contains a total of 512 colors that you can use. Here is an image of all the available colors, taken from Wikipedia:
As you can see, it covers a lot of colors, but not all of them. Should you use a color in your image that is not in this table, SGDK will approximate it. Usually that is not a huge deal, as out of 512, there is usually one color closely matching the one you wanted. However, if you want to make sure that the in-game graphic looks exactly as you designed it, only use the colors in this table.
2. Number of Colors
Out of the 512 available colors, the Mega Drive can use 64 colors at once. These are stored in 4 separate palettes with 16 colors each (labelled
PAL3 in SGDK). Each sprite or tile only uses one of those palettes, meaning that it can only be made up of 16 colors. However, in actuality only 61 of the 64 colors can be displayed at the same time, because the first color of each palette is transparent. But shouldn’t that mean there can be only 60 colors on screen, not 61? Well, the very first color is actually used as the background color of the game, so that one does appear on screen (we use this to create a blue sky in Megarunner). But the first colors of
PAL3 are always transparent, so actually each sprite or tile can only contain 15 colors. Choose your colors wisely to make the most out of them!
When you save your image, make sure to save it as a
.png or a
.bmp file. These are the only two formats that can be processed by SGDK and that will retain the palette information we need. Every art program should be able to handle these formats, so this is more of a hint than a warning. However: If you use suites like Photoshop or GIMP, make sure to explicitly set the color mode of the image to indexed color (or something along those lines). A mode like RGB will not work, as it does not use palettes.
4. Make Sure to Share Palettes
When you’re drawing graphics that should share the same palette, make sure that you’re using the exact same palette for all the images while you’re drawing. This might sound obvious, but it’s very easy to forget about it. If not all images are saved with the exact same palette, you will either get an error message when SGDK tries to compile and import them, or you will end up with sprites in the game not looking the way you intended. It’s a good idea to decide on a palette early, export it as a
.pal file (or whatever your software uses), then load this palette for every new image that should use that palette. And if you end up modifying the palette in one image, make sure to load this palette for images you’ve already done so that you can see the changes and make adjustments!
5. Image Size
The Mega Drive works with graphics in 8x8 pixel chunks, which is the size of a single tile. This means that the dimensions of each image file must be divisible by 8! So an image can for example be 8x8, 16x8 or 24x16 pixels big, but not 6x6 or 17x32. Keep in mind that this only applies to the dimensions of the image file! You can draw a sprite that is smaller than 8x8 pixels for example, but you will have to do it on a 8x8 pixel canvas. You would then fill the background with the first color of your palette, as that will make it transparent in the game.
And those are the 5 basic things you should keep in mind when creating graphics for your Mega Drive game. Once you have created some
.bmp files, you can import them into SGDK using the
resources.res file in your project folder. If everything goes well, you can now grab the palette data from an image and put it in one of the 4 palettes. For a more detailed explanation, see step 3 of my Megapong tutorial.
While creating graphics for the Mega Drive is a lot more restricted than in modern game development, there is still a lot that a skilled artist can get out of the little black box. It’s all about how you use the palettes to their maximum effect. Working within these restrictions is a skill in itself, one that you can only develop by training and experimenting. But I hope I could give you at least an overview of the basic things you have to keep in mind!
And by the way, did you know that you can swap out colors in your palettes during gameplay? I’ve written a tutorial on the topic so check it out to get even more out of palettes!
If you've got problems or questions, join the official SGDK Discord! It's full of people a lot smarter and skilled than me. Of course you're also welcome to just hang out and have fun!
Join my mailing list!
You'll get notified whenever cool stuff happens!
Take It to the Next Level!Become an excellent patron on Patreon and snatch yourself some kickass perks such as early builds, exclusive updates and more!
Want To Buy Me a Coffee?
Coffee rules, and it keeps me going! I'll take beer too, though.
Check out the rest of this tutorial series!