Editing Special Stages - RetroKoH/S1Fixed GitHub Wiki
(Guide written by RetroKoH)
Introduction
The Special Stages work slightly different from traditional gameplay stages. First and foremost, Sonic does not actually interact with other traditional "objects". In fact, Sonic himself is technically the only object in the Special Stages. He falls through the stage, interacting with 24x24 blocks as he goes. We know that these aren't traditional objects for two reasons:
- They are not stored internally in object RAM, or carry any sort of data structure similar to objects.
- We can place an actual object, a ring, into the special stage in Debug Mode (assuming you are running stock Sonic 1). Sonic will be unable to interact with it, and it will not move in accordance with the special stage like other elements do.
Layouts
Each Special Stage layout is Enigma-compressed and consists of 4,096 ($1000) bytes of data. Every "object" in the layout is represented by a single byte, and a single row of the Special Stage layout consists of 64 ($40) bytes. Since 64x64=4096, that means that every Special Stage layout is a 64x64 square layout. Much of this space is left unused in most Special Stages, so those who wish to edit stages to make larger maze layouts will have a lot of room to work with. To edit layouts, you can either decompress the .eni files and hex edit them yourself, or use a dedicated tool like SonED2, or MainMemory's S1SSEdit tool. Information on "object" IDs is located in the table below.
Starting Positions
Like any of the standard levels, each special stage has a starting position that it places Sonic in at the very start. But with Special Stages, the starting position is a little complicated to understand. Let's open up the starting position file for the first special stage in a hex editor. This is located at startpos/ss1.bin. We will see four bytes, which have the format of XX XX YY YY. XXXX is the starting x-position. YYYY is the starting y-position. In this file, they look like so: 03 D0 02 E0
. $03D0 translates to 976 for X, while $02E0 translates to 736 for Y. If we use a RAM viewer (or Debug Mode) while in the game, this appears correct, however, this doesn't correspond whatsoever to his position within a given editor. In our case, Sonic will appear to be at location 00F0 0030
which translates to 240 for x, and 48 for y, respectively.
In order to accurately display where Sonic is supposed to appear within a Special Stage at the start, dedicated editors will offset Sonic's positioning accordingly:
- X - $2E0
- Y - $2B0
Assuming you are using a dedicated editor, this information might not be overly important to you, but it's worth noting.
Objects
The Special Stage "objects" are little more than 16x16 blocks that Sonic reacts to, not unlike how he interacts with terrain in a standard level. Some blocks are used purely for aesthetic purposes, while others provide actual function. Here is a full listing of every block. (Note: Need to document behavior of unused blocks if they are placed within the layouts as is.)
Index Number(s) | Sprite | Name | Notes |
---|---|---|---|
$00 | N/A | Empty Space | Any blocks ID'd as 00 in the layout are empty space. |
$01-09 | Blue Blocks | $01 is a static blue block. $02-09 flash green at varying intervals. | |
$0A-12 | Yellow Blocks | $0A is a static yellow block. $0B-12 flash blue at varying intervals. | |
$13-1B | Pink Blocks | $13 is a static pink block. $14-1B flash yellow at varying intervals. | |
$1C-24 | Green Blocks | $1C is a static green block. $1D-24 flash pink at varying intervals. | |
$25 | Bumper | Works like a typical Bumper. When interacted with, the engine swaps it out with block IDs $32 and $33 to animate it. It can be interacted with once again once it returns to this block ID. | |
$26 | 'W' Block | This block is unused. Its intended use is unknown, but based on the Sonic 2 Nick Arcade Prototype, it's believed to have been intended to have some sort of warping effect, which would explain the 'W'. | |
$27 | 'GOAL' Block | Collision with this block will force Sonic out of the Special Stage. Due to improper collision code, it is possible to collide with this block without that occurring. (I plan to fix this in the future. Credit: Selbi -- EraZor) | |
$28 | Sonic token | This block is unused, though it is shown in the game's manual. It is actually fully functional, granting you an extra life. The icon disappears like a ring or emerald when collected. | |
$29-2A | UP/DOWN Blocks | These are both solid blocks that can be interacted with in order to change the rotation speed of the special stage. $29 (UP) increases the speed, while $2A (DOWN) decreases the speed. | |
$2B | 'R' Block | This is a solid block that can be interacted with in order to reverse the rotation of the special stage. When interacted with, the engine swaps it out with block IDs $31 to animate it. It can be interacted with once again once it returns to this block ID. | |
$2C | Mint Block | This is a solid block that resembles a peppermint. By itself, it does little beyond adding to the aesthetic, but ghost blocks that become these blocks at certain points serve as one-way gates. | |
$2D-30 | Glass Blocks | These glass blocks can be broken down when Sonic touches them. They are most commonly seen surrounding the Chaos Emeralds. | |
$31 | 'R' Block (Ani Frame) | This is the alternate version of the 'R' block meant purely for animation purposes, and is never used in layout data. This version of the block will not affect stage rotation when collided with, and will only serve as a solid block. Once it reverts back to its original state (Block ID $2B), its effect can be activated again. | |
$32-33 | Bumper (Ani Frames) | These are alternate versions of the Bumper meant purely for animation purposes, and are never used in layout data. They will not affect Sonic when collided with, and will only serve as a solid block. Once reverted to its original state (Block ID $25), the Bumper effect can be triggered again. | |
$34-39 | Zone # Blocks | These blocks are unused. Their intended use is unknown though it's likely they were only meant to serve as a marker to display the current Special Stage number. | |
$3A | Ring | This block is a non-solid token that works like a Ring in standard levels, adding 1 to your ring count. The standard spinning ring animation is performed by a specialized function, as opposed to using alternate blocks. Collected rings, however, use Block IDs $43-46 for sparkle animations, before being replaced with Block ID $00. | |
$3B-40 | Chaos Emeralds | These 6 tokens are for the Chaos Emeralds. Collecting one will cause them to use Block IDs $47-4A for special sparkle animations, before being replaced with Block ID $00. This is hard to notice because the Special Stage immediately ends once this token is collected. The top frames are their "proper" colors, while the bottom frames are alternate frames. The miscoloring on the alt frames of Emeralds 3 and 4 are due to the color palette of the Special Stage. | |
$41 | Ghost Block | This block is non-solid and passed through. It serves no purpose by itself, but it gets transformed into the solid Block $2C once triggered. | |
$42-45 | Ring Sparkle (Ani Frames) | These are block IDs meant purely for animation purposes, and are never used in layout data. They are inserted in place of rings that get collected, and revert to Block ID $00 when the animation is finished. | |
$46-49 | Item Sparkle (Ani Frames) | These are block IDs meant purely for animation purposes, and are never used in layout data. They are inserted in place of the Chaos Emeralds that get collected, and revert to Block ID $00 when the animation is finished. | |
$4A | N/A | Ghost Block Trigger | A non-solid Block with no sprite representation, this block turns all ghost blocks into solid blocks when passed through. They are placed adjacently to a set of ghost blocks to create the illusion that Sonic turns ghost blocks solid by passing through them. Because these blocks turn ALL ghost blocks into solids, it is not possible to have multiple sets of these blocks working independently of one another. |
$4B-4E | Glass Block (Ani Frames) | These are block IDs meant purely for animation purposes, and are never used in layout data. They are inserted in place of glass blocks whenever said glass blocks are collided with, providing an animation. Once the animation is finished, the glass block enters its next state, or disappearing outright. They are solid, and provide no additional effect when Sonic collides with them. |
Palettes
Assuming you know how to edit palettes, here is how we can edit the color palette for the special stages. The Special Stage itself utilizes a full 64 color palette, the first line of which is used for Sonic (as well as reds, whites, and blues used elsewhere throughout the stage. Here is the palette:
In stock Sonic 1, every color is accounted for in some fashion except for the three grey colors and the extra black on the second line. I outlined them in red so they can be seen easily. I used the greys for the 7th Chaos Emerald in Fixed. The bottom two lines are used for pink blocks, green blocks, and the background colors, the latter outlined in pink. These colors go through a cycling phase as the colors change.
(NOTE: Mercury's ReadySonic has a fix for the Special Stage colors that you'll want to be aware of. I'll link it here in the future.)
Out-of-Bounds
This information will not really be pertinent to editing Special Stages, but it'll be good to know exactly what it is, as well as how to circumvent/fix these bugs. I'll note further documentation here in the future. In the meantime, enjoy this ROM hack by Selbi: https://youtu.be/KvwT-7ZhUxU?si=i5K5wCGrLAth3xSC