A small game engine which I named 'Sparc-16', focused on providing a platform for developing very authentic retro pixel-art games.
The first part of the name is short for "Super Arcade", with the "16" suffix being a reference to the 16-bit era of game consoles it draws inspiration from.
Sparc is built on C++ and SDL. At the core, it is designed to provide a graphics API and feature set which is on par with consoles such as the SNES and Mega Drive.
Graphically, it supports four tile layers and four sprite layers. There can be up to 256 sprites on the screen at a time. Each tile layer and sprite references one of 16 palettes, which each contain 15 color entries plus one transparency entry. Sprites can also define a blend mode, inspired by some of the blend modes of the SNES (although less limiting). Sprites can be set to additive, multiply, subtract, or average (which is equivalent to 50% transparency). I also integrated Blargg's SNES NTSC filter, which faithfully recreates the color palette and artifacts of NTSC televisions, to complete the authentic look of Sparc.
While originally I had wanted to go with a custom audio system which supported a mix of FM synthesis and PCM playback, the tracker interface for composing music proved to be a much larger time investment than I had anticipated. So I scrapped the custom audio core and instead opted for pure PCM playback in the form of a MOD player library plus custom sound mixing code. I used the Micromod library, with a few custom bugfixes, to provide up to 16-channel MOD playback. On top of that, I wrote custom sound mixing code which could playback sounds through up to 8 channels at a user-defined rate. On top of those, Sparc supports a simple echo filter with a hard-coded feedback amount and user-defined delay time between 0 and 200 milliseconds (a setting of 0 disables the echo filter), which was inspired by the echo filter of the SPC chip on the SNES.
Having used Tiled in the past, it was an obvious first choice to investigate as a level editor. Tiled natively supports JSON export, so this was relatively easy to implement with a few assumed limitations (for example, tile layers can't reference multiple tilesets).
In the video below, I show off a tilemap which was created in Tiled and loaded into Sparc.
Additionally, one of the things I definitely wanted to accomplish in Sparc was the ability to change graphics state per-scanline. This enabled some pretty cool and well-known effects in titles of the 16-bit era, such as the water effects in the Sonic The Hedgehog series, or the fire effect in the Final Fantasy 3 title logo.
Inspired by the latter, I wanted to create a cool-looking flame and spark effect which might serve as a main menu background. Three layers are employed here - the background layer, for the flame image, and two scrolling overlay layers for the sparks (I decided it would be simpler to make a single image for sparks rather than use a sprite per spark). The horizontal positions of each layer are offset on a per-scanline basis using sine and cosine functions.