Lighting

New Super Mario Bros Wii comes with a selection of different environment files (each one fo those files includes settings related to lighting, fog, and others). Changing them will allow us to change completely the appearence of Mario, the enemies, and sprites. The environment file is called , and it's located in the   directory, in the root of our game.

If you open that file with BrawlCrate (or BrawlBox), you'll find a folder called. Inside, there are some  files. Those are the files related to the lighting.

Are you ready? Here goes the tutorial!

How can I select a specific environment?
As we have said above, the game comes with some pre-created environments. Those can be selected in Reggie. You must open the "zone settings" button and, then, select "Zone Theme".

Every one of those options is a "pack", that includes the lighting (a  file), the fog (a   file) and others files. This is the equivalency about what Reggie shows (the first column is the option to select) and what files are included (the second column is the  file you must edit in order to change that lighting).

Let's talk about the lighting!
The lighting is determined by a specific  file (see table above).

There are 2 different lighting:


 * This light is applied to a specific group of sprites (probably determined by a z-value group). Changing that light does not have any repercussion with others sprites. There are 36 lights of this kind (0-35).
 * A light more general. There are 8 (0-7).

Let's explain better what does everyone.

Lights objects
Every  have 36 different lights. They are sorted by groups of 5 lights. The first value of that group is the one that affects the most. Let's put an example. ID 6-10 are the responsable of the BgA. From those, editing the ID 6 would make the bgA to look different. But, editing ID 7 doesn't change almost anything.

This is the list with the IDs and what they change:

Ambient light
What's about ? It do a global change, they're like the "sun" in the game. Just that... well, there're different suns. They cannot be edited with the EnvEditor unfortunately. There are only 8 lights (0-7).

What program should I use?
We have 2 different programs to use. If we want to change the  or only the , we must the. We can select the whole  and it will work.

EnvironmentEditor

If run.bat doesn't work, install also this:

PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x64.exe

But, if we want to edit the light ( and  ), we'd better to use the PE-Editor (Post Effect Editor).

Post Effect Editor"The PE Editor is done by Wexos, a user with a bad reputation about coding. Another of his projects search throw the IP and name of computer. It's not tested that it does the same with the PE Editor."

How to use EnvEditor for lighting?
When we have opened the program, we can go to  and open our. When we have it, we must press   to start editing the lighting. The first step is to select what   we want to open (what lighting we have selected in Reggie for that specific zone) (see table above  SELECTING SPECIFIC ENVIRONMENTS).

Then, we see that we have another selector. That's for the light ID (I explained this better above). The list of the IDs of the  is above too (table LIGHT OBJECT ID). Remember, the  only works with the PE Editor.

Then, you'll have a lot of options to select. You can change the opacity from 1 to 0 (it will put the objects grey). You can also change the color (it's in hexadecimal). Other options are untested or doesn't change anything.

For example, if we wanted to edit the lighting in overworld, and we wanted to edit the lighting around Mario (ID 16), we should have something similar to what we have in the DOC 1:

If you want to edit the lighting, the Env Editor is not the best, since it's missing some features. I totally recommend using the PE Editor for lighting.

How to use PE Editor for lighting?
For using the PE Editor, first we need to extract the  that we want. Against how do we open  with the EnvEditor, the PE Editor doesn't allow us to open the whole.

Instead, we must extract the  using BrawlCrate or BrawlBox (the   files are here).

Then save that file in our computer. We're now ready to open it with the PE Editor. In that program, select file → open, and select our  file.

We'll se that we have 2 different tabs: Light Objects and Ambient Lights.

Light Objects works like in the EnvEditor. The left-more column is the ID (in hexadecimal, now) (look the table above to know what ID you must edit, the table called LIGHT OBJECTS ID)

About the other columns, some of them are still unknown or not used in nsmbw (because this program was designed for MKW). Still that, you can edit the colors (RED, GREEN, BLUE). Alpha doesn't change anything (probably it's hardcoded).

Ambient light is easier, you just have to edit the colors. Again, alpha doesn't work (or, at least, I couldn't found any difference). What does every ID can be found in the table above (AMBIENT LIGHTS ID).

Let's be honest, I just want to do a silhouette level!
Alright. Then, with the PE Editor, you just have to change every color from every light ID ( and  ) to 00. With that, you'll have your own sillouethe level.

Well, not at all. There are still some problems. BgA isn't completely dark, and BgB isn't changed at all. Also, some sprites are not affected by the lighting (red ring, for example), and the fire/ice ball is as usual. Finally, tilesets are not changed, so you'll have to use a completely black tileset.

All those issues can probably be solved by using fogs, but that would be another day!

Huge thanks to Zement and Ashely, who have really helped me a lot doing this tutorial.