Object Editing - Lavesiime/SonLVL-RSDK GitHub Wiki

One of SonLVL-RSDK's core features is its object editing, used to manage things from rings to monitors to enemies and more. Paired with proper object definitions, objects can be placed, edited, and previewed with useful visualiations and indicators that reflect their in-game behvaiour.

Warning

If all objects are displayed as question marks (?) in the editor, it means their definitions aren't loading correctly. Make sure that you have set up SonLVL-RSDK properly, and that the SonLVLObjDefs folder is in the correct place.
View the setup guide for full instructions.

Example Level Info
Game: Sonic 1
Stage: Green Hill Zone Act 1

Objects Tab Overview

image

The Objects Tab is split into four main sections:

  • The Object Palette, which contains a list of all placable object types and is used to place new objects into the level.
  • The Object Toolbar, which contains useful buttons for aligning objects.
  • The Object Properties/Order Panel, which is used for editing the properties and order of objects.
  • And, of course, the main level view, which displays a view of the level.

Navigating the Level

SonLVL-RSDK offers multiple ways to scroll around and explore the level. These methods are all consistent between the Objects, Foreground, and Background tabs:

  • Scrollbars
    Located underneath and to the right of the level view, there are scrollbars that can be used to move the camera. The bottom scrollbar moves the camera horizontally, while the right scrollbar moves the camera vertically. Each scrollbar's range will automatically change with the current layer size.

  • Mouse Scroll Wheel
    By default, the scroll wheel moves the camera horizontally.

    • Hold Shift to make it move the camera vertically, instead.
    • Hold Ctrl to increase scroll speed.
  • Middle Mouse Button
    Click and hold the middle mouse button (scroll wheel), and then drag the mouse around to pan the camera freely.

  • Arrow Keys
    The arrow keys move the camera in tile-sized (16-pixel) steps, by default.

    • Hold Shift to move in larger, chunk-sized (128-pixel) steps.
    • Hold Ctrl to jump to the edge of the level in the pressed direction.

Tip

Try each navigation method and use whichever one feels the best for you! They all accomplish the same thing, just in different ways!-

Placing Objects

There are several ways to place objects into a level in SonLVL-RSDK. The easiest way to add an object to a level is to simply drag the object from the Object Palette into the level view. This will apply default properties to the object, if applicable.

A gif demonstrating placing Rings into Green Hill Zone 1 by dragging them from the Object Palette and into the level view. Just click and drag 'em over, easy as that!-


Additionally, there are more advanced options to spawn in objects through right clicking anywhere in the level view. Doing so will bring up the Object Context Menu. From here, the two main buttons of focus are the "Add Object..." and the "Add Group of Objects..." buttons. The former spawns a single object at the position clicked, while the latter button will spawn several, evenly spaced objects. Upon pressing either button, the Add Object form will appear, where you can select which object type to spawn in. Depending on the object selected, a set of presets will be presented on the right as well.

image

When spawning a group of objects through "Add Group of Objects...", once the object type is selected, then another form will appear, asking for how many objects to spawn and the spacing between them. The "Columns" value will control how sets of objects to spawn in the horizontal direction (or left to right), while the "X Distance" will control how many pixels should be between each of these columns. On the other hand, the "Rows" value will control how many sets of objects to spawn in the vertical direction (or upwards to downwards). After you set the values you want, pressing OK will spawn in the objects.

Tip

In order to bring up the Add Object menu, you can also double click in the level view to open it immediately! To quickly bring up the Add Group menu, just hold down the Shift key and do the same thing!-

A gif demonstrating usage of the Object Context Menu. First a 1UP Monitor is placed through the Add Objects form, and then a set of three evenly spaced Rings is placed through the Add Group of Objects feature. Just right click to bring up the menu, super handy for placing evenly-spaced Rings!

Object Grid

Additionally, it can be useful to note SonLVL-RSDK's grid feature. It can be used to help in aligning objects, from aligning them with each other to aligning them with chunk borders. The grid can be managed from the Object Toolstrip bar. The "Show Grid" option controls whether the grid is visible, while the "Snap Objects" button controls whether objects should be snapped to the grid when moving them, regardless of whether the grid is visible or not. The size of the grid is controlled by (to no surprise) the "Grid Size" setting, where it can be set to various powers of 2.

Tip

