Topic: How to use the Level Editor - Part I
How to use the Level Editor - Part I
Initial release: 2009-02-06
Last update: 2009-09-13
0. Introduction
This tutorial explains how to make a basic level on the Open Sonic Level Editor. At the time of this writing, the latest version of the game is 0.1.0, but the topics covered here can be applied on new versions as well.
This is a quick pratical introduction to the Level Editor (learn-by-doing). You'll be able to make your own level in just a few minutes, but only with basic features like simple platforms, enemies and items. Advanced topics like custom graphical themes, slopes and loops will be covered later.

1. Getting started
Before we begin, you ***must*** download the Example level located here. We'll use the graphical theme of that level because it's simple and easy to get started. It doesn't come bundled with the game, so you need to download it now if you haven't done it already.
A level is a plain text file with a few instructions written on it. Open a simple text editor. If you're on Windows, the Notepad program will do the trick. Type the following:
# My first level
name Hello
author YOUR_NAME_HERE
version 1.0
requires 0.1.0
act 1
theme themes/example.brk
bgtheme themes/example.bg
spawn_point 64 5068
music musics/example.it
# brick list
brick 26 0 5095Since this is a pratical tutorial, I'll not get into details now, but you can guess what most of these options do. For simplicity, let's call GAMEDIR the directory where Open Sonic is installed. For example, if the game is located at C:\Users\username\Documents\opensnc-win32bin0.1.0\opensonic.exe, then GAMEDIR means C:\Users\username\Documents\opensnc-win32bin0.1.0\. The procedure is similar on Linux.
If you've installed the Example level correctly, the following files must exist:
GAMEDIR/themes/example.brk (brick theme)
GAMEDIR/themes/example.bg (background theme)
GAMEDIR/musics/example.it (music)
GAMEDIR/images/example.png (level graphics)
Save the text you have just typed to GAMEDIR/levels/hello.lev
Tip: if you're using Notepad (Windows), you must double quote the filename, so the program won't save your file as hello.lev.txt . For example, if you're on the GAMEDIR\level folder, you could type "hello.lev" instead of hello.lev
NOTE: Open Sonic is able to play the following music formats: .ogg , .mod , .it , .xm , .s3m


2. The Level Editor
Run the opensonic_launcher program, set the display mode to "Windowed" and check the option "Play a custom level". Choose the hello.lev file you've just created and click on the "Play!" button. After the game starts, press the F12 key to enter the level editor.
If hello.lev doesn't show up in the list, you probably did something wrong. Please go back to the previous section and try again.

Tip: you can edit almost every Open Sonic level by pressing F12 during the game. If you're editing an official level (these levels come with the game), please do *not* save your changes, as this operation is irreversible!
The level editor 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. On the table below, an 'object' may be a brick, an item or an enemy, depending on the current edit mode.
Key => Function
-----------------
Arrow keys => Move the camera
Ctrl+Arrow keys => Move the camera (faster)
B / N => Select the previous/next object
Ctrl+B / Ctrl+N => Previous/next edit mode
F12 => Quit the editor
Ctrl+F12 => Save & quit
Left mouse button => Put the selected object under the mouse cursor
Middle mouse button => Pick the object that is under the mouse cursor
Right mouse button => Delete the object that is under the mouse cursor
Ctrl + Left mouse button => Change the spawn pointNow you should choose the brick mode. When you do, you will see something like "Current category: brick". Press the N key to select the next brick. Now you should see "Current brick: 001 (ang:0,prp:0,bh:0)". But what does it mean?
'001' is the ID of the brick: it's an internal number.
ang:0 tells us that the angle of this brick is 0 degrees (useful for slopes & loops - this will be explained later)
prp:0 is the property of this brick. At the time of this writing, a brick can be either PASSABLE (prp:0) or an OBSTACLE (prp:1). Bricks that are passable are just decorative; bricks that are obstacles can be considered as platforms for now.
bh:0 is the brick behavior. This will be covered later.

3. Make your level
This is where creativity comes in. Now you should make your level by placing objects on the screen. A good guide to follow is:
add the bricks
insert the items
finally, add the enemies
When adding bricks to the level, make sure to see if the brick you're considering is displayed as prp:0 (PASSABLE) or prp:1 (OBSTACLE).
Do *not* try to insert the "LOOP" items at this time. If you do, "strange" things may happen on your level, like your character being able to get inside the walls and so. Loops and slopes will be explained later, as they require a little more theory to be understood.
When you're done, press Ctrl+F12 to save your level.

Congratulations! ![]()
You have made your first Open Sonic level! If you have any questions, please let me know. Thank you very much for reading.
Last edited by Alexandre (2009-09-13 14:09:32)

