Difference between revisions of "How to make a level"

From Open Surge Engine Wiki
Jump to: navigation, search
m (Making your level)
m (Level Files)
Line 11: Line 11:
 
Levels are plain text files with a few instructions written on it. They are .lev files stored in the '''levels/''' folder¹.
 
Levels are plain text files with a few instructions written on it. They are .lev files stored in the '''levels/''' folder¹.
  
To begin our tutorial, please open file levels/base.lev using a simple text editor like Notepad or gedit. You'll see something like this:
+
To begin our tutorial, please open file levels/empty.lev using a simple text editor like Notepad. You'll see something like this:
  
 
  // ...
 
  // ...
Line 22: Line 22:
 
  requires "0.5.0"
 
  requires "0.5.0"
 
  act 1
 
  act 1
  theme "themes/template.brk"
+
  theme "themes/waterworks.brk"
 
  bgtheme "themes/template.bg"
 
  bgtheme "themes/template.bg"
  spawn_point 210 9910
+
  spawn_point 128 9920
 
  music "musics/template.ogg"
 
  music "musics/template.ogg"
  startup ".default_startup"
+
  setup "Default Setup"
  players "Surge" "Neon" "Charge"
+
  players "Surge" "Neon"
 +
 +
// bricks
 +
brick 17 0 9856
 +
brick 16 128 9856
 +
brick 16 256 9856
 +
brick 18 384 9856
 +
 +
// entities
 +
entity "Goal" 448 9952 "d9b763b8ab9ce028"
 +
entity "Powerup Lucky Bonus" 32 9952 "d9e6b5cb0626d3e8"
 
   
 
   
 
  // ...
 
  // ...
Line 49: Line 59:
 
* you might also use the Unix installation folder (e.g., /usr/local/share/games/opensurge)
 
* you might also use the Unix installation folder (e.g., /usr/local/share/games/opensurge)
  
² 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 '''levels/''' folder, you should type "hello.lev" instead of hello.lev. Make sure to save it on the '''levels/''' folder!
+
² 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 '''levels/''' folder, you should type "hello.lev" instead of hello.lev. Make sure to save it to the '''levels/''' folder!
  
 
== The Editor ==
 
== The Editor ==

Revision as of 01:07, 29 August 2019

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

Getting started

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

This is a quick practical introduction to the built-in Level Editor. You'll be able to make your own level in just a few minutes, but only with basic features like simple platforms and items. Advanced topics like custom scenery and bosses will be covered later.

Welcome to the Level Editor!

Level Files

Levels are plain text files with a few instructions written on it. They are .lev files stored in the levels/ folder¹.

To begin our tutorial, please open file levels/empty.lev using a simple text editor like Notepad. You'll see something like this:

// ...

// header
name "Empty Level"
author "YOUR_NAME_HERE"
license "CC-BY 3.0"
version "1.0"
requires "0.5.0"
act 1
theme "themes/waterworks.brk"
bgtheme "themes/template.bg"
spawn_point 128 9920
music "musics/template.ogg"
setup "Default Setup"
players "Surge" "Neon"

// bricks
brick 17 0 9856
brick 16 128 9856
brick 16 256 9856
brick 18 384 9856

// entities
entity "Goal" 448 9952 "d9b763b8ab9ce028"
entity "Powerup Lucky Bonus" 32 9952 "d9e6b5cb0626d3e8"

// ...

Save a copy of the file to levels/hello.lev².

Additionally, change the name of the level from "Empty Level" to "Hello".


¹ Where is levels/? On Microsoft Windows, the levels/ folder is stored in the game directory:

  • it's the same place where Open Surge (the executable) is located
  • so you open the game directory and find the levels/ folder there

On Linux, it may be (you can use any of these places):

  • in the game directory (if you installed opensurge somewhere inside your home)
  • in the installation directory (if you made a system-wide installation - for example, /usr/local/share/games/opensurge/)
  • in $XDG_DATA_HOME/opensurge2d/opensurge/ (usually, this is ~/.local/share/opensurge2d/opensurge/)

On MacOSX, the folder can be found:

  • in the game bundle (inside Contents/Resources/)
  • in ~/Library/opensurge2d/opensurge/
  • you might also use the Unix installation folder (e.g., /usr/local/share/games/opensurge)

² 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 levels/ folder, you should type "hello.lev" instead of hello.lev. Make sure to save it to the levels/ folder!

The Editor

Starting the Editor

Go to the Stage Selection screen (at the options menu) and choose the "Hello" level. After the level loads, press the F12 key to enter the level editor (remember to disable fullscreen, so you can easily follow this tutorial). If "Hello" doesn't show up in the list, check your .lev file. Please go back to the previous section and try again.

S033.png S034.png S035.png

Tip: you can edit almost every level by pressing F12 during the game. If you're editing an official level (the levels that come with the game), please do *not* save your changes, as this operation is irreversible!

Edit modes

The Level Editor

The editor has three edit modes: brick mode, built-in item mode and custom object mode. Basically a brick is a reusable scenario piece; a built-in item is something like a life box or a checkpoint; and a custom object is something made via scripting, like an enemy or a boss (these are covered later).

To play with the Level Editor, use the mouse to place objects on the screen and the directional arrow keys to move the camera.

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

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

  • brick 17 - you're in brick mode, and 17 is the ID of the current brick (it's an internal identification number);
  • type: OBSTACLE - the type of the brick, specifying its solidity. This is covered in Bricksets;
  • behavior: DEFAULT - the brick behavior. This is covered in Bricksets;
  • size: 128x64 - the dimensions (width x height) of the brick, in pixels;
  • zindex: 0.50 - the zindex of the brick. This is covered in Bricksets.

Tip: in the editor, press F1 to see a table containing all commands you need to make a level.

Making your level

This is where creativity comes in. Now you should make your level by placing bricks and other objects on the screen. When you're done, press Ctrl+F12 to save your level.

For tips on how to create amazing levels, read our Level Design Document.

Congratulations!

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, please read Introduction to Modding.

Thank you for reading!

A challenge

Open themes/ folder and look for files with the .bg extension. These are level Backgrounds that are ready to be used in Open Surge. Pick one of them and replace the bgtheme attribute of the levels/hello.lev file. See what happens!