To quickly manage the grid, the K key can be used to toggle snapping objects, and the I key can be used to toggle grid visibility. To change grid size, the number row can be used (2 sets it to 2px, 3 sets it to 4px, etc, and 1 and 0 reset grid size to 1px). The J and M keys can be used to increase/decrease the current grid size respectively, as well.

SonLVL-RSDK_hAKN2yDV47

Modifying Objects

In order to modify objects, the objects must first be selected. Objects can be selected by simply clicking them on the editor. Holding the Control key while clicking on an object will allow selecting multiple objects, instead of resetting the current selection. Alternatively, multiple objects can also be selected by clicking the mouse in an empty area and holding the mouse down, dragging it around to select all objects within an area. To move objects, simply click on a selected object and drag it around by using the mouse.

SonLVL-RSDK_knlm7MUj23


Along with moving them, objects may also have additional properties on the right that can be edited, like the contents of a Monitor or the direction of a Spring. These properties can be edited through the Object Properties panel on the right. Each object has a few fields that are always displayed, regardless of type:

image

  • (EntityPos) - Read only. The index/slot number of this object in the stage. Ranges from 32 (the first object) to 1056 (the last object).
    • Corresponds to Object.EntityNo (RSDKv3) or object.entityPos (RSDKv4) in the object's script.
    • In RSDK, the Entity Pos of objects are often used to "link" objects together, such as a door being in the previous object slot right next to the button that's supposed to open it. See existing stages in your current game for proper examples.
    • The D and C keys can be used to decrease or increase the Entity Pos of all selected objects, respectively.
  • (Name) - Read only. The name of the object.
  • (Script) - Read only. The path of the object's script file, relative to the Data/Scripts/ folder.
  • Position - The position of the object, in pixels. Can be edited for manually entering position values, as opposed to dragging the object around.
    • X - The X component (or horizontal part) of the object's position.
      • Corresponds to Object.XPos (RSDKv3) or object.xpos (RSDKv4) in the object's script.
    • Y - The Y component (or vertical part) of the object's position.
      • Corresponds to Object.YPos (RSDKv3) or object.ypos (RSDKv4) in the object's script.
    • The numpad can be used to move all selected objects in the direction of the key pressed by the current grid size (ie pressing 8 moves the objects upwards, 6 moves objects to the right, 1 moves objects down and to the left, etc).
  • PropertyValue - A general-use number. It's usage varies on a per-object basis.
    • Corresponds to Object.PropertyValue (RSDKv3) or object.propertyValue (RSDKv4) in the object's script.
    • With proper Object Definitions installed, editing an object's Property Value should never be required, as all properties will instead be separately listed and properly named. As such, this field is best used when editing objects without Object Definitions (such as custom objects without proper definitions).
    • The S and X keys can be used to decrease or increase the Property Value of all selected objects, respectively.
  • Type - The numerical type of the object. Clicking on the dropdown will present a menu featuring all object types in the level that you can switch this object to.
    • Corresponds to Object.Type (RSDKv3) or object.type (RSDKv4) in the object's script.
    • The A and Z keys can be used to decrease or increase the Type of all selected objects, respectively.

Additionally, in RSDKv4 levels, there are a set of extra properties that can be edited, under the Advanced Properties dropdown.

Warning

Note that the majority of objects in Sonic 1 and 2 are not programmed to make use of these Advanced Properties. For example, changing a Motobug's Scale will not actually make it appear giant in the level. If an object does use these advanced properties, then they will be shown alongside normal properties with proper Object Definitions installed.

Beyond these basic universal properties, many objects also have unique properties to themselves. From the contents of a Monitor to the length of a Bridge to the behaviour of a Splats badnik, there are many different types of properties that different objects can have. Provided proper Object Definitions are installed, each of these unique properties will be displayed alongside the normal properties in the Object Properties panel. Objects may have any number of these values, from Monitors only having one to Plane Switches having 7. It's worth noting the Description field at the bottom of the Object Properties Panel, which provides a description of the currently highlighted value. For extra, object-specific properties, it may be worth reading this field for explanations of what each of the object's special fields does.

To edit these properties, simply select an object and change its values through the Object Properties Panel. For named lists, double clicking the value name will quickly cycle to the next value, without needing to open or scroll through the drop down.

SonLVL-RSDK_uIYjED6hfX

