Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Thanks so much for the advice! Are there any special restrictions that need to be followed when developing for SNES?

Well, there are a lot of restrictions, but unlike other consoles the SNES has several display modes and is able to switch them during display (thanks to the HDMA feature). So graphical restrictions can vary a lot. But I'll try to give you a rough picture:

- For backgrounds, the most common display mode, Mode 1, has 3 active layers. Two layers can hold a 16 colors image each, while the third one is limited to 4 colors only. There are additional modes that display a single layer of 256 colors, or 4 layers of 4 colors each.

- And of course, there is the famous "Mode 7" that can display a single 256 color image that can be rotated and scaled freely. This allow you to make rotating backgrounds like in Super Metroid or Castlevania IV.  For 3D effect like in F-Zero or Super Mario Kart, you'll need to use the HDMA feature in addition to mode 7, so that's quite an advanced topic :). I haven't toyed with mode 7 yet, but I hope to be able to use it in a project someday!

- For sprites, the SNES can display up to 128 sprites on screen (a huge number!). Each sprite can be either of "small size" or "large size". Like the display modes, you can choose what numbers of pixels "small" and "large" actually refer to, from the following size: 8x8, 16x16, 32x32 and 64x64. For example, in Yo-Yo Shuriken I used 16x16 sprites for "small"  (player and enemies) and 32x32 for "large" (the explosions). The larger your sprite are, the more VRAM they'll take, and of course the total amount of VRAM is limited :)

- I don't remember the exact number, but IIRC the SNES can only display 320 pixels on a single line, meaning that you can have about 20 sprites of 16x16px  on a single line (compared to the NES who can only display 4 sprites of 16x16px, this is huge)

- Regarding colors, the SNES have 8 palettes of 16 colors for backgrounds, and 8 palettes of 16 colors for sprites. This is why SNES graphics are so colorful :).

- Regarding audio, the SNES is very powerful for it's release date, and can play sample based music (i.e. tracker music). But you need to fit all the samples and sound effects in the limited RAM space (honestly, there is quite a lot of Sound RAM available, but this is the main limit for audio). Also, you have 8 audio channels available - so if you use 2 channels for Sound Effects, your music can only have 6 channels (that is already quite good IMHO).

- To summarize, compared to 8 bit consoles, the SNES is much less restricted in graphics and audio. Honestly, the main thing you'll fight with, especially when developing in C, is the total amount of CPU power available. The SNES can display loads of sprites on screen, but it will have an hard time to check collision for all of them in a single frame for example.

Thanks for the clarification. One last question: Is there a size limit for ROMs that the SNES can run? I'm sure there is a limit for cartridges but if you are running the game with an emulator, is there a limit to how big the game can be?

Yes, but there are fairly large compared to 8-bit console. The largest commercial games where 6 megabytes (48mbit), so that quite a lot of data as the SNES graphics and audio data don't take that much space!

And if you really need more space, I think you can have mapper chips or  cartridge mapping configurations that allow you to go beyond this limit. Although I haven't looked into that to be honest - for now the standard size fits my SNES projects ;)).

(+1)

Thanks for the answer! 6MB should definitely be enough for my project.

Good luck with your project! And feel free to send it to me if you need beta testers :)

Sounds good!

I do not often use text-based programming languages, nor do I often use libraries. Could you point me in the direction of a tool for writing C and how to set up the PVSNES library?

To set up PVSNESlib, follow the Wiki, it's very well done: https://github.com/alekmaul/pvsneslib/wiki/Installation-with-Windows

For code editor, the Wiki suggest Programmer's Notepad: https://www.pnotepad.org/

Personally, I generally use Scite; https://www.scintilla.org/SciTE.html

If you never programmed in C though, you should be prepared to spent some time navigating the "oddities" of the language. It's very a powerful language, but it also require some "good habits" to avoid nasty bugs. But don't get discouraged / overwhelmed by the apparent complexity of C. To make a simple SNES game you don't need to master all the language features (for example, if pointers seems hard to grasp at first, you can make a game without them). And the more you code in C, the more natural it'll be :).

Thanks for the tips! I'll mess around with C and I'll get back to you if it doesn't work.

This is what my blank "template.c" document looks like, I just finished setting up pvsneslib, but I have a few more questions: Where should I start writing code in the document, what files does the program accept for audio, and how do I make sure I don't trip the restrictions of the SNES, such as color restrictions and background ?

Great that you got the whole thing set up, that's the first step!

If you never programmed in C, I really recommend you to read books / websites / video tutorial about how to code on the language as the next step :).

To answer your question, you can (and will) write code anywhere is the file (more or less). The gameplay code will most likely go after the "put code here" comment. But when you want to use a variable, you'll have to declare it first, so you'll most likely declare the variables after the "#include <snes.h>" file. 

If you trip on color restrictions or audio restrictions, you'll usually see it when running the game on emulator: nothing will show, or the color will be wrong, etc. (retro game development is usually quite scare when it comes to debugging tools :p)

Regarding input, PVSNESlib is quite nice as it accepts:

- BMP for graphics (be careful of the color palette, it needs to have 256 color palette BMP with only the first 16 or 4 colors defined depending on the graphics mode you'll use - usually it'll be 16).

- IT (Impulse tracker) for music and sound effects, if you use the "non-streaming" function. I recommend OpenMPT as a program to create those music and audio files (it's arguably the best "modern" tracker program available) https://openmpt.org/

- WAV for sound effects if you use the streaming functions (beware, it does work well only on NTSC, and it's quite complex to use - I recommend sticking to IT file for beginning)

You can open the source code of Keep SNES alive to see an example of that, the archive contains everything: code, images, sound, music, etc.

But as I said, you should really start by learning how to code in C first, else you'll have an hard time doing anything meaningful. You don't need to take a full course, but at least to learn the "basics" (using and typing variables, loops, creating functions, etc.)