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 part of Wohlstand's SMBX Research Works, which were started for the purpose of creating a new SMBX engine which is be compatible with the old SMBX and will be more flexible and universal, in order to continue progress of SMBX and give more potential for making other games. 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 existing issues and inconveniences of default SMBX Editor. The Editor's most notable features are a Multi-Document Interface which is able to have multiple files open at one time. Development of Editor started in March 24, 2014 where Wohlstand presented first sketch of editor which was a beginning of PGE Project. This dummy application was only able to parse and validate the original SMBX .LVL file format. Later, Wohlstand implemented displaying of level contents but without graphics. Beginning from version 0.0.5-alpha, the Editor was able to export whole sections of levels and areas into images. Before NPC displaying was implemented, all NPC's were displayed as a "ghost" dummy image. On April 28, 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 full-featured version with file reading/writing ability, history manager, and full support of NPC rendering was 0.0.8-Alpha, which was released on July 13, 2014.

On October 20 2014, after a long time of development, the FIRST stable and full-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 to create and edit levels, world maps and configure custom NPC's more conveniently.

Interface
Editor have a multi-document interface with dock widgets and toolbar with additional icons. Here is two modes of MDI:
 * tab-view, modern and flexible MDI interface. All opened files available by special tabs which you can use to quickly switch between opened files.
 * sub-windows, classic and more like to original SMBX Editor interface. You have a space with included sub-windows inside them.

Supported files
List of supported file formats by Editor:
 * LVLX - Extended Level File, uses PGE-X data format
 * WLDX - Extended World map File, uses PGE-X data format
 * LVL - SMBX 1.0...1.3 Level File Format, internal format of SMBX game engine
 * WLD - SMBX 1.0...1.3 World Map File Format, internal format of SMBX game engine
 * SAV - SMBX 1.0...1.3 Game Save Format, internal format of 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.

Level editor
Part which giving able to view, create and edit levels.

Sections
Each level dividing to section - a separated rooms which can have difference atmosphere: difference background, music, physical environment, size, etc. On the tool-bar available switch buttons with numbers which giving able quickly jump between sections. Also you will see a compass icon which giving able to return back into left-bottom of current section if you was lost on a huge space. When you switching between sections. All properties of current section available in the special Section Properties toolbox which you can open via tool-bar icon or in the View menu.

In the section properties toolbox you can change special flags, change music, choice custom music file in the interactive mode, change background of section and resize the section. When you press "Resize" button you will see big green rectangle which an interactive resizer: you can move them, you can drag it's sides, you can crop parts with using of context menu. When you done resizing you can press Enter key to accept changes or Esc to cancel resizing. You also can see special icons on the tool-bar which you can use to apply/cancel resizing too.

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. Placement mode of player start points, warp points, default Blocks, BGO's and NPC's.
 * Rectangle draw - placing mode of sizable blocks, physical environment (waters, quicksands) ranges. You also can use them to place group of items more faster than brush placement. Available also for Blocks and for BGO.
 * Lune draw - Additional placing mode which giving able to draw lines of items. Much useful for drawing of slopes. Available for Blocks, BGO's and NPC's.
 * 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.

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

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 more faster than brush placement. Available for Tiles, Sceneries, Paths and Levels.
 * Lune 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, you will lose able to save SMBX file format with warning message, but when you will remove junk items, you will get able to save SMBX file again.
 * PGE Editor using the SDL2_mixer audio library to play musics and sounds. If you have music is not equal to 44100 Hz sample rate, you will hear noisy or too speedy playback. To fix it you should re-sample your music file into 44100 Hz to get correct playback.
 * If you see wrong images (semi-transparent, invisible sprites, dirty images), this is a result of lazily-made masks. To fix this bug you can open menu "View" and set flag "Enable GFX Fix" and when restart your level file. Alternate method is Tools menu where you will found "Custom Data" sub-menu and "Fix all wrong masks". Will be started a special wizard which will automatically fix all your wrong masks. When feature done it's work you can reload level file to see fixed result.
 * You can force usage of portable settings instead of ~/.PGE_Project directory if you was installed editor with installer. To take effects, you should create the pge_editor.ini file and make section "[main]", then add the "force-portable=1" line and start editor again.

Easter eggs
JOKES Hello everybody! I like any easter eggs! JOKES_END
 * if you will insert this piece of code via notepad into the bottom of LVLX/WLDX/META file, you will see message box with than text when you will try to open edited file:

Links

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