It's worth noting that many objects throughout Sonic 1, Sonic 2, and Sonic CD have helpful visualisations programmed in the editor. For example, despite all platforms in Green Hill Zone using the same sprite, the editor draws lines that demonstrate not only the direction of each platform, but their movement range as well. In addition, if applicable, object visualisations can change to reflect the object's current properties. For example, Swinging Platforms adjust their visualisation display to show the correct endpoints of its movement based on its current length.

A gif demonstrating placing various Platforms in Green Hill Zone, showcasing the various debug visualisations available for objects. Every platform might look the same, but the lines are here to help!-

Cutting, Copying, and Pasting

SonLVL-RSDK supports copying, pasting, and cutting objects across a scene. To copy objects, select some objects, right click them, and click on Copy. From there, the objects can be pasted as many times as needed through right clicking the level view and pressing Paste. Cutting objects is similar to copying objects, except that it removes the selected objects from the level after they have been copied. In order to cut objects, select the desired objects, right click on them, and select Cut. Pasting them works the same for copied and cut objects.

Tip

As with standard programs, the keyboard shortcuts CTRL+C, CTRL+V, and CTRL+X work for copying, pasting, and cutting objects, respectively.

SonLVL-RSDK_Ynbd4QIbsg

Tip

SonLVL-RSDK supports copy pasting entities different windows, ie you can copy a ring formation from Sonic 2's Hidden Palace Zone into Sonic 1's Marble Zone by having two separate SonLVL-RSDK windows open. However, note that object types may be incorrect and need to be manually fixed, ie in Sonic CD Rings have a type of 8 while in Sonic 2 they have a type of 10.

Demonstration...

A gif demonstrating copying some Rings and a Monitor from Sonic 2's Hill Top Zone into Sonic 1's Green Hill Zone. Copying some objects from Sonic 2's Hill Top Zone into Sonic 1's Green Hill, just like that! They don't really fit the layout, though..

Deleting Objects

In order to delete an object, simply right click it and click on Delete. This can also be done when multiple objects are selected. Alternatively, the Delete key can also be pressed to delete all currently selected objects.

A gif demonstrating deleting various objects from a section in Green Hill Zone. Don't think this really needs a demo, but.. doesn't hurt, right?

Objects Toolbar

The Objects Toolbar is located at the top of the Objects Tab. Alongside the previously mentioned Grid features, it also holds some extra useful buttons for object alignment.

Collision Alignment

The first four buttons are for aligning objects with level collision, for cases such as making sure a Motobug starts on solid ground or having a Grabber hang from the ceiling. These buttons are only enabled if at least one object is selected.

image

By default, these buttons will align objects to Plane A collision. However, if the collision viewer is enabled and set to Plane B (View>Collision>Plane B, or the E key), then the object will be aligned to Plane B collision, instead. The buttons are fairly self-explanatory, but here is a visual demonstration of what each button would do. Let's place a Ring in the center of a loop, like so:

image

From here, the differing outcomes from the different buttons would be as follows:

Align with Left Wall Align with Ground Align with Right Wall Align with Ceiling
image image image image

If multiple objects are selected, each one will be moved individually, instead of moving all of them to the same position. For example, if you wanted to make a trail of rings that followed a slope, then you could use the Add Group of Objects feature to place a set of evenly-spaced rings, use the Align with Ground button to make them all follow the slope, and then use the numpad to make each Ring hover above the ground a little.

A gif demonstrating placing Rings that follow a slope in Green Hill Zone 1. Rings are initially spawned in through the Add Group of Objects form, at which point the Align with Ground button is pressed and each ring snaps to the ground below it, along the slope. From there, the numpad is used to move each ring 16 pixels upwards, so that they lightly hover above the ground. Add in a group of Rings, snap 'em to the ground, use the numpad to move 'em up, and.. ta-da!-

Object Alignment

Along with aligning objects with the ground, SonLVL-RSDK also offers several buttons for aligning objects with each other. These can be useful in cases such as arranging Oil Ocean Zone's Cannons, so that each one perfectly lines up with the next. The left side of the buttons are for aligning objects horizontally, while the right side of the buttons are for aligning objects vertically. These buttons are only enabled if two or more objects are selected.

image

