Moondust Editor

The PGE Editor is the main development system which allows the creation and editing of levels, worlds and custom game configurations. It can currently create levels compatible with the classic SMBX64 standard, as well as the new PGE format. The editor fully supports all old SMBX formats, and can function as a more advanced alternative to the original SMBX Editor.

History
The Editor project started as a part of Wohlstand's SMBX Research Works, which was started for the purpose of creating a new SMBX engine which is compatible with the old SMBX, but is more flexible and universal, in order to continue the progress of SMBX and give more potential for making other games.

The PGE Editor was conceived as a more flexible and more advanced editor than the original SMBX default editor, and aims to solve lots of the issues and inconveniences of the default SMBX editor. The editor's most notable features is a multi-document interface (MDI) which is able to have multiple files open at once.

Development of the editor started in March 24th, 2014, when Wohlstand presented a first sketch of the editor which was the beginning of the PGE Project. This dummy application was only able to parse and validate the original SMBX .LVL file format. Later, Wohlstand implemented the function to displaying level contents, however without graphics. Starting from version 0.0.5-alpha, the editor was able to export whole sections of levels and areas into images. Before NPC displaying was fully implemented, all NPC's were shown as a "ghost" dummy image. In April 28th, 2014, Kevsoft joined the PGE Project, and shortly afterward, version 0.0.7-Alpha was released. This version could correctly render backgrounds, blocks and background objects (BGOs).

The first fully-featured version with file reading/writing ability, history manager, and full support of NPC rendering was 0.0.8-Alpha, which was released in July 13th, 2014.

In October 20th of 2014, after a long time of development, the first stable and fully-featured build of the editor was released with the ability to read/write levels, worlds and interactive NPC editor files etc. This version had a multi-configuration system which allowed the use of different content packages without needing to overwrite existing content files.

Now, the editor has all the basic features, as well as some additional features which will be necessary and helpful in creating and editing levels, world maps and configuring custom NPC's more conveniently.

Interface
The editor has a MDI with dock widgets and a toolbar with additional icons. Here are two modes of MDI:
 * Tab view, a modern and flexible MDI. All opened files are available via special tabs which you can use to quickly switch between them. Highly recommended for small screens.
 * Sub windows view, the "classic" look, which is more like the original SMBX editor interface. You have a space with included sub-windows inside them. Use it if you prefer the design of the original SMBX editor..

Supported files
List of file formats supported by the editor:
 * LVLX - Extended Level File, uses the PGE-X data format.
 * WLDX - Extended World map File, uses the PGE-X data format.
 * LVL - SMBX 1.0 – 1.3 (SMBX1 – 64) or SMBX-38A Level File Format, internal format of the SMBX game engine.
 * WLD - SMBX 1.0 – 1.3 (SMBX1 – 64) or SMBX-38A World Map File Format, internal format of the SMBX game engine.
 * SAV - SMBX 1.0 – 1.3 (SMBX1 – 64) Game Save Format, internal format of the SMBX game engine.

Configuration packages
Editor uses content configuration packages which have difference sets of graphics, musics, sounds, configured items and default editor settings. To take able use PGE Editor you should install even one configuration package.

Configuration Status
This is a special dialog which show you current state of loaded configuration package. To open it, open the Tools/Global Configuration menu and select the "Configuration status" menuitem.

Reloading of configuration
If you was changed something in the configuration package, you can reload them without restarting of editor application. To reload configuration package, open the Tools/Global Configuration menu and select the "Reload configuration" menuitem. After you should reload all opened files to get able see a new changes of configuration package.

Sections
Each level is devided into sections - separate areas which can have different completely different properties: different background, music, physical environment, size, etc. Sections can be added and switched between via the tool-bar by clicking on the numbers.

You can see a compass icon which lets you return back to the bottom-left corner of current the section. This is useful if you are lost in a huge section. All properties of the current section is available in the special Section Properties toolbox which you can open via the tool-bar icon or in the View menu.

