Difference between revisions of "How to make a level"

From Open Surge Engine Wiki
Jump to: navigation, search
m (Make your level)
m (Updated link)
(35 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Introduction ==
+
== Getting started ==
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.
+
=== Overview ===
 +
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.1, but the topics covered here can be applied on newer 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.
+
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, new characters, scripting and bosses will be covered later.
  
[[File:S045.png]]
+
'''NOTE:''' when making a game with Open Surge, you should use its latest '''stable release''', which can be found at [http://opensurge2d.org opensurge2d.org]. Do not use the development builds, unless you're an advanced user and have a specific reason to do so.
  
== Getting started ==
+
[[File:Editor050.png|852px|thumb|left|Welcome to the Level Editor!]]<br clear="all">
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
+
=== Level Files ===
  name "Hello"
+
Levels are plain text files with a few instructions written on it. They are .lev files stored in the '''levels/''' folder¹.
  author "your name here"
+
 
 +
To begin our tutorial, 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"
 
  version "1.0"
  requires 0.2.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"
grouptheme "themes/template.grp"
+
  spawn_point 128 9920
  spawn_point 64 5068
+
 
  music "musics/template.ogg"
 
  music "musics/template.ogg"
 +
setup "Default Setup"
 +
players "Surge" "Neon"
 
   
 
   
  // 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-win32bin0.2.0''. That's your '''GAME_FOLDER'''. That's where ''opensurge.exe'' lives in.
+
Save a copy of the file to '''levels/hello.lev'''.
  
Save the text you have just created to '''GAME_FOLDER'''/levels/hello.lev
+
Additionally, change the '''name''' field from "Empty Level" to "Hello".
  
'''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
+
'''Windows users:''' if you're using Notepad, you must double quote the filename, so the program won't save your file as hello.lev.txt. You must type "hello.lev" instead of hello.lev. Make sure to save it to the '''levels/''' folder!
  
[[File:Hello.png]]
+
----
  
[[File:Saveas.png]]
+
[[File:Levelsfolder.png|384px|thumb|right|An example: .lev files in the levels/ folder. Your actual setup may vary.]]
  
== The Level Editor ==
+
¹ Where is the '''levels/''' folder? On Microsoft Windows, '''levels/''' is stored in the game directory:
 +
* it's the same place where Open Surge (the executable) is located
 +
* 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)
 +
** usually, this is /usr/share/games/opensurge/
 +
** this is a read-only directory! To save a new file, see below
 +
* in $XDG_DATA_HOME/opensurge2d/opensurge/ (this is read-write)
 +
** usually, this is ~/.local/share/opensurge2d/opensurge/
 +
** using Flatpak? find '''levels/''' at ~/.var/app/org.opensurge2d.OpenSurge/data/opensurge2d/opensurge
 +
** using Snap? find '''levels/''' at ~/snap/opensurge/current/.local/share/opensurge2d
 +
*** note: other user-space files (e.g., settings & screenshots) are found at ~/snap/opensurge/current/.config/opensurge2d and ~/snap/opensurge/common/.cache/opensurge2d
 +
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/share/games/opensurge)
  
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.
+
<br clear="all">
  
[[File:S033.png]]
+
== The Editor ==
 +
=== Opening 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.
  
[[File:S034.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!
  
[[File:S035.png]]
+
[[File:Options1.png|426px|thumb|left|Main menu: selecting Options]]
  
[[File:S038.png]]
+
[[File:Options2.png|426px|thumb|left|Options screen: entering the Stage select]]
  
'''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!
+
[[File:Stageselect.png|426px|thumb|left|Stage select: choosing the Hello level]]
 +
<br clear="all">
  
Press F12 if you haven't already.
+
=== Basic usage ===
 +
The editor basically works with two types of elements: bricks and entities. Basically a brick is a reusable scenario piece. An entity is something that you can put in your level, such as: a spring, a collectible or a baddie. Entities are created with [http://docs.opensurge2d.org SurgeScript] (scripting for games; this is covered later).
  
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.
+
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, press 1 to open the brick palette or 2 to open the entity palette. Choose the item you want to place on the level and have fun!
  
How do you use the Level Editor? 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.
+
'''Tip:''' press F1 to see a table containing all commands you need to make a level.
  
'''Note:''' the picture below shows the help screen at the time of this writing
+
'''Note:''' when placing a brick on the level, you'll see many properties on the top bar of the editor (such as: type, behavior, size, etc.). These are covered in [[Bricksets]].
[[File:S047.png]]
+
  
Note that text on the left-top corner of the screen. What does it mean?
+
[[File:Editorpalette0.png|512px|thumb|left|Brick palette]]
* '''brick 0''' - you're in brick mode, and 0 is the ID of the current brick (it's an internal identification number)
+
[[File:Editorpalette2.png|512px|thumb|right|Entity palette]]
* '''angle: 0''' - tells us that the angle of this brick is 0 degrees (useful for slopes & loops - this will be explained later)
+
<br clear="all">
* '''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.
+
== Creating your level ==
  
[[File:S041.png]]
+
=== Enjoy creating! ===
  
== Make your level ==
+
This is where creativity comes in. Now you should make your level by placing bricks and entities on the screen. When you're done, press Ctrl+S to save 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:
+
For tips on how to create amazing levels, read our [[Level Design Document]].
* 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.
+
 
+
[[File:S046.png]]
+
  
 
'''Congratulations! '''
 
'''Congratulations! '''
  
You have created your first level! If you have any questions, feel free to ask on the [http://opensnc.sourceforge.net/forum community forums]. Thank you for reading!
+
You have created your first level! Level editing, however, is just the tip of the iceberg.
 +
 
 +
Open Surge is a '''full game engine''' that allows you to create many types of 2D games, including: platformers, shooting & racing games, arcades, and so on. You can really go wild with your creativity and build up anything. In order to continue your studies, go to [[Introduction to Modding]].
 +
 
 +
If you have any questions, feel free to ask on the [http://forum.opensurge2d.org/ community forums].
 +
 
 +
=== A challenge ===
  
'''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''' field of the levels/hello.lev file. See what happens!
  
Change the bgtheme value of hello.lev to '''"themes/desert1.bg"'''. By doing this, you'll be replacing that blue background by a very nice desert background.
+
[[File:Editoramazing.png|852px|thumb|left|Create amazing things!]]<br clear="all">
  
 
[[Category:Users]]
 
[[Category:Users]]
[[Category:Level development]]
+
[[Category:Level design]]

Revision as of 18:38, 23 November 2020

Getting started

Overview

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.1, 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, new characters, scripting and bosses will be covered later.

NOTE: when making a game with Open Surge, you should use its latest stable release, which can be found at opensurge2d.org. Do not use the development builds, unless you're an advanced user and have a specific reason to do so.

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, 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"

// ...

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

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

Windows users: if you're using Notepad, you must double quote the filename, so the program won't save your file as hello.lev.txt. You must type "hello.lev" instead of hello.lev. Make sure to save it to the levels/ folder!


An example: .lev files in the levels/ folder. Your actual setup may vary.

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

  • it's the same place where Open Surge (the executable) is located
  • 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)
    • usually, this is /usr/share/games/opensurge/
    • this is a read-only directory! To save a new file, see below
  • in $XDG_DATA_HOME/opensurge2d/opensurge/ (this is read-write)
    • usually, this is ~/.local/share/opensurge2d/opensurge/
    • using Flatpak? find levels/ at ~/.var/app/org.opensurge2d.OpenSurge/data/opensurge2d/opensurge
    • using Snap? find levels/ at ~/snap/opensurge/current/.local/share/opensurge2d
      • note: other user-space files (e.g., settings & screenshots) are found at ~/snap/opensurge/current/.config/opensurge2d and ~/snap/opensurge/common/.cache/opensurge2d

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/share/games/opensurge)


The Editor

Opening 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.

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!

Main menu: selecting Options
Options screen: entering the Stage select
Stage select: choosing the Hello level


Basic usage

The editor basically works with two types of elements: bricks and entities. Basically a brick is a reusable scenario piece. An entity is something that you can put in your level, such as: a spring, a collectible or a baddie. Entities are created with SurgeScript (scripting for games; this is 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, press 1 to open the brick palette or 2 to open the entity palette. Choose the item you want to place on the level and have fun!

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

Note: when placing a brick on the level, you'll see many properties on the top bar of the editor (such as: type, behavior, size, etc.). These are covered in Bricksets.

Brick palette
Entity palette


Creating your level

Enjoy creating!

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

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

Congratulations!

You have created your first level! Level editing, however, is just the tip of the iceberg.

Open Surge is a full game engine that allows you to create many types of 2D games, including: platformers, shooting & racing games, arcades, and so on. You can really go wild with your creativity and build up anything. In order to continue your studies, go to Introduction to Modding.

If you have any questions, feel free to ask on the community forums.

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 field of the levels/hello.lev file. See what happens!

Create amazing things!