Lunar Magic Level Editor


When you first open Lunar Magic, it will be empty. To begin editing something, you will need to open the ROM to edit. Lunar Magic operates under the assumption that the SMW ROM you are editing is the only ROM in that directory. This means that any extra files it saves or creates will be stored in that directory, but there won't be any identifying filenames that specify that those files go with that ROM. It's best to separate your ROMs in directories if you're going to be editing several ROMs, such as we will be in this tutorial.

Warning

Do not overwrite your original ROM! Take that ROM, copy it somewhere, and store it in a place that you never tell Lunar Magic to go. You will want to keep a pristine copy of your original ROM around.

So, to start with, find your original SMW ROM and copy it to a new directory. Run Lunar Magic, go to FileOpen ROM, and load the file you just copied to (not the original). You should expand the width of the Lunar Magic view until all of the icons are visible. This is what your screen should look like.

Example 1. Main Lunar Magic Level Editor Window

Main Lunar Magic Level Editor

This is the Lunar Magic Level Editor window. Despite the fact that it is showing a level, it is the main window for Lunar Magic, and it has options for editing global data as well as levels. If you don't recognize the level, this is Yoshi's Island 1, which is level 0x105. Lunar Magic is hard-coded to start by showing level 0x105. This is useful for us, since Yoshi's Island 1 is easy to get to from the start of the game.

So, let's familiarize ourselves with the editor. The most important toolbar buttons for basic level building are these:

Example 2. Level Editing Toolbar Buttons

Level Editing Toolbar Buttons

From left to right, these buttons are:

  1. Layer 1 Editing Mode

  2. Layer 2 Editing Mode

  3. Sprite Editing Mode

  4. Open “Add Objects” Window

  5. Open “Add Sprites” Window