In the section properties toolbox you can change special flags, change music, choose custom music from a file file in the interactive mode, change the background of a section and resize the section. When you press the "Resize" button, you will see a big green rectangle which is an interactive resizer: you can move it, you can drag it's sides and you can crop parts by using the context menu. When you're done resizing you can press the Enter key to accept the changes, or Escape to cancel resizing. You can also see special icons in the tool-bar which you can use for the same purposes.

Items
Items editing is available by multi-selecting items and using the context menu in order to change their settings.

The editor allows you to place items in different modes:
 * Brush placement - Default mode. You place items by clicking and moving the mouse. Placement mode of player start points, warp points, default Blocks, BGO's and NPC's.
 * Rectangle draw - Placement mode of sizable blocks, the physical environment (eg. water, quicksand). You can also use them to place a group of items in a rectangle, which is faster than using the brush placement mode. Also available for Blocks and BGOs.
 * Circle draw - Additional placing mode which gives the ability to place a group of items in a circle. Also available for Blocks and for BGO.
 * Line draw - Additional placement mode which lets you draw lines of items. Useful for drawing slopes. Available for Blocks, BGO's and NPC's.
 * Flood fill - Additional placement mode which fills closed areas of any shape. If the area is not properly sealed off, don't worry; the filling process will be aborted after a three seconds timeout to prevent the editor from freezing, and to prevent a memory overflow. Also you can enable a special flag which enables a limit on the flood fill process, with section boundaries.
 * Overwrite mode - Additional placement mode which lets you overwrite items you've already placed, by drawing over them with an item of your choosing.

When you're working in selection mode, you're able select multiple items which you can move into another place, copy, paste or remove.

A context menu is available, which gives access to the properties of each item. If you open the properties dialog with a selected item group, you are also able to overwrite the properties of all selected items.

The level editor has a history manager which remember all your actions from an initial state, which is created when opening a file or making a new one.

Warps
Warps - are a special points which giving teleportation able for players. Warps - alone way to walk between level sections. Warps placing, editing available via special toolbox - Warps and Doors which available by toolbar icon or in the View menu. Warps presented as list of available warp entries with placed on the level a special points - entranced and exits. To place new warp you should add new warp entry and when you need place necessary warp points to the map by pressing to the "Set Entrance" and "Set Exit". If point already placed (grayed check-box about is checked) and when you will press this button, you will be scrolled to location where this warp point is placed. With context menu you can jump between entrance and exit locations and change some properties.

Layers and events
Layers giving able to create group pointer to items which membered to them. Layers can be hidden/shown by events - special sub-scripts which giving able modify level and game-play things inside level runtime. Events can change music and sound of target section or multiple sections, events can show/hide membered to defined layers items, etc.

Editing of layers available in the special layers toolbox which available in the view menu or by toolbar icon. Layers editing dialog have a list of layers with check boxes which you can enable/disable to show or hide layers. You can drag and drop layers in list to make order of them. To rename layer you can use context menu or double click to them. Unlike SMBX, renaming of layers is safe and all connections will be saved with this layer (will be updated automatically after renaming of layer).

Editing of events available in the special events toolbox which available in the view menu or by toolbar icon. Events dialog have a list of available events and toolbox which preferences of events. You can rename events in list by double clicking to them. You can move them inside list to order them like in the layers dialog. Renaming of events are safe too.

NPC custom configuration editor
Additional feature which giving able to configure your custom NPC. You can preview it's animation in the special preview box where you will see result of your settings. When you will change them, result in the preview box will be instantly updated. Each NPC config basing on the global configuration and using for customize already configured NPC.



World map editor
Part which giving able to view, create and edit world maps and episode settings.

Episode settings
In the world settings toolbox you can change special flags, edit titles, credits list of episode, etc. Toolbox available

Items
Items editing is in the multi-selection dragging with using of context menu to change settings of them.

Editor giving able to place new items with difference modes:
 * Brush placement - Default regular mode. You will place items by clicking and moving of mouse. Default for all items.
 * Rectangle draw - Additional placing mode which can use them to place group of items inside rectangular shape. Available for Terrain tiles, Sceneries, Paths and Levels.
 * Circle draw - Additional placing mode which can use them to place group of items inside round shape. Available for Terrain tiles, Sceneries, Paths and Levels.
 * Line draw - Additional placing mode which giving able to draw lines of items. Available for Tiles, Sceneries, Paths and Levels.
 * Flood fill - Additional placing mode which giving able to fill closed ranges of random shape. If range is accidentally opened, don't worry, filling process will be aborted after 3 seconds timeout to prevent freezing of editor and memory overflow. Also you can enable special flag which will enable limit of flood fill process with section boundaries.
 * Overwrite mode - Additional placing mode which will enable removing of all collided items with item which you placing now.

