Blue Spheres Forever

Hi everybody! So, if you got here, you probably know what this site is about. Yes, this is a little project that tries to recreate the very popular special stages of Sonic 3 and Sonic&Knuckles. The main goal is to maintain the old but great gameplay, and give the game a new look and feel.

This was the original project... Then I accidentally discovered that secret "Blue Spheres" minigame, and decided to put all toghether. And so, here we are.

The current build features:

  • All the original Blue Spheres levels (about 128 millions) playable by typing their 12-digit code
  • A simple level editor, which will allow you to build your own custom stages
  • 3D and Full HD OpenGL-based graphics engine
  • Built-in interlaced stereoscopic 3D support
  • Remastered music and SFX


Win64 v1.0.3: Download

  • Recompiled with VS2017 (C++14)

Win64 v1.0.2: Download

  • Headache (first person) mode is now available :)
  • Updated sound and graphics libraries
  • Increased shadow quality
  • Minor bug fixing
  • Recompiled with VS2015 (C++11)

How to play

In every level you will find the following objects:

  • Collect all the blue spheres to complete the level. Each time you hit one of these, it becomes red.
  • Avoid red spheres! If you hit one, the game is over.
  • Bumpers will make you run backward (or forward if you were already running backward).
  • Collect all the rings in a level to get the "Perfect" bonus.
  • Yellow spheres will make you jump 6 tiles forward.

You can turn blue spheres into rings by surrounding them:

There are two game modes available:

  • Normal mode - This is the classic Blue Spheres play. You can access this mode with the New Game menu. You will start from level 1, and each time you complete a stage, you will advance to the next. If you get the "Perfect" bonus, you will advance by 10 levels.
  • Custom mode - You can access this mode with the Custom Stages menu. Here you'll be able to play your own stages that you can build with the included level editor. When you first install the game, the custom levels are the 16 original special stages from Sonic 3 and Sonic&Knuckles.

Game controls:

  • Left - Turn left
  • Right - Turn right
  • Up - Go forward
  • Space - Jump
  • Arrows and Enter - Navigate trough the game menus

Using the level editor

This is the simple Level Editor interface. The File menu contains all the standard stuff (New, Save, Open, ...), so let's jump directly to the editing section.

On the menu bar, you can access the Tools (1) menu, and select all the objects you can include in your levels. For instance, try selecting the Blue Sphere tool and then Left-Click anywhere on the Stage Layout Board to add a blue sphere. You can also hold the Left Mouse Button and drag around. To erase one or more tiles just click or hold&drag the Right Mouse Button on the board.

On the right side of the window, you can configure several stage's properties:

  • Floor Appearance (3) - Here you can select the appearance of the floor. For the color, you can choose the standard checkerboard (you can select the pattern colors by clicking the two black rectangles) or a custom texture. The Bump Mapping check box let you turn bump mapping on/off. If you don't know how normal maps work, just experiment and see the results. The predefined normals maps are named like "normalXX.png" where XX is a number.
  • Sky appearance (4) - Here you can specify the 2 colors that will be used to create the sky gradient, and 2 colors that will be used for the stars.
  • Emerald Color (5) - Specifies the color of the emerald that you get when the stage is clear.
  • Start position and direction (6) - This is where Sonic will spawn and his orientation when the game starts. The Stage Layout is a 32x32 grid, so the position goes from 0 to 31 both for X and Z. To know exactly the position of a tile without going mad, just move your mouse over that tile on the Stage Layout Board. You can see the coordinates on the bottom-left corner of the window (2)
  • Max Rings (7) - This number specifies how many rings you must collect to get the "Perfect" bonus.

Once you are satisfied with the stage layout you can save it from the File menu. Remember to put your stages in the data folder inside the game's installation directory ("{GameDir}/res/data").

To play your stages in the game you must specify to load them. You can do this from the File > Game Stages menu. You'll be prompted this dialog:

This list contains the stages that are loaded in this order by the game.

Now, let's jump to the more advanced stuff... I will now explain how to import your own textures, bump maps and how to use the Avoid Search tool.

Textures and bump maps are located in the textures folder inside the game installation directory ("{GameDir}/res/textures"). If you want to add your own textures just put them there.

Remember that all the images must be in PNG format, while the size and the ratio can be whatever you want. Anyway, for the best performance, I reccomend to use squared textures with a dimension of a power of 2 (ie. 128x128, 256x256, 512x512, ...).

Once you put your textures in the right folder, they'll be loaded inside the level editor and you'll be able to select them from the dropdown lists. Here you can see some examples of what you can do with custom textures and bump maps:

Time to explain the use of the Avoid search tool. To better understand its purpose, consider the following situation:

Every time you collect a blue sphere, the game tries to transform blue spheres into rings, and to do this, it will search for a closed path of connected red spheres starting from your current position, and it will not stop until it finds one, or all the possible paths have been evaluated. So in this situation, there's no solution and a lot of paths to explore. This will cause the original SEGA game to crash, and may cause problems a slow-down on this remake. Now, the new algorithm is smarter and will avoid obvious fails, but it is not perfect.

If this explanation was a little too technical, try to see it this way: everytime you have blue spheres connected to very large groups of red spheres, this may cause a game crash. Don't use this tool if there's not such a situation.

To make the game work on these situations, you can use the Avoid Search tool. The next two examples show its basic functionality.

Use the Avoid Search tool on the 4 blue spheres. Now, when you play and hit them, the game skips the search and they'll be not turned into rings, even if there's a path of red spheres that encloses them. But, maybe this is not what you wanted:

So, if you take the first blue sphere, jump over the next two, and take the last, you would like that the spheres enclosed in the yellow rectangle become rings, right? You can use the Avoid Search tool to achieve this:

In this situation, the game starts searching for a path from your current position, but it will not go past the red spheres marked with "X". If you look, it is clear that the the only possible path is the one enclosed in the yellow rectangle (or subpaths inside), but the game doesn't know and would try to explore the whole stage.

To all of you that have some basic knowledge of AI, the path-finding is implemented with a modified A* search algorithm which will avoid obvious fail situations, like loops, searching if there are no blue spheres nearby, searching from red spheres fully surrounded by other red spheres, and skipping the locations marked with the Avoid Search tool.