Zones and Zone Options

Zones are (playable) regions within an Area. They can be created freely and various properties can be set, for example their size and position. There are also numerous Zone Options that can be modified from the respective dialogue. Zones are very important when it comes to visual aspects (Zone Theme), camera configuration, music selection, or how a level is perceived by the player, among other things.

= Zones = As we have learned, zones are regions within areas. Their main purpose is to create space that can be used by the level designer for their creations. The size and position of a zone is crucial. This is due to the fact that both the player and the camera cannot leave the zone. So please keep that in mind.

Zones can have different themes, camera angles, zoom modes, and music. They can be connected to other zones via Entrances.

Zone Boundaries
Zone boundaries represent the natural borders of a level. At no time will the camera be able to leave the zone. Special rules exist for the player and sprites, see below.

Left/Right Zone Borders
The left and right zone borders are impenetrable by both the camera and the player. The border can't even be reached entirely, as the camera will stop a few blocks before the zone border. How soon the camera will stop depends on the zoom level selected. Please see Camera and Zoom Level. Sprites and Entrances can only be placed max 1 block to the left/right of zone borders, else they will not load. This is not the case for all kinds of controllers.

Bottom Zone Border
The bottom zone border is deadly for the player, there is a small buffer area below the zone, though. The size of that buffer area depends on the zoom level once again. If the player touches the last pixel of that buffer area below the zone, he dies.

Buffer Area Sizes
 * Zoom Level 0/1: ~2 blocks
 * Zoom Level 2/3: ~3 blocks
 * Zoom Level 4: ~4 blocks

Sprites and Entrances can be placed up to 8 blocks below zone borders. Actor Spawners and some other sprites can only be placed 1 block below the zone.

Top Zone Border
The top zone border is different from all the other borders. It can be traversed by the player without dying.


 * The player can climb up to 8 blocks above the top zone border.
 * He can interact with tiles and sprites up to 7 blocks above.
 * If the player climbs up higher than 8 blocks, then the last line of blocks (8th line) is repeated indefinitely while still keeping the player at the same height.
 * Entrances can also be placed up to 8 blocks above the zone.

Sprite Loading Behavior
Please see Sprite Loading Behavior in Areas for area-wide loading behavior.

Sprites inside or close enough to zones are usually loaded into memory at area start.

Pairs of sprites, for example a rotation controller and rotation controlled objects, are bound to the zone that contains the controlled objects, even if the controller is far outside the zone.

There is a group of sprites that is always active in the entire area, even if they are placed far outside zones. Event controllers, for example, will influence events in every zone. The same is true for Bosses and various controllers. To prevent this from happening, an empty zone can be created and the respective sprites placed inside.

The typical loading radius for most common sprites is 8 blocks above and below the zone, and 1 block to the left and right of it.

Actor Spawners are special in that regard: They must be placed inside a zone to work, or at least touch the zone border. Also see Zone Specifications and Limitations.



Sprite Appearing Behavior
All actors/sprites use an array of settings that controls, at which distance to the player they should load into the level and start moving.

Sprites will show up in a level roughly one block before they are actually visible on-screen! This is the case for most normal enemies. It allows the level designer to create predictable enemy jumps and other things.

Imagine Mario walking/running to the right in a level. Every enemy/sprite will start its movement, as soon as it is closer than 1 block from the right edge of the screen. This guarantees that the position of the enemy is pretty much the same in the level editor and when playing the level for real. If Mario walks forward really, really slowly, then he can trigger the movement of an enemy before it is seen on-screen. The enemy will then enter the screen after a short amount of time.

Other sprites, especially those linked to path/movement/rotation controllers, other controllers, paired or grouped sprites, bosses, etc., are always active or have a larger loading radius. Big or resized enemies can cause problems, especially if they are much larger than normal. They are loaded too late and we can see how they appear on the screen; they plop into existence. That happens because the origin of the sprite is less than one block away from the screen border, yet due to their size the sprite can't load entirely outside the screen.

Dimensions and Position
Dimensions and position of zones is absolutely elemental in many regards. Let's look at zone position first.

Position
Zones have quite a large loading area around them, therefore it is important to give individual zones enough room to breathe.


 * Zones should never overlap or touch other zones.
 * Zones should be 256px (16 blocks) away from each other.
 * Zones should be 256px (16 blocks) away from the canvas/area border.