When you working in the selection mode, you have able select multiple items which you can move into another place, copy, paste, remove.

Available a context menu which giving access to properties of each item. If you was opened properties dialog with selected item group you also have able to overwrite properties of all selected items.

World map editor have a history manager which remember all your actions from initial state which begins from opening or creating of new file.

Middle mouse-button commands
Editor have able to get usage of middle mouse button: you can enable those feature in the Tools/Application settings and in the Editing tab.
 * Duplicate selected - all selected items will be duplicated to current mouse position relative to left-top corner
 * Pick-up to place from map - you know SMBX's feature which giving able take one of items from map to place copies of them. You can do it in the Editor with middle mouse button!
 * Switching into drag-scroll mode - when you pressing middle button without selected items, you will be switched into drag scrolling mode where you can scroll with dragging of screen.

Debugger
Debugger - is a special toolbox which show additional information and counters of items.

Main features:
 * Displaying of current mouse position/coordinates on the level map and world map
 * Going to the position by typing its X and Y coordinates in a level and world map
 * Counters of Player Start Points, Blocks, BGOs, NPCs, Warps and Physical Environment Zones (Water & Quicksand) are placed in the level; see how many Tiles, Sceneries, Paths, Level Points and Music Boxes are placed in the world map.
 * Custom counters which allows to define own counters of items/elements which placed in the level or in the world map (only version 0.2.1.8-dev and higher).

Tileset item box
Tileset Item Box - is a special flexible and customizable item box which giving able create your own tilesets of items which more convenient to use if you have necessary to make combinations of difference items on the map. This item box can be opened via View menu where you can found Tileset Item Box menu item.

Tileset Editor
Tileset editor is a drag&drop dialog box where you need drag necessary items from common list and put them into one of cells of tileset. You can change size of it. Limit of size is from 1x1 to 20x20 cells per tileset.

Global tilesets
Global tilesets - are a special tilesets which listed in the own tabs, which are "categories". These tilesets saving into folder of configuration package instead of level or world. These tilesets don't using custom graphics, but you can make own tilesets and tileset groups. For global tilesets available a special tileset group editor which can build common tabs of tilesets.

Themes
Interface of the editor can be customized with special theme packs which can be installed into themes/ directory of the editor. (If folder is not exists, create them!).

Search toolbox
Search toolbox giving able to find specific items on the level or on the world map.

Position bookmarks
Position bookmarks - is a special useful tool which will remember your last position on the level or world map and will give able return back by alone click to them!

Important notes

 * When you will exact limits of SMBX64 standard (for example, placing more items than possible in Legacy Editor), you will be noticed with a warning message about possible crashes in the Legacy Engine.
 * PGE Editor using the SDL Mixer X audio library to play music and sounds. If you have music is not equal to 44100 Hz sample rate, you will hear the noisy or too speedy playback. To fix it you should re-sample your music file into 44100 Hz to get correct playback.  Fixed long time ago, please download the latest version of PGE Project to resolve this trouble 
 * If you see images there are shown incorrectly (semi-transparent, invisible sprites, dirty images), this is a possible result of lazily-made masks or damages image file. To fix this, you can open the "Tools" menu, then open a "Custom Data" and choose "Fix bad masks" in it. A special wizard will be started to automatically fix all your wrong masks. After completion of the work, reload a level file to take an effect.
 * You can enforce Editor to use portable settings instead of ~/.PGE_Project directory which is using by default. To take an effect, you need to create the pge_editor.ini file and make a "[main]" section in it. Then, add the "force-portable=1" line and save the file. Then, start an editor again.

Links

 * PGE Editor manual
 * Veudekato's Playlist/Videos
 * How to test levels in the SMBX with parallel editing by PGE Editor