1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-12-26 14:45:48 +00:00
11 layers
False.Genesis edited this page 2018-12-27 02:32:51 +01:00

The game uses layers to order the rendering of graphics. Layers are updated and drawn in order, starting from the lowest layer to the highest. That means the top (last drawn) layer is drawn over everything else.

The editor maps the 9 regular layers to the number keys 1-9 (the top row; the numpad keys are used for tile effects), the 6 parallax layers to the bottom row starting from B, N, M + the 3 keys following to the right (Comma, Period, Slash), and the dark layer (J).

Internally, the game uses a lot more layers, but only some are available in the editor. The rest can be accessed via scripting.

Regular layers

  • Number keys 1-9
  • No special properties
  • Detailed info:
    • (Parallax layers come somewhere around here)
    • Layers 1, 2, 3: Behind the black background
    • Layer 4: The black background is located here.
      • While you are in the editor: When tiles are moved to the front they are in front of the background; when they are moved to back, they are behind the background.
      • When the map is loaded, tiles will always be under the black background! (Their relative order stays the same, just the black background is added after the game engine has loaded the map, which means it will be drawn over every tile on the map.)
        • Which in turn implies that if you change the relative order mid-game via scripting, then things might be drawn in front of the black background.
      • All layers after this are in front of the black background
    • Layer 5: Auto-generated wall tiles are placed here. See Map basics. Do not use this layer for your own tiles unless you know what you are doing.
    • Layers 6, 7: In front of the previous layers but still behind entities.
    • (Entities & particles come somewhere around here)
    • Layers 8, 9: In front of everything else.
    • (The dark layer comes somewhere around here)
  • There is an editor bug that sometimes assigns parallax properties to tiles moved from parallax layers to normal layers. You will notice if tiles on the regular layers suddenly move slower than the camera. If this happens to you, save the map, reload, then put the tile where it's supposed to go. Don't even try to arrange the tiles right before reloading, that will do more harm than good.

Tips / typical layer use:

  • Layer 1: Non-parallax-scrolling repeat backgrounds
  • Layer 2: Tiles to cover up backgrounds for variation or to mask transitions between different background graphics
  • Layer 3: Background plants and decoration
  • Layer 4: Drop shadows
  • Layer 5: DO NOT USE
  • Layer 6: Foreground plants and decoration
  • Layer 7: Rarely a need to use this; spare
  • Layer 8: Covering foreground plants, decoration, overlays
  • Layer 9: Cover blackness to mask tile transitions or to fade out parts of foreground tiles; light pillars, overlays

Parallax layers

Parallax layers are "far-away" background layers that scroll slower than the rest of the screen. They contribute to the perception of depth and are solely used for decoration and backgrounds.

They are located on keys B, N, M, Comma, Period, Slash (bottom row on the keyboard). For simplicity this wiki calls them P1 (B) .. P6 (Slash), where P1 is furthest in the background.

Be warned that parallax layers are a bit fiddly to work with in the editor at first; they take some getting used to.

First lesson: When you see a tile in the editor and try to grab it to move it, it's not where you expect it to be! The best way to grab a tile on a parallax layer is to position the camera in such a way that the center of the screen and the center point of the tile coincide. When you then move the mouse cursor over the tile it will be selected. Zooming in more also helps.

Second lesson: The most efficient way to move a tile is to grab it, keep holding it, and drag the camera around with the middle mouse button. Then the tile will move with the camera. When you are not zoomed out too much this gives a good estimate where the tile will actually end up.

Third lesson: When you place tiles on parallax layers keep in mind that they move slower than the camera. This means that, during regular gameplay, they can appear in places where they look disconnected from the background or out-of-place. This is actually the hardest part of making nice parallax backgrounds. You need to use the layers efficiently in such a way that the closer parallax layers move faster than the further away ones, and use this to cover up tiles from back to front.

The only way to make sure that everything looks good is to set the camera the minimum and maximum expected zoom level each in that map area and swim around. If everything looks good you're done!

It helps to adjust the design of your maps to accommodate for this. The player can't move the camera very far in small areas. So keeping parallax areas small makes things a lot easier.

Having a wide-screen resolution also helps. 4:3 or 5:4 resolutions are not a problem to arrange backgrounds for, but the wider the screen gets the harder it is to keep parallax tiles under control. What matters in the end is that it looks good on the end-user's side. You'll have to decide for yourself which aspect ratio you're going to support; ie. if a resolution this wide is still realistic or if Full HD is enough:

Super-wide resolution screenshot

(And don't forget looking around exists -- E key by default or middle mouse button. This enlarges the space players can see!).

The Dark Layer (J)

Press J to select.

The dark layer is special. It's used in conjunction with e.g. sun form to darken the screen and to enable lighting up areas. For easier use the editor draws it like a normal layer, but in-game it looks differently: Tiles placed on the dark layer are then used to modulate the color of the layers underneath it. You can press Alt+J to toggle the dark layer; it stays disabled until you re-enable it.

Dark layer

Rules of thumb:

  • Bright colors on the dark layer remove darkness
  • Dark colors on the dark layer add darkness
  • Colors in general add sort of a "tint" and can be used to modulate colors underneath.

As on every layer, the order of things drawn on the dark layer is important: If you have a black graphic covering a large area and a small white graphic is drawn afterwards (ie. is on top) then you will have a small hole (visible area) in a sea of blackness.

If the white graphic was drawn first it would be overdrawn by the black one and thus everything would be black. Therefore don't forget to move things that are meant to add some sort of light to the front, and things that add darkness to the back. The same applies for adding things on the dark layer via scripting.

Minimap and world map control

When you're inside of a tile on the dark layer, the minimap gets blacked out and the world map gets disabled similar to when you are inside of a RADARHIDE node, except that when in sun form, everything functions normally.

This is a hard-coded feature. TODO: document OSE overrides