In Lunar Magic parlance, a level consists of objects and sprites (along with some other information, but we'll get to that soon enough). Objects are terrain. They are bricks, coins (which are considered terrain), those green bushes that Mario can run in front of, and so on. Sprites are spawn-points for various creatures and other inherently moving things. That is the main difference between sprites and objects: objects don't move. Not all sprites move, but objects are incapable of movement.

The three editing modes (Layer 1, Layer 2, and Sprite) are mutually exclusive; you can only have one active at any one time. When you start running the editor, you start in Layer 1 Editing Mode. Layer 1 and Layer 2 editing modes edit objects, while the Sprite editing mode edits sprites.

So, let's start by making a simple change to the level. You see that large wedge of ground that the blue Koopa is on? Left-click the mouse on it to select it. The screen should look like this.

Example 3. Selected Wedge

Selected Wedge

Now press the delete key. The wedge will disappear.

Note

Lunar Magic does not have an undo function. Anything you do is permanent, and if you want to undo it, you have to figure out what it looked like before and re-add the things to it.

Go to FileSave Level to ROM. A dialog will appear, but just press OK. This will permanently change the ROM.

If you boot up your SNES emulator and load the ROM, you will find that Yoshi's Island 1 has our change. Do that to verify that everything worked.

If you looked at the level in-game, you will find that the Koopa looks rather silly now, falling onto flat ground. So let's remove him too.

Press the Sprite Editing Mode button () to switch to sprite editing mode. Left-click on the Koopa and press delete. Go to FileSave Level to ROM, press OK, and the ROM will no longer have the Koopa. Verify this in-game.[1]

Adding Things to a Level

We have seen how to remove things from a level, so now it is time to see how to add them.

Adding Objects

Press the Layer 1 Editing Mode button () to go back to editing objects. Press the Open “Add Objects” Window button (). The following window will appear.

Example 4. Add Objects Window

Add Objects Window

There are many kinds of objects that you can add to a level. We will go into detail later, but for now, let us focus on a few. Scroll down to find the object 0x0B.

Example 5. Throw Blocks

Throw Blocks

Once you have this object selected in the Add Objects Window, click on the title bar in the main Lunar Magic window. Then Right-Click near the start of the level. This will create a 2x2 arrangement of throw blocks. Depending on where you clicked, your window should look something like this.

Example 6. Throw Block Placement

Throw Block Placement

The blocks appear oddly colored because we have them selected. If you left-click somewhere on the map, they will turn normal.

Select the blocks if you don't have them selected by left-clicking on them. Move the mouse cursor over the blocks, and it will change into a move-cursor. You can now left-click and drag the blocks to some other location. Move them to where I have placed mine in the above picture.

Now, the block placement is technically legal, but aesthetically displeasing, since half of the blocks are embedded into the ground. What we really want is one row of blocks. So select the blocks if you don't have them selected already and move the mouse pointer to the bottom of the blocks. Not the bottom row of blocks, but the actual bottom edge of the blocks. The pointer should change into an up/down double-arrow. Left-click and drag the blocks up one, which will remove the bottom row of blocks. If you have done this correctly, you should see the following.

Example 7. One Row of Throw Blocks

One Row of Throw Blocks

We can also extend the width of the blocks, similarly to the way we changed the height. To do so, select the blocks and move the mouse pointer to the right edge of the blocks. When the mouse pointer turns into a left/right double-arrow, you can left-click and drag the width around. If you move the mouse pointer to the bottom/right corner, it will become a diagonal arrow, which will allow you to change both the width and height at the same time.

Please note that you cannot use the cursor to add/remove rows from the top or add/remove columns from the left side. To get the effect of this, move the entire object so that the top-left corner is where you want it to be, then change the right and bottom sides accordingly.

Note

Do not move objects so that they extend off the bottom or top of the screen. If you do, they will wrap around to the top/bottom of the screen elsewhere.

We will go into great detail about objects later, but we have learned the basics. We can now add and manipulate objects, so it is time to learn how to add and manipulate sprites.

Adding Sprites

Press the Open “Add Sprites” Window button (). You don't have to close the Add Objects window to do this; both may be open at the same time.

Example 8. Add Sprites Window

Add Sprites Window

It looks very much like the Add Objects Window (it would have been nice if they'd at least changed the background color to make them more distinguishable). So let's add some sprites to our level.

First, be sure to click the Sprite Editing Mode button, or else none of this will work. Once done, find sprite number 0x0A: the Red Vertical Flying Koopa.

Example 9. Red Vertical Flying Koopa

Red Vertical Flying Koopa

Once we have selected this entry, Right-Click in the map near Mario. There, he will appear.

Example 10. Koopa in Level

Koopa in Level

Selection and movement works with sprites exactly as they do for objects. You cannot change the size of sprites however; that is built into the sprite. Nor can you use one sprite to spawn multiple sprites. If you need to place 3 sprites next to each other, you have to place 3 individual sprites next to each other.

Selection and Manipulation

You can left-click & drag to select multiple objects or sprites. You can then move them around as a group.

Lunar Magic has a certain idiom about how you go about editing things. It is very unique to LM; few if any other programs use this style. Fortunately, LM is very consistent about this.

If you have something selected in the main window, regardless of editing mode, and you right-click in the window, then what you get is a copy of what you had selected. This overrides whatever sprite or object you have active in the Add Objects or Add Sprites dialog. This is a fast way to replicate some kinds of scenery, as you can left-click to select, and right-click to copy, without having to do the Ctrl+C/Ctrl+V copy&paste that most programs do.

If you're not used to it however, it can be an incredibly tiresome annoyance. You may mentally be focused on the Add Objects dialog, but forget that you have something selected. When you right click, you get a copy of something, rather than the object you pulled out of the drop-down. Fortunately, you can simply press Delete to get rid of it, so it's usually a quickly corrected mistake.

Level Saving and Loading

Super Mario World consists of more than just Yoshi's Island 1. Indeed, this level is only part of the stage; the level you go to when you go down the pipe has a different level number. Super Mario World has 512 levels, numbered from 0x0 to 0x1FF. In general, when talking about level numbers, we will use hexadecimal. The main course of Yoshi's Island 1 is 0x105. Yoshi's Island 2's main level is 0x106.

To load a new level from the ROM, press the level change button, press Ctrl+D, or go to FileOpen Level Number. The level change button is the third button from the right, the folder with the numbers over it (note: the numbers will always be the current level). When you change a level, you will be prompted to save this one if it is currently unsaved. Then, this dialog will appear.

Example 11. Change Level Dialog


Remember: level numbers are in hexadecimal.

To save the level to the ROM, press the save button. This will save the level to the current level number. Sometimes, you may want to save a level to a different level number. This is useful for copying a level within a ROM. To do this, press Ctrl+I, or go to FileSave Level to ROM; this will display a simple dialog for choosing the level number. Remember: all level numbers are in hexadecimal, and must be between 0x000 and 0x1FF.

Mario Level Files

Levels in Lunar Magic can be saved to standalone files, with the extension “mwl” (Mario World Level). This has the advantage of allowing a level to be loaded into a different ROM. Also, ROM hacking can very occasionally cause corruption to the ROM, particularly if you're adding various new gameplay effects beyond Lunar Magic's normal capabilities. In these cases, if you don't have a backup of the ROM, you cannot recover your data. If your levels were all saved as separate .mwl files, you can recover your work quickly from a clean ROM.

Personally, I suggest this. When you're in active development of a level, save it to the ROM. That's where you're going to be doing your testing anyway, so just drop it there. When you reach various milestones in your level's development, save it to an individual file with a reasonable name. These act as a backup in case of ROM corruption or some other unpleasantness.

To save a .mwl file, press Ctrl+S or go to FileSave Level to File. You can load a previously saved level with FileOpen Level from File. MWL files store the level number as part of the level, so when you load them, they will automatically go back to the correct location.

Review

At this point, you have enough information to play around with basic level features. So do so. Use Yoshi's Island 1 as your playground and experiment as you see fit. However, do not touch any of the pipes, the mid-way point, or the exit point. We will deal with them specifically in later tutorials, but playing with them now would likely lead to a broken, non-functional, or crashing level.



[1] You can use File+Emulator...Setup Emulator to tell Lunar Magic where your emulator is. Then, you can just press F4 to run the emulator.