Take your skills to the next level with these bite-sized tutorials!
Creating Graphics for the Mega Drive
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 Sega Retro:
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!
Take It to the Next Level!
Want more tutorials like this one? Want sneak peeks, early access and more? Then consider supporting me on Patreon!Become a Patron!
Just Want to Buy Me a Coffee?
Check out the rest of this tutorial series!
If you’ve popped over to the tutorial section recently you might have noticed that I’ve added my very first HaxeFlixel tutorial! It shows how to implement a simple, pixel-perfect 2D water shader which I used for Go! Go! PogoGirl. But a few of you might be wondering what a HaxeFlixel is. Well, it’s a 2D game framework that is as powerful as it is underrated! It runs on the (also underrated) Haxe language, is extremely well documented, open source, and has built-in functions for almost anything you’d need.
As I’m sure many of you will remember, the original Streets of Rage for the Mega Drive had multiple endings. The real canonical ending has you beat the crap out of Mr. X, thereby ending his reign of terror forever (yeah, right). However, if you confronted Mr. X with a buddy in tow, a new possible path unlocked. A quick refresher is in order. When you confront Mr. X he will ask you to join his organization.
A few years ago, Yuzo Koshiro posted a pile of old game design documents for Bare Knuckle 2 aka Streets of Rage 2 on the Ancient blog to commemorate the release of Streets of Rage 2 3D on the Nintendo 3DS. These documents gave a deep insight into the game’s inner workings, technical aspects, designs and even some cut content. They were an awesome resource for one of the most awesome games ever created.