As said before, on the left hand side, the buttons deal with aligning objects horizontally, or X axis-wise.

  • Align Objects' Lefts - Align the left side of each selected object with the leftmost object.
  • Align Objects' Centers - Align each object with the average between the leftmost and rightmost objects' positions.
  • Align Objects' Rights - Align the right side of each selected object with the rightmost object.

For example, take this set of Rings:

image

Here are the effects that each of these buttons would have, when these Rings are selected:

Align Objects' Lefts Align Objects' Centers Align Objects' Rights
image image image

On the left hand side of the Objects Toolstrip, the buttons located there deal with aligning objects vertically, or Y axis-wise.

  • Align Objects' Tops - Align the top of each selected object with the highest object.
  • Align Objects' Middles - Align each object with the average between the highest and lowest objects' positions.
  • Align Objects' Bottoms - Align the bottom of each selected object with the lowest object.

Once again, using the previous example of a row of Rings, here are the effects that each of these buttons would have:

Align Objects' Tops Align Objects' Middles Align Objects' Bottoms
image image image

Edit Menu

Located above the Objects Toolbar, inside the general Edit menu at the top of the SonLVL-RSDK window, there are some extra features worth noting. Alongside the Undo and Redo buttons, there are also the Go To and Find buttons.

Go To...

The Go To shortcut allows you to instantly move the camera to either a certain position, or to focus on a given Entity Pos. The shortcut to bringing up this menu is CTRL+G.

image

Find...

The Find button allows you to search the entire stage for objects of a certain type. Once the form is closed with the Find button, the camera will focus on the first found entity. The next found entity can be focused on with the Find Next button, while the previous entity can be returned to with the Find Previous shortcut.

image

Alternatively, instead of searching for objects one-by-one, the Select All button on the form can be selected in order to select all objects in the stage that meet the current criteria. Doing so will tell you how many objects have been found, as well.

A gif demonstrating the Select All feature. The Find form is opened, and set to search for Rings, revealing 165 Rings in Green Hill Zone 1. Each Ring is selected, and then promptly deleted. Ever felt like seeing how many Rings are in GHZ1 and then felt like deleting them all?

View Menu

Next to the Edit menu, along the top bar of SonLVL-RSDK, the View menu is located. The View menu features many items that could be useful when editing a level.

Objects above high plane

By default, SonLVL-RSDK renders objects between "low" and "high" plane tiles, as evidenced by Rings and Monitors drawing behind certain trees in Green Hill Zone. However, in many cases, this may lead to objects being completely obscured by level terrain. If you wish to have objects rendered on top of all level tiles, then checking this option will do just that. The keyboard shortcut for toggling this on-the-fly is simply T.

Objects below high plane (default) Objects above high plane

An image showing the default level view. It appears to just be a few trees with a line of Rings next to them.
Just an unsuspecting line of Rings..

The same image as before, but with the Objects Above High Plane setting toggled on, revealing an Invincibility Monitor and Red Spring hiding in the trees.
Oh! Turns out there's a Monitor and a Spring hiding in the trees, too!

HUD

SonLVL-RSDK's HUD differs between every tab. In the Objects tab, it displays:

  • The screen's current position, in pixels.
  • The size of the foreground, in pixels.
  • And, the number of objects in the current stage, as well as the total number of objects allowed. By default, the cap is 1024 objects.

The HUD option in the View menu can be used to toggle the HUD on and off. The keyboard shortcut to do this is simply O.

image

Background Colour...

The background colour can either be a colour from a fixed palette index, or it can be a constant colour that remains the same regardless of the current stage's palette. By default, the background colour for the level view is the 160th colour in the level palette.

image

Grid Colour...

This option can be used to change the colour of the grid that appears when the Show Grid option is enabled.

Layers

The Layers menu can be used to toggle visibility of the high and low tile layers. This can be used to edit objects without having any of the foreground tiles visible at all, if desired. The following is a graph of all different possibilities, with the Objects above high plane option set to false:

High Layer Enabled High Layer Disabled
Low Layer Enabled image image
Low Layer Disabled image image

Y: Toggle low plane visibility
U: Toggle high plane visibility

Collision

The Collision menu can be used to preview the collision of the level, for both Plane A as well as Plane B. The collision colours are as follows:

  • Black: All solid
  • White: Top solid
  • Yellow: Left/Right/Bottom Solid
  • Red: Top solid (No Grip)

If a tile has no collision, then nothing extra will be drawn on top of it. As previously noted, this can be used to make the Collision Alignment buttons align objects with Plane B collision rather than Plane A collision.

None Plane A Plane B
image image image

Zoom

Self-explanatory, the Zoom feature zooms in and out the level view.

Usage Counts

The Usage Counts button brings up a helpful form that shows how many of each object is in the current level, as well as how many are in the entire stage folder as a whole. This can be used to see things such as seeing if the level has enough Checkpoints, or tracking Rings counts of a stage.

A picture of the Usage Counts window, demonstrating the most used objects in Green Hill Zone 1.
The most-used items in Green Hill Zone Act 1.

Adding New Object Types

In order to introduce new object types into the zone, whether they be objects from other zones or completely custom objects, the object type must be added to the stage's object list, first. This is done through the Object List section located within the Settings Tab. Simply press the Add button, and enter your object's script path and name. The Browse... button can be used to select the object's script path from a list of all object scripts in the game instead of manually typing out the object's script path. However, do note that the object's name will still need to be entered manually - this name should match what the object is called in other zones, or else the object may not function properly. For custom objects, this is the object's TypeName[]. Once entered, you can return to the Objects tab, at which point the object will be at the bottom of the Object Palette and ready to be placed!

image

Demonstration...

A gif demonstrating adding new object types to stages. This example features adding Marble Zone's fireballs into Green Hill Zone. Adding Marble Zone's fireballs into Green Hill..

Extra Tips

  • Don't forget that SonLVL-RSDK supports undoing (and redoing) changes, so if you accidentally misplace an object or delete something you didn't want to, don't worry! Just press Edit>Undo (CTRL+Z), and the level will go right back to how it was before!
    • However, do note that in levels with large amounts of complex objects, undo may take a moment sometimes.. apologies!-
  • When editing stages, pressing the Play... button under the File menu (or just pressing the F5 key) will start the game directly to the stage currently opened in SonLVL-RSDK, as opposed to the Title Screen or Save Select menu. Use this frequently to get a feel for how your level plays!
Keyboard Shortcut Reference List...
  • Basics:
    • CTRL+S: Save
    • CTRL+Z: Undo
    • CTRL+Z: Redo
    • O: Toggle HUD
  • Level Navigation:
    • Arrow keys: Move the camera by 16 pixels
      • Hold Shift: Move in steps of 128 pixels
      • Hold Ctrl: Jump to the edge of the level in the pressed direction
    • CTRL+F: Find Objects
      • F3: Find next object
      • Shift+F3: Find previous object
    • CTRL+G: Go To...
  • Collision view:
    • Q: Disable collision view
    • W: View collision for Path A
    • E: View collision for Path B
    • R: Toggle collision angle view
  • Layer view:
    • Y: Toggle low plane visibility
    • U: Toggle low plane visibility
  • Grid:
    • I: Toggle grid visibility
    • K: Toggle snapping objects to the grid
    • J: Increase grid size
    • M: Decrease grid size
    • Number row: Set grid size:
      • 1/0: Reset grid size to 1px
      • 2: Set grid size to 2px
      • 3: Set grid size to 4px
      • 4: Set grid size to 8px
      • 5: Set grid size to 16px
      • 6: Set grid size to 32px
      • 7: Set grid size to 64px
      • 8: Set grid size to 128px
      • 9: Set grid size to 256px
  • Zoom:
    • -: Zoom out.
    • +: Zoom in.
  • Objects:
    • Double click: Create a new object
      • Hold Shift: Create a new group of objects
    • T: Toggle objects above high plane
    • Ctrl+V: Paste objects from clipboard
    • When objects are selected:
      • A: Decrease Type of all selected objects
      • Z: Increase Type of all selected objects
      • S: Decrease Property Value of all selected objects
      • X: Increase Property Value of all selected objects
      • D: Decrease Entity Pos of all selected objects
      • C: Increase Entity Pos of all selected objects
      • Delete: Delete selected objects
      • Ctrl+X: Cut selected objects
      • Ctrl+C: Copy selected objects

Related Pages

  • Layer Editing (imaginary link to page) - How to modify the chunk layouts of levels in the Foreground and Background tabs.
  • Object Definitions - How to write new object definitions, for adding custom objects to the editor.
⚠️ **GitHub.com Fallback** ⚠️