How to make a level

From Open Surge Engine Wiki
Revision as of 23:34, 11 June 2013 by MatheusRRR (Talk | contribs)

Jump to: navigation, search
Languages: Bahasa IndonesiaČeštinaDeutschEnglishEspañolFrançaisItalianoNederlandsPolskiPortuguêsРусский


This tutorial explains how to make a basic level using the Level Editor. At the time of this writing, the latest version of the game is 0.2.0, but the topics covered here can be applied on new versions as well.

This is a quick practical introduction to the Level Editor. 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, bosses and loops will be covered later.


Getting started

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 level
name "Hello"
author "your name here"
version "1.0"
requires 0.2.0
act 1
theme "themes/template.brk"
bgtheme "themes/"
grouptheme "themes/template.grp"
spawn_point 64 5068
music "musics/template.ogg"

// brick list
brick 44 0 5104
brick 44 64 5104
brick 44 128 5104

The game is located somewhere on your hard-drive, depending on where you have extracted it. Let's give a name to this location: GAME_FOLDER. Example: if you're on Windows, you could have extracted it to C:\Users\username\Documents\opensurge. If you have, that's your GAME_FOLDER. That must be the place where opensurge.exe lives in.

Save the text you have just created to GAME_FOLDER/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 GAME_FOLDER\level folder, you should type "hello.lev" instead of hello.lev



The Level Editor

Go to the Stage Selection screen (at the options menu) and choose the "Hello" level. After the game starts, press the F12 key to enter the level editor (optionally, disable fullscreen, so you can easily follow this tutorial). If "Hello" 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 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!

Press F12 if you haven't already.

The level editor has three edit modes: brick mode, built-in item mode and custom object mode. Basically a brick is a background object or a platform; a built-in item is something like a ring, a life box or a checkpoint; and a custom object is something made by users via scripting (to be covered later), like an enemy or a boss.

How do you use the Level Editor? It's simple! In the Level Editor, press F1, and you'll see a table containing all commands you need to make a level. Basically you use the mouse to place objects on the screen and the directional arrow keys to move the camera.

Note: the picture below shows the help screen at the time of this writing


Note that text on the left-top corner of the screen. What does it mean?

  • brick 0 - you're in brick mode, and 0 is the ID of the current brick (it's an internal identification number)
  • angle: 0 - tells us that the angle of this brick is 0 degrees (useful for slopes & loops - this will be explained later)
  • size: 32x16 - the dimensions (width x height) of this brick, in pixels
  • property: OBSTACLE - OBSTACLE is the property of this brick. At the time of this writing, a brick can be PASSABLE, OBSTACLE or CLOUD. Bricks that are passable are just decorative; bricks that are obstacles can be considered as platforms, walls or ceilings for now. On the other hand, clouds are other types of platforms also known as "one-way/jump-through platforms".
  • behavior: DEFAULT - this is the brick behavior. It will be covered later.
  • zindex: 0.50 - the depth of this brick (a number between 0.0 and 1.0). This will be covered later.

Now you should choose the brick mode (Ctrl+N, Ctrl+B or Ctrl+Mouse wheel). Choose the bricks you want by pressing N, B or using the mouse wheel.


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 (use Ctrl+N to change the edit mode)
  • finally, add the enemies

When you're done, press Ctrl+F12 to save your level.



You have created your first level! If you have any questions, feel free to ask on the community forums.

In order to continue your studies, read Introduction to Modding.

Thank you for reading!


Change the bgtheme value of hello.lev to "themes/" and see what happens.