LePlatz Level Editor
LePlatz is a level editor for the Platz toolset. LePlatz eliminates the tedious task of converting images of your game world into textual data structures. LePlatz provides a gui with a set of tools corresponding to the logical structure of the format expected by the Platz toolset. You simply need to draw shapes on your game world canvas and LePlatz does the rest. More specifically LePlatz will:
- Match and select the underlying tiles/patterns/animations
- Configure mutable background bitmaps
- Configure moving platform directories
- Maintain valid background index ordering
- Determine appropriate slice boundary collision parameters
- Facilitate rearrangement of slice ordering
- Validate game world structure
- Compile game world for inclusion in C code
An image representing a Platz slice that would have taken 15 minutes or more can be completed with LePlatz in around 30 seconds. The most recent version of B.C. Dash was created with LePlatz. See here for more information on the Platz toolset.
- LePlatz projects are saved as xml files. The included example is under: <install dir>/examples/bcdash/bcdash.xml
- All regions containing images can be zoomed in or out by giving them focus, holding the Ctrl key and scrolling the mouse wheel.
- Keys F1-F7 are a shortcut to the different panes of the World Interaction Tools (WIT) toolbox.
- Ctrl-F# (F2-F7) will hide all background items except for those whose WIT shortcut key matches the F# pressed. Ctrl-F1 will cancel this effect.
- When special tools are not selected, right clicking in the main view will turn the cursor into a glove which will grab and scroll the view. Right clicking a second time will return the cursor to its previous state.
- The 'H' key toggles hide/show for all selected items. This can be useful when container items overlap and obscure your drawing.
- Drag'n'drop: Most background items in LePlatz can be dragged and dropped from within the World Details Tree. All indexes and relationships will be updated based on the new order after the drag 'n' drop operation is complete.
- Override mappings: You can override LePlatz's mapping of tiles, maps and animations by dragging an icon from the Utilities dock and dropping it onto the canvas. This can be useful when LePlatz guesses incorrectly or when your slice image does not match the given tile/map/animation or even when you just wish to change it without editing the slice images.
- Delete selected items: Pressing delete will delete any selected items and will walk up the tree if repeatedly pressed. Undo/Redo is currently disabled but is WIP.
- LePlatz Source Parser: LePlatz will comb your provided Source Folder in order to glean required information for creating your game world. In particular, LePlatz is looking for:
- // _LePlatz_Platform_Clear_Tiles_Ids_
- // _LePlatz_Trigger_Ids_
- // _LePlatz_Mutable_Bg_Ids_
These can be in any order but must come in pairs like so:
// _LePlatz_Platform_Clear_Tiles_Ids_ #define CLR_SKY 0 #define CLR_WATER 1 // _LePlatz_Platform_Clear_Tiles_Ids_
If you are missing options in WIT combo boxes, you may have forgotten to add these flags to your source code.
These are the main tools used to interact with the background canvas and can be accessed quickly with F1-F7. All but the first are used to define boundaries for world items. The lower section of the WIT displays contextual options that will be applied to the next drawing instruction.
- The Outer Bg tool is used to define Outer Bgs. Outer Bgs must be contained within a single slice and LePlatz will restrict you accordingly. WIT also contains a BGT button which indicates a Trigger (a special kind of Outer Bg). Clicking this button will flip the WIT panel. Only the visible options are applied for any single drawing operation.
- The Inner Bg tool is used to define Inner Bgs. Inner Bgs can only exist within Outer Bgs and LePlatz will restrict you accordingly. If Outer Bgs are overlapping and interfereing with the placement of your Inner Bgs, selecting the offending Outer Bg and pressing the H key will hide it temporarily so that you may assign the Inner Bg to the correct parent.
- The Bg Object tool is used to define background Objects. Use background objects when collision detection is not necessary and if the bg item can be described by a single map. Objects take the least amount of flash and processing time.
- The Moving Platform Path tool is used to define the path along which Moving Platforms will move; they do not actually appear in the world. A Moving Platform cannot exist outside of a Moving Platform Path and a Moving Platform Path must contain a single Moving Platform. LePlatz will flag omissions such as these during compilation. You should allow room around your Moving Platform Paths for the player not to be "squashed" into surrounding collidable items.
- The Moving Platform tool creates a Moving Platform within the bounds of a Moving Platform Path. Drawing a second Moving Platform within the same path will replace the first. You can overlap paths if you desire overlapping Moving Platforms (this can be seen in the B.C. Dash example that comes with LePlatz).
- Image:LePlatz-cursor-bgm.png|Draw Mutable Bg]] The Mutable Bg tool is used to couple a Mutable Bg with a single Inner Bg. This is a one-to-one relationship. LePlatz offers the convenience of being able to define the Mutable Bg for its parent Inner Bg immediately after having drawn the Inner Bg (as the next drawing operation). However, if this opportunity is not taken or if there is a need to redefine the bounds of the Mutable Bg, the corresponding Inner Bg must be the selected item before Mutable Bg drawing can commence.
The only other restriction placed on Mutable Bgs is that they must exist in the same slice as their Inner Bg. Mutable Bgs can also carry a custom payload. In this case it is customary to draw the Mutable Bg directly over the top its parent Inner Bg after having set the custom payload option and filled in the desired values. Despite the custom payload, LePlatz requires a visual representation of the Mutable Bg's existence. These values can be retrieved within your game code and used however you wish. If a custom payload is not selected, the bounds of the drawn Mutable Bg will be available within your game code.
Mutable Bgs also contain an index depending on their position in the level (ordered sequentially from left to right). This index can be used to turn the Mutable switch on or off by indexing into a bitmap stored in RAM. B.C. Dash stores an index of another Mutable Bg within a custom payload for a MUT_BOMB_TARGET_SWITCH (B.C. Dash define) to turn on a hidden water animation after a bomb has destroyed the obscuring landmass. This feature may seem confusing - please direct any queries to the Platz Toolset forum thread
Special Case Tools
The Insert Empty Slice tool can come in handy when you have already completed defining much of your world but need to add new artwork before the end point. The simplest method is to load your project; include your new slice artwork in your project folder; Insert an empty slice at the desired location; press the Reload World Resources toolbar button. Your game world will adjust around the new slice/s. Left click inserts before the clicked slice; right click inserts after it.
The Remove Slice tool will do exactly that: remove the selected slice. If the corresponding image is not removed from the slices folder before the project is next loaded, the slice will be loaded again (sans defined items).
A complicated tool. The replicate tool ensures that its operation will always be performed upon the currently selected slice (not the necessarily the clicked slice). Left clicking a slice will copy its contents to the selected slice. Right clicking a slice make the selected slice a replica of the clicked slice. A replicant slice will not consume anymore flash (except for its directory entry) and will display as the original does. This has implications when Mutable Bgs are part of a replica relationship - they will share the same index and will thus need to be managed specially in your game code or avoided.
To unlink a replicant from its replica parent simply select this tool and click on the replicant slice. You will notice a slice's replica relationship status in its information bar.
The Lock Slice Ordering tool will prevent LePlatz from ordering Outer Bgs that are inserted or dropped into the slice. LePlatz will ordinarily order slices from left to right for collision detection optimizations; this option will suppress that behaviour. Unlocking will resume normal ordering without altering the established order.
An example where this is useful is in the B.C. Dash demo. MUT_BOMB_TARGET bgs had to come immediately after MUT_BOMB bgs, but if the bomb target was leftmost, a lock had to be performed before drawing the combination, followed by an unlock. You will notice a slice's lock status in its information bar.
Once your hex is built, you can invoke the emulator from within LePlatz with this tool (provided that path is set). The Emulator Output pane of the Utilities Dock Widget will display the emulator's output provided the stream is flushed intermittently.
Maps and animations provided to LePlatz should be placed on a separate line. Any spare room should be filled with the LePlatz delimiter tile. Showing the first frame of the animation is sufficient (or whatever frame you used for your slice images). The order of the maps and animations in the images should match that of their corresponding code tables. If in doubt, see the B.C. Dash example project that is distributed with LePlatz.
- LePlatz will order your slices alphanumerically by their filename. Preceding their names with a double/triple digit number makes it easy to conform to this requirement.
- Specifying paths relative to your project file will allow you to move and distribute your project more easily.
- If your paths are set at a local level, you may need to run LePlatz from a terminal in order to invoke the make tool.
- You can refine the LePlatz "Snap to Grid" feature via the menu Edit->Snap to...
- Deleting the LePlatzSettings.xml that LePlatz creates in its directory will reset window positioning/layout as well as emulator and make paths and recent project listings.
- Empty Bg items (those with area equal to zero) are not accepted by LePlatz. You can use this restriction to easily cancel an item that you have mistakenly begun to draw.