Size
Zone dimensions are one of the most important aspects when creating a level. The dimensions will dictate camera behavior.

Let's look at typical sizes for levels: The length of a main section zone is usually around 5000px - 9000px. Intro sections, entrances to other areas, goal sections, boss sections, midway flag rooms, or Ambush/Toad House levels are typically much shorter. Some of them use just a single screen. The height of a zone should be set in accordance with the zoom level. If the camera should be allowed to scroll up/down, then it's important to set the height of the zone to a reasonable value, without making the zone unnecessarily tall.


 * Make sure that the zone size is not above any of the limits, see Zone Specifications and Limitations.
 * Likewise, make sure the zone is bigger or the same size as what is required by the Zoom Level, or any Camera-altering Sprites.
 * If the height/width of the zone is the same as what is needed by the zoom level, then the camera will be static, see Camera and Zone Size.
 * If the height/width of the zone is higher/wider than what is required by the zoom level, then the camera will be able to move, see Camera and Tracking/BIAS.

Camera
Every zone can have individual camera settings. This is once again a very important factor when creating levels. The level camera depends on a combination of settings, which can all be modified at will. Those settings are:


 * The dimensions of the zone in relation to the screen size, see Camera and Zone Size.
 * The actual size of the screen, see Camera and Zoom Level.
 * Whether or not the camera is allowed to move within the bounds of the zone, see Camera and Tracking/BIAS.
 * Screen scrolling behavior when the player moves, see Camera and Scrolling (Bounds).

Camera and Zone Size
The zone dimensions directly affect the camera movement. The following variations are possible: The same effect can be achieved by unticking Y Tracking, see Camera and Tracking/BIAS below. Example: The zone is 224px tall and zoom level 0 is used. Since this zoom level requires the same height (224px), the camera movement will be stationary.
 * The zone has the same height as is required by the zoom level. This will cause the camera to be stationary across the Y axis, it cannot move up/down.

The same effect can be achieved by unticking X Tracking, see Camera and Tracking/BIAS below. Example: The zone is 448px wide and zoom level 0 is used. Since this zoom level requires the same width (448px), the camera movement will be stationary.
 * The zone has the same width as is required by the zoom level. This will cause the camera to be stationary across the X axis, it cannot move left/right.

The same effect can be achieved by unticking X and Y Tracking, see Camera and Tracking/BIAS below. Example: The zone is 224px tall and 448px wide, and zoom level 0 is used. Since this zoom level requires the same height (224px) and width (448px), the camera movement will be completely stationary.
 * The zone has the same height and width as is required by the zoom level. This will cause the camera to be stationary across the X and Y axis, it can neither move up/down, nor left/right.

Camera and Zoom Level
The zoom level determines, how far the camera is zoomed in or out. This causes all objects on the screen to appear larger (zoomed in) or smaller (zoomed out). The zoom level (also called zoom mode) of a zone can be configured in Zone Options. There are a few sprites that can alter the zoom level on-the-fly while traversing a zone.

The following diagram shows the zoom mode sizes and the resulting camera sizes in blocks.



The camera can zoom out dynamically in Multiplayer (MP) modes if needed, but it cannot grow larger than the zone width or height.

The zoom level influences other aspects of a zone as well. We've already learned that the zoom level determines the size of the buffer area that we can find below zone borders. A higher zoom level increases the buffer area. That means Mario won't die as quickly in zoom level 4 as he would when playing in a zoom level 0 zone, assuming he falls below the zone.

Cutoff

We've also learned that zoom levels are responsible for the cutoff that happens on the left and right side of a zone. Those cutoff sections are not accessible by the player, and even the camera won't move there.


 * It's useful to know that zones with zoom mode 4 won't have any cut off!
 * Cutoff can also be prevented or reduced by making the zone the same height as is required by the zoom level.

The picture below shows, how much of the zone is actually cut off, with respect to the selected zoom level.

Camera and Tracking/BIAS
In the previous chapter about zone dimensions we've seen, that matching dimensions and zoom levels automatically create a stationary camera mode along the respective axis. The same effect can be achieved by using the tracking feature available for each zone. Tracking can be configured via the Zone Options dialogue. This feature can lock the camera along one of the selected axes. This only makes sense if used in zones that are larger than the zoom level.

It is good to know that using the tracking feature for a specific axis or setting the dimensions of a zone to a zoom level with matching dimensions will produce the exact same result.

General Camera Tracking
Under Zone Options we can configure the general camera tracking that should be available for the zone. The options are: Setting one of the options will alter the camera movement slightly. The game will try to keep a certain part of the approaching level terrain visible, giving priority to the chosen direction. In a left-to-right level for example, the camera will try to keep Mario in a position, where he's around 60% away from the right screen border.
 * Left to Right
 * Right to Left
 * Bottom to Top
 * Top to Bottom

Tracking in all directions
By default, tracking is enabled in all directions. X Tracking and Y Tracking are activated when looking at the Zone Options. This configuration should be used for long horizontal levels, where the height of the zone is also larger than the zoom level. Vertical zones don't normally use X tracking, but it's still an option for the level designer.

Tracking along the X axis only
To create a level that tracks the player only along the X axis (horizontally), all that needs to be done is disable Y Tracking under Zone Options. This configuration would create a typical left-to-right level in the editor (or vice versa).

Tracking along the Y axis only
To create a level that tracks the player only along the Y axis (vertically), all that needs to be done is disable X Tracking under Zone Options. This configuration would create a typical bottom-to-top level in the editor (or vice versa).

Tracking disabled
Disabling both X and Y tracking creates a single-screen level, where the camera cannot move at all. This configuration is used for all kinds of small rooms, or intersections etc.

BIAS
This sets the screen BIAS (screen alignment) to the left edge of the screen on load, preventing initial scrollback. Useful for pathed levels. This option must also be set for zoom levels 2, 3, and 4! Otherwise, some or all sprites may not be displayed!

Camera and Scrolling (Bounds)
Bounds are invisible locations that control camera scrolling upwards and downwards. The scrolling will automatically start, as soon as Mario enters one of those locations. The bounds feature is separated into upper bounds, which controls the top scrolling location, and lower bounds, which controls the bottom scrolling location. A value of  alters the bounds by one full block. is half a block and so on. The default values for bounds, which are  for both upper and lower bounds, work for all zoom levels out-of-the-box, except for zoom level -2. Value  always creates bounds with the same size:
 * For upper bounds, it creates a top scrolling location with a height of 5 blocks.
 * For lower bounds, it creates a bottom scrolling location with a height of 4.5 blocks.

Value  always creates a buffer location with a size of   blocks for any zoom level. Even higher values and the screen will never scroll, effectively turning Y Tracking off. (Zoom Mode 0),  (ZM 1),   (ZM 2),   (ZM 3), and   (ZM 4) force the camera to scroll at any time.

Uses With Bounds we can modify the size of the scrolling locations. If we want to keep a specific location above or below the player always visible then we would need to configure them. This is particularly useful in vertical levels.

Please note that sideways scrolling is entirely automatic and cannot be controlled, except with the General Camera Tracking feature to some extend.



Camera-altering Sprites
There are a few camera-altering sprites that can be used in a level. Those sprites are:
 * Zoom Controller (#206)
 * Rotation Controller Spinning (#149)

Zoom Controller

This sprite can be used to temporarily alter the zoom level. Placing this sprite creates a rectangular location with a user-defined size. The camera will zoom in/out to the specified value, while Mario is in this location. All zoom levels that we already know and that can be used zone-wide are available.

Please make sure the zone is large enough for the zoom level!

For further information, see #####Level Editing How-To's: Zoom Controller

Rotation Controller

The spinning rotation controller can also be used to change the zoom level on-the-fly. The setup for this is quite complicated. Further information can be found here: #####Level Editing How-To's: Rotation Controller

Visibility (Spotlight)
Certain visibility modes can be chosen for the current zone. They range from full visibility to absolute darkness. It's not possible to change the visibility while in a zone (only zone-wide). The following modes are available:
 * Normal (Hidden): The screen is bright. Mario is behind layer 0 tiles. No spotlight will be shown.
 * Normal (On Top): The screen is bright. Mario is in front of layer 0 tiles.
 * Layer 0 Spotlight (Small/Large/Extremely Large): The screen is entirely bright. Mario is behind layer 0 tiles and a small/large/extremely large spotlight is shown.
 * Full Darkness (Lightbeam): The screen is entirely dark. Only a beam of light shines on Mario. The spotlight changes direction with Mario. Mario is also behind layer 0 tiles.
 * Full Darkness (Small/Large Foglight): The screen is entirely dark. Only an irregularly-sized blob of light surrounds Mario. Mario is also behind layer 0 tiles.
 * Full Darkness (Small/Large Focus Light): The screen is entirely dark. Only a circular blob of light surrounds Mario. This light grows with increased movement speed, and shrinks back to normal when standing still. Mario is behind layer 0 tiles.
 * Full Darkness (Absolute Black): The screen is entirely dark. Only a few sprites can break the darkness. Mario is behind layer 0 tiles.

Zone-altering Sprites (Scroll Limiter)
There's one group of sprites that can be used to alter the zone height and width at certain places. This allows to cut out junks of the zone that are not needed. These sprites are called scroll limiters. There is always a left and right limiter and they must be used together for this function to work properly.

The top boundary is the same as the regular zone border: The camera won't scroll there, but Mario can climb up to 8 blocks into the void. The bottom boundary is deadly for the player. The same rules apply as the regular zone border.


 * For the left side, use sprite #162 (or #164).
 * For the right side, use sprite #163 (or #165).

Uses
 * Can cut out unneeded parts of the zone. This is especially useful with an ascending or descending stage. In such a level, it might take a long time for Mario to reach the bottom zone border in case he falls down. Sometimes it's also useful to cut out unnecessarily tall parts of the zone in sections where it's not needed.
 * Can create multiple single-screen-rooms from one big zone, with or without scrolling.
 * Can create hidden parts of a zone (see link below).
 * Can create "Zelda-like" screen scrolling (see link below).
 * Can create a buffer area for enemies that would not load properly without it. Many enemies, if placed too high above the zone border, will not load. Scroll limiters can be used to prevent this.

For further information, see #####Level Editing How-To's: Scroll Limiter



Zone Theme
Changes the way models and parts of the background are rendered. This affects blurring, darkness, lava effects and so on.

Terrain Lighting
Changes the way the terrain is rendered. It also affects the parts of the background which the normal theme doesn't change.

Audio
Here we can set the background music that should play in our zone. We can choose from the available song IDs. For custom music, see Custom Music. Sound Modulation changes the sound effect modulation in that zone. Boss Flag is needed by boss fights to allow proper music switching via sprites.

Music can not be changed in zones, only when transitioning to another zone. There are a few actors though, that can make music switching possible. This usually comes with a few side effects or glitches. To do this, a  entry needs to be selected in sprite #332 (Sfx/Gfx Spawner).

Cutscene or boss controllers will automatically switch the music if needed. Other sprites can do that, too, for example the goal flag, the chest, the Ambush or Toad controllers etc...

= Zone Specifications and Limitations =

= Zone Options = Zone Options allow us to configure each zone individually. Let's go through all the entries one-by-one.

Each zone is represented with a tab. Here we can select, which zone we want to configure. No zone/tab will be available for a new level. To add a new zone, press the New button at the bottom of the dialogue. This will automatically create a new tab. To delete a zone, press the Delete button. This will delete the currently selected zone and its tab. All subsequent zones will decrease their zone ID by 1.
 * Tabs at the top of the dialogue

Here we can set the position and dimensions of a zone. Allows to select a preset for zone dimensions with common zone sizes. Snaps the zone borders to the grid, either to any full-block value (16x16), or to any half-block value (8x8). This is recommended for new zones that don't need to have a specific size.
 * Dimensions (and Position)
 * Preset
 * '''Snap to 8x8 or 16x16 Grid

This lets us configure the rendering and camera settings for the current zone. The following settings are available:
 * Rendering and Camera
 * X Tracking/Y Tracking/BIAS to configure camera movement.
 * Screen Heights.
 * Zone Theme.
 * Terrain Lighting.
 * Visibility modes for the zone.
 * General Camera Tracking.

With those settings we can configure the invisible scrolling location.
 * Bounds

In the last section we can set the parameters for the background music and the sound modulation.
 * Audio
 * Background Music ID ranges from 1-27 for NSMBW songs, and from 100-157 for Newer songs. To add custom music, see Custom Music.
 * Sound Modulation changes the sound effect modulation.
 * Boss Flag is needed to allow proper music switching by sprites.