Open Sonic

Open Sonic is a free open-source game based on the "Sonic the Hedgehog" universe. It introduces a different style of gameplay called cooperative play, in which it's possible to control 3 characters simultaneosly. Unlike most similar games, Open Sonic provides a greater level of interaction between the player and the levels. It's more than just a jump'n'run; the user must come up with some strategy in order to get through the levels.

Currently this game works on MS Windows and GNU/Linux. Mac OS X support is experimental.

This game is not endorsed, produced or affiliated with Sega, or any of its subsidiaries. Sega did not make this. This is a non-profit unofficial fangame based on the "Sonic" universe and should be categorized under the same criteria as fanart or fanfiction. The creator of this game is not liable for any and all damages you incur while playing. Sonic, Tails, Knuckles, Eggman, and all related characters, objects and locations are property of their respective owners. All other copyrighted characters contained within belong to their own respective companies and organizations.

How to play

How to execute the game

To start Open Sonic, you may run the opensonic executable. You may also run the opensonic_launcher binary if you want to use special options like improve the graphics of the game or play at a specific level of your choice. Launcher is a program that complements the main game by providing additional features.

Under MS Windows, just double-click the file opensonic_launcher.exe that's inside the folder you uncompressed the game.

Under GNU/Linux, open a terminal, go to the game folder and type ./opensonic_launcher

Menu options

Moving the characters

You can play using your keyboard or a joystick, and you may choose which input device you prefer in the launcher program. If you decide to use a joystick, make sure it has at least 2 axis and 4 buttons. If you want to play using your keyboard, see the table below to know how you can control the characters at any level:

Key Effect
Arrow keys Move the active character
Space bar Jump
ENTER Pause the game
Left CTRL key Change the active team member*
ESC Quit the game
Tip: you can press anytime either the '=' or the PrintScreen key to take a snapshot of the game.

Cooperative play

Cooperative play is an exciting feature of Open Sonic which allows you to control 3 characters simultaneosly! Each character has unique advantages and disadvantages, so some team work is needed in order to get through the levels.

To learn more about cooperative play, please play the Tutorial.

Advanced features

Command line options

Open Sonic provides several features via command line. You can use the command line options instead of the launcher program if you want. If you're using MS Windows, run opensonic.exe --help at the Command Prompt. If you're using GNU/Linux, open a terminal, go to the directory of the game and type ./opensonic --help

Level editor

When you're playing at any level, press F12 to access the level editor. It has three edit modes: brick mode, item mode and enemy mode. Basically a brick is a background object or a platform; an item is something like a ring, a life box or a checkpoint; and it's obvious what an enemy is. In the table below, an 'object' may be a brick, an item or an enemy, depending on the current edit mode.

Key Effect
Arrow keys Move the camera
B / N Select the previous/next object
Ctrl+B / Ctrl+N Previous/next edit mode
F12 Quit the editor
Left mouse button Put the selected object under the mouse cursor
Middle mouse button Pick the object that's under the mouse cursor
Right mouse button Delete the object that's under the mouse cursor
Ctrl + left mouse button Change the spawn point of the team
Tip #0: use the left control key.
Tip #1: you can press Ctrl+F12 to save the level with your modifications. This operation is irreversible! If you want to modify a level permanently, we urge you to backup the level/ folder! Under Linux, if you have no write privileges on the GAME_DIRECTORY/levels/ folder, the game will save it on $HOME/.opensonic/levels instead.
Tip #2: if you want to make your own levels, you should read the level editor tutorials at our website.
Tip #3: in order to pick up (or delete) an item, you must select the item mode. Similarly, in order to pick up (or delete) a brick, you must select the brick mode. Same about the enemies. Use Ctrl+N or Ctrl+B to change the edit mode.

Game resources

Important for GNU/Linux users! Since Open Sonic 0.1.1, you can store custom levels, quests, images, sounds and so on in GAME_DIRECTORY/ (default) and also in $HOME/.opensonic/ . GAME_DIRECTORY is the directory where you installed the game. In other words, if the game is located in some folder which you don't have write privileges, you can, for example, make your own levels with the level editor and save them in the $HOME/.opensonic/levels/ folder.

License

The code of this game is licensed under the GPL version 2. Please read the file license.txt that comes with this software.

How to compile

Overview

If you've downloaded the binary files of Open Sonic, then you don't need to compile anything: the game is ready to run! However, if you've downloaded the source-code of this game, then you must compile it manually.

To compile Open Sonic you must have a C-language compiler and the programming libraries that this game uses. You also need CMake, a cross-platform open-source build system.

Note: for simplicity, let's call GAMEDIR the directory where you unpacked the game. GAMEDIR stores, among other things, this readme.html page and a file called CMakeLists.txt

Obtaining the libraries

Once your compiler is working well, you'll need to install the following free programming libraries:

I won't get into details on how to install these libraries. Please check out their websites to know the detailed instructions.

After you have installed correctly the libraries, you can finally compile the game. CMake will automate this process ;)

Note: you can disable the DUMB library by uncommenting the SET(DISABLE_DUMB TRUE) line in CMakeLists.txt. Similarly, you can also disable the .ogg support by uncommenting the SET(DISABLE_LOGG TRUE) line in the same file. However, I do NOT recommend disabling these resources, since they are required for music playback.

Compiling on GNU/Linux - gcc

Please open a terminal, go to GAMEDIR and follow the example below: (make sure the configure script is executable - if it's not, a chmod +x configure should do the trick)

alexandre@pcname:/alex/proj/opensnc/opensonic/trunk$ ./configure
Open Sonic version X.Y.Z
-- Configuring done
-- Generating done
-- Build files have been written to: /alex/proj/opensnc/opensonic/trunk

alexandre@pcname:/alex/proj/opensnc/opensonic/trunk$ make
[  3%] Building C object CMakeFiles/opensonic.dir/src/2xsai.o
[  6%] Building C object CMakeFiles/opensonic.dir/src/actor.o
[  9%] Building C object CMakeFiles/opensonic.dir/src/audio.o
[ 12%] Building C object CMakeFiles/opensonic.dir/src/boss.o
[ 16%] Building C object CMakeFiles/opensonic.dir/src/brick.o
[ 19%] Building C object CMakeFiles/opensonic.dir/src/confirmbox.o
[ 22%] Building C object CMakeFiles/opensonic.dir/src/endofdemo.o
[ 25%] Building C object CMakeFiles/opensonic.dir/src/enemy.o
[ 29%] Building C object CMakeFiles/opensonic.dir/src/font.o
[ 32%] Building C object CMakeFiles/opensonic.dir/src/input.o
[ 35%] Building C object CMakeFiles/opensonic.dir/src/intro.o
[ 38%] Building C object CMakeFiles/opensonic.dir/src/item.o
[ 41%] Building C object CMakeFiles/opensonic.dir/src/lang.o
[ 45%] Building C object CMakeFiles/opensonic.dir/src/langselect.o
[ 48%] Building C object CMakeFiles/opensonic.dir/src/level.o
[ 51%] Building C object CMakeFiles/opensonic.dir/src/main.o
[ 54%] Building C object CMakeFiles/opensonic.dir/src/menu.o
[ 58%] Building C object CMakeFiles/opensonic.dir/src/osspec.o
[ 61%] Building C object CMakeFiles/opensonic.dir/src/player.o
[ 64%] Building C object CMakeFiles/opensonic.dir/src/quest.o
[ 67%] Building C object CMakeFiles/opensonic.dir/src/questover.o
[ 70%] Building C object CMakeFiles/opensonic.dir/src/scene.o
[ 74%] Building C object CMakeFiles/opensonic.dir/src/screenshot.o
[ 77%] Building C object CMakeFiles/opensonic.dir/src/sprite.o
[ 80%] Building C object CMakeFiles/opensonic.dir/src/util.o
[ 83%] Building C object CMakeFiles/opensonic.dir/src/video.o
[ 87%] Building C object CMakeFiles/opensonic.dir/src/iconlin.o
Linking C executable opensonic
[ 87%] Built target opensonic
[ 90%] Building C object CMakeFiles/opensonic_launcher.dir/src/launcher.o
[ 93%] Building C object CMakeFiles/opensonic_launcher.dir/src/lexgui.o
[ 96%] Building C object CMakeFiles/opensonic_launcher.dir/src/osspec.o
[100%] Building C object CMakeFiles/opensonic_launcher.dir/src/iconlin.o
Linking C executable opensonic_launcher
[100%] Built target opensonic_launcher

alexandre@pcname:/alex/proj/opensnc/opensonic/trunk$ sudo make install
[ 87%] Built target opensonic
[100%] Built target opensonic_launcher
Linking C executable CMakeFiles/CMakeRelink.dir/opensonic
Install the project...
-- Install configuration: "Release"
Installing Open Sonic X.Y.Z... Make sure you have root privileges.
-- Installing /usr/share/opensonic/opensonic
-- Installing /usr/share/opensonic/opensonic_launcher
-- Installing /usr/share/opensonic/license.txt
-- Installing /usr/share/opensonic/readme.html
-- Installing /usr/share/opensonic/config
-- Installing /usr/share/opensonic/config/sprite.def
-- Installing /usr/share/opensonic/gui
-- Installing /usr/share/opensonic/gui/button1.tga
-- Installing /usr/share/opensonic/gui/buttonhi.tga
-- Installing /usr/share/opensonic/gui/buttonpress.tga
-- Installing /usr/share/opensonic/gui/button_disabled.tga
-- Installing /usr/share/opensonic/gui/checkbox.tga
-- Installing /usr/share/opensonic/gui/dialog.tga
-- Installing /usr/share/opensonic/gui/gui.dat
-- Installing /usr/share/opensonic/gui/listbox.tga
-- Installing /usr/share/opensonic/gui/logo.tga
-- Installing /usr/share/opensonic/gui/radio.tga
-- Installing /usr/share/opensonic/gui/scrollbar.tga
-- Installing /usr/share/opensonic/gui/slider.tga
-- Installing /usr/share/opensonic/gui/textbox.tga
-- Installing /usr/share/opensonic/gui/vscroll.tga
-- Installing /usr/share/opensonic/images
-- Installing /usr/share/opensonic/images/animals.png
-- Installing /usr/share/opensonic/images/baddies.png
-- Installing /usr/share/opensonic/images/boss.png
-- Installing /usr/share/opensonic/images/checkpoint_orb.png
-- Installing /usr/share/opensonic/images/example.png
-- Installing /usr/share/opensonic/images/font.png
-- Installing /usr/share/opensonic/images/gui.png
-- Installing /usr/share/opensonic/images/icon.png
-- Installing /usr/share/opensonic/images/intro.png
-- Installing /usr/share/opensonic/images/island.png
-- Installing /usr/share/opensonic/images/island2.png
-- Installing /usr/share/opensonic/images/island3.png
-- Installing /usr/share/opensonic/images/items.png
-- Installing /usr/share/opensonic/images/null.png
-- Installing /usr/share/opensonic/images/ocean.png
-- Installing /usr/share/opensonic/images/ocean2.png
-- Installing /usr/share/opensonic/images/player.png
-- Installing /usr/share/opensonic/images/prototype1.png
-- Installing /usr/share/opensonic/images/prototype2.png
-- Installing /usr/share/opensonic/images/ring_shields.png
-- Installing /usr/share/opensonic/images/sourcecode.png
-- Installing /usr/share/opensonic/images/spring_pads.png
-- Installing /usr/share/opensonic/images/squarebg.png
-- Installing /usr/share/opensonic/images/title.png
-- Installing /usr/share/opensonic/levels
-- Installing /usr/share/opensonic/levels/blue_ocean_1.lev
-- Installing /usr/share/opensonic/levels/blue_ocean_1m.lev
-- Installing /usr/share/opensonic/levels/blue_ocean_2.lev
-- Installing /usr/share/opensonic/levels/blue_ocean_2m.lev
-- Installing /usr/share/opensonic/levels/blue_ocean_3.lev
-- Installing /usr/share/opensonic/levels/blue_ocean_3m.lev
-- Installing /usr/share/opensonic/levels/exotic_1.lev
-- Installing /usr/share/opensonic/levels/exotic_1m.lev
-- Installing /usr/share/opensonic/levels/exotic_2.lev
-- Installing /usr/share/opensonic/levels/exotic_2m.lev
-- Installing /usr/share/opensonic/levels/exotic_3.lev
-- Installing /usr/share/opensonic/levels/exotic_3m.lev
-- Installing /usr/share/opensonic/levels/prototype.lev
-- Installing /usr/share/opensonic/levels/testzone.lev
-- Installing /usr/share/opensonic/levels/tutorial_1.lev
-- Installing /usr/share/opensonic/levels/tutorial_2.lev
-- Installing /usr/share/opensonic/licenses
-- Installing /usr/share/opensonic/licenses/2xsai.txt
-- Installing /usr/share/opensonic/licenses/Allegro.txt
-- Installing /usr/share/opensonic/licenses/AllegroPNG.txt
-- Installing /usr/share/opensonic/licenses/DUMB.txt
-- Installing /usr/share/opensonic/licenses/lexgui.txt
-- Installing /usr/share/opensonic/musics
-- Installing /usr/share/opensonic/musics/boss.it
-- Installing /usr/share/opensonic/musics/credits.txt
-- Installing /usr/share/opensonic/musics/endofquest.it
-- Installing /usr/share/opensonic/musics/exotic.it
-- Installing /usr/share/opensonic/musics/invencible.it
-- Installing /usr/share/opensonic/musics/ocean.it
-- Installing /usr/share/opensonic/musics/speed.it
-- Installing /usr/share/opensonic/musics/title.it
-- Installing /usr/share/opensonic/musics/tutorial.it
-- Installing /usr/share/opensonic/quests
-- Installing /usr/share/opensonic/quests/master.png
-- Installing /usr/share/opensonic/quests/master.qst
-- Installing /usr/share/opensonic/quests/tutorial.png
-- Installing /usr/share/opensonic/quests/tutorial.qst
-- Installing /usr/share/opensonic/samples
-- Installing /usr/share/opensonic/samples/jump.wav
-- Installing /usr/share/opensonic/samples/1up.wav
-- Installing /usr/share/opensonic/samples/bigring.wav
-- Installing /usr/share/opensonic/samples/bigshot.wav
-- Installing /usr/share/opensonic/samples/bosshit.wav
-- Installing /usr/share/opensonic/samples/brake.wav
-- Installing /usr/share/opensonic/samples/break.wav
-- Installing /usr/share/opensonic/samples/bumper.wav
-- Installing /usr/share/opensonic/samples/cash.wav
-- Installing /usr/share/opensonic/samples/checkpoint.wav
-- Installing /usr/share/opensonic/samples/choose.wav
-- Installing /usr/share/opensonic/samples/credits.txt
-- Installing /usr/share/opensonic/samples/death.wav
-- Installing /usr/share/opensonic/samples/deny.wav
-- Installing /usr/share/opensonic/samples/destroypop.wav
-- Installing /usr/share/opensonic/samples/door1.wav
-- Installing /usr/share/opensonic/samples/door2.wav
-- Installing /usr/share/opensonic/samples/endsign.wav
-- Installing /usr/share/opensonic/samples/fire.wav
-- Installing /usr/share/opensonic/samples/fire2.wav
-- Installing /usr/share/opensonic/samples/floorfall.wav
-- Installing /usr/share/opensonic/samples/glasses.wav
-- Installing /usr/share/opensonic/samples/goal.wav
-- Installing /usr/share/opensonic/samples/puff.wav
-- Installing /usr/share/opensonic/samples/return.wav
-- Installing /usr/share/opensonic/samples/ring.wav
-- Installing /usr/share/opensonic/samples/ringcount.wav
-- Installing /usr/share/opensonic/samples/ringless.wav
-- Installing /usr/share/opensonic/samples/scratch.wav
-- Installing /usr/share/opensonic/samples/select.wav
-- Installing /usr/share/opensonic/samples/shield.wav
-- Installing /usr/share/opensonic/samples/shot.wav
-- Installing /usr/share/opensonic/samples/spikes.wav
-- Installing /usr/share/opensonic/samples/spin.wav
-- Installing /usr/share/opensonic/samples/spindash1.wav
-- Installing /usr/share/opensonic/samples/spindash2.wav
-- Installing /usr/share/opensonic/samples/spring.wav
-- Installing /usr/share/opensonic/samples/switch.wav
-- Installing /usr/share/opensonic/samples/teleporter.wav
-- Installing /usr/share/opensonic/samples/tfly1.wav
-- Installing /usr/share/opensonic/samples/tfly2.wav
-- Installing /usr/share/opensonic/samples/touch.wav
-- Installing /usr/share/opensonic/samples/touch2.wav
-- Installing /usr/share/opensonic/screenshots
-- Installing /usr/share/opensonic/screenshots/screenshots.txt
-- Installing /usr/share/opensonic/themes
-- Installing /usr/share/opensonic/themes/island.bg
-- Installing /usr/share/opensonic/themes/island.brk
-- Installing /usr/share/opensonic/themes/island2.bg
-- Installing /usr/share/opensonic/themes/island2.brk
-- Installing /usr/share/opensonic/themes/island3.bg
-- Installing /usr/share/opensonic/themes/island3.brk
-- Installing /usr/share/opensonic/themes/ocean.bg
-- Installing /usr/share/opensonic/themes/ocean.brk
-- Installing /usr/share/opensonic/themes/ocean2.bg
-- Installing /usr/share/opensonic/themes/ocean2.brk
-- Installing /usr/share/opensonic/themes/ocean2b.bg
-- Installing /usr/share/opensonic/themes/oceanb.bg
-- Installing /usr/share/opensonic/themes/prototype.bg
-- Installing /usr/share/opensonic/themes/prototype.brk
-- Installing /usr/share/opensonic/languages
-- Installing /usr/share/opensonic/languages/english.lng
-- Installing /usr/share/opensonic/languages/espanol.lng
-- Installing /usr/share/opensonic/languages/francais.lng
-- Installing /usr/share/opensonic/languages/ptbr.lng
Creating files at /usr/bin...
Done! Run opensonic_launcher to start the game. :)

alexandre@pcname:/alex/proj/opensnc/opensonic/trunk$ 
  

If everything worked well, the executables opensonic and opensonic_launcher should be in the GAMEDIR folder.

Note #0: the make install command is optional. You must have root privileges to execute it.
Note #1: if you find errors about the "allegro-config" script, it's recommended that you compile Allegro from the source code yourself.

Compiling on MS Windows - MinGW

If you use MingW, make sure both lib\ and bin\ folders are listed on your PATH. If MinGW is installed on C:\MinGW\, you can use the command set PATH=%PATH%;C:\MinGW\bin;C:\MinGW\lib (on the Command Prompt) to achieve that goal.

On the same Command Prompt, please go to GAMEDIR and follow the example below:

D:\proj\opensonic>cmake -G "MinGW Makefiles" .
-- The C compiler identification is GNU
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
Open Sonic version X.Y.Z
-- Configuring done
-- Generating done
-- Build files have been written to: D:/proj/opensonic

D:\proj\opensonic>mingw32-make
Scanning dependencies of target opensonic
[  4%] Building C object CMakeFiles/opensonic.dir/src/2xsai.obj
[  8%] Building C object CMakeFiles/opensonic.dir/src/actor.obj
[ 12%] Building C object CMakeFiles/opensonic.dir/src/audio.obj
[ 16%] Building C object CMakeFiles/opensonic.dir/src/boss.obj
[ 20%] Building C object CMakeFiles/opensonic.dir/src/brick.obj
[ 25%] Building C object CMakeFiles/opensonic.dir/src/endofdemo.obj
[ 29%] Building C object CMakeFiles/opensonic.dir/src/enemy.obj
[ 33%] Building C object CMakeFiles/opensonic.dir/src/font.obj
[ 37%] Building C object CMakeFiles/opensonic.dir/src/input.obj
[ 41%] Building C object CMakeFiles/opensonic.dir/src/intro.obj
[ 45%] Building C object CMakeFiles/opensonic.dir/src/item.obj
[ 50%] Building C object CMakeFiles/opensonic.dir/src/level.obj
[ 54%] Building C object CMakeFiles/opensonic.dir/src/main.obj
[ 58%] Building C object CMakeFiles/opensonic.dir/src/menu.obj
[ 62%] Building C object CMakeFiles/opensonic.dir/src/player.obj
[ 66%] Building C object CMakeFiles/opensonic.dir/src/quest.obj
[ 70%] Building C object CMakeFiles/opensonic.dir/src/questover.obj
[ 75%] Building C object CMakeFiles/opensonic.dir/src/scene.obj
[ 79%] Building C object CMakeFiles/opensonic.dir/src/screenshot.obj
[ 83%] Building C object CMakeFiles/opensonic.dir/src/sprite.obj
[ 87%] Building C object CMakeFiles/opensonic.dir/src/util.obj
[ 91%] Building C object CMakeFiles/opensonic.dir/src/video.obj
Linking C executable opensonic.exe
[ 91%] Built target opensonic
Scanning dependencies of target opensonic_launcher
[ 95%] Building C object CMakeFiles/opensonic_launcher.dir/src/launcher.obj
[100%] Building C object CMakeFiles/opensonic_launcher.dir/src/lexgui.obj
Linking C executable opensonic_launcher.exe
[100%] Built target opensonic_launcher

D:\proj\opensonic>
  

If everything worked well, the executables opensonic.exe and opensonic_launcher.exe should be in the GAMEDIR folder.

Compiling on MS Windows - Microsoft Visual C++

In this example I'm using Microsoft Visual C++ 2008 Express. A similar approach should work on different versions of MSVC. On my computer, this software is installed at C:\Program Files\Microsoft Visual Studio 9.0\VC\. Make sure the lib\ folder is listed on your PATH. If you're not sure, on a Command Prompt, run set PATH=%PATH%;C:\Program Files\Microsoft Visual Studio 9.0\VC\lib

On the same Command Prompt, please go to GAMEDIR and follow the example below:

D:\proj\opensonic>cmake -G "Visual Studio 9 2008" .
-- Check for working C compiler: cl
-- Check for working C compiler: cl -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
Open Sonic version X.Y.Z
-- Configuring done
-- Generating done
-- Build files have been written to: D:/proj/opensonic

D:\proj\opensonic>
  

Now a Microsoft Visual Studio Solution file should be located on GAMEDIR. Open it, select Release as the Active Configuration and compile. After that you should see both opensonic.exe and opensonic_launcher.exe inside the GAMEDIR\Release folder. Copy them to GAMEDIR.

On different versions of MSVC, you must change the "Visual Studio 9 2008" argument when you run cmake. Type cmake --help on a Command Prompt for more information.

Compiling on Mac OS X

Mac OS X support is experimental. Please read the Compiling on GNU/Linux area (see above) to know how to compile the game. The instructions are the same.

Other compilers/other IDEs

If you want to compile this game using other software, please run cmake --help on a terminal for more information. Using CMake, it's possible to generate the data needed for other compilers. CMake can also generate project files for other popular IDEs like Code::Blocks, KDevelop, etc.

Credits

Open Sonic is written from the ground up in C language and uses the Allegro game programming library for graphics, sounds, player input and timers. It also uses the DUMB and LOGG libraries for music playback, AllegroPNG for .png images, lib2xSaI for improved graphic rendering and lexgui (by Lennart Steinke) for the launcher. This game was originally written by Alexandre Martins, a 20-year-old computer science student at University of Sao Paulo (USP), Brazil. Game development is a such a beautiful and fascinating area, and one can learn a lot while making a game! That's why I love it so much.

Open Sonic is still in development. Currently it uses mostly "ripped" graphics, but we're step-by-step replacing those by original graphics. We also want to use original musics/sound effects. If you feel you can help in anything, please contact us.

Thank you very much for reading. :)