From The Mana World
m (User:Jaxad0127/Map layers moved to Map layers proposal: It's ready for it)
m (Organize better, add some more info, and and the correct templates)
Line 1: Line 1:
{{Status_red}}
{{Opinions
|
{{Pro|jaxad0127}}
|
}}
{| border="1" cellpadding="5" cellspacing="0" style="float: right;"
{| border="1" cellpadding="5" cellspacing="0" style="float: right;"
|+ Example of map layers
|+ Example of map layers
Line 44: Line 51:
::...
::...


Maps can have an unlimited number of layers, each one drawn in order by the client. There are two (or three, see below) special layers: fringe and collision. The fringe layer is where beings are drawn, intermixed with the layer's content. The collision layer isn't drawn, but defines where beings can walk and move between action layers. To allow more complex mapping, we must allow for multiple fringe/collision layer pairs, each pair defining a distinct action layer. To tell which layers are fringe/action layers, we could use either the layer name or set a layer property. If we use the name method, each pair could use a different number to define it's action layer or (more preferred) we use their relative positions to define their action layer. The second method is preferred as it's more intuitive and the first could cause situations where, for example, layer 1 is below layer 0. An action layer would consist of every map layer between the previous collision layer (if there is one) and the next collision layer). To make it easier for the players, action layers above them could be drawn with increasing transparency.
== Basics ==
 
Maps can have an unlimited number of layers, each one drawn in order by the client. There are two (or three, see below) special layers: fringe and collision. The fringe layer is where beings are drawn, intermixed with the layer's content. The collision layer isn't drawn, but defines where beings can walk and move between action layers. To allow more complex mapping, we must allow for multiple fringe/collision layer pairs, each pair defining a distinct action layer. To tell which layers are fringe/action layers, we could use either the layer name or set a layer property. If we use the name method, each pair could use a different number to define it's action layer or (more preferred) we use their relative positions to define their action layer. The second method is preferred as it's more intuitive and the first could cause situations where, for example, layer 1 is below layer 0. An action layer would consist of every map layer between the previous collision layer (if there is one) and the next collision layer).
 
== Particle Engine ==
The particle engine could be left as it is, but that prevents lower actions layers from using the engine to it's fullest. To resolve this, I have outlined some changes that could be made below.


The particle engine would only need some minor changes. A layer height (''h'' either map layer or action layer) needs to be defined. Particle processing would need to be move to before map drawing. Instead of immediately drawing each particle, they'd be moved into queues depending on their height, one queue for each (action) layer. Particles whose z-pos are between 0 and ''h'' are in the first queue, between ''h'' and 2 * ''h'' are in the second queue, etc. Negative heights are in a another queue and drawn before any layer. After each (action) layer is drawn, all particles in the queue are drawn as well. They could also be drawn interspersed with the tiles, though this could cause problems. If the queues are per action layer, they could be drawn in one of three ways:
The particle engine would only need some minor changes. A layer height (''h'' either map layer or action layer) needs to be defined. Particle processing would need to be move to before map drawing. Instead of immediately drawing each particle, they'd be moved into queues depending on their height, one queue for each (action) layer. Particles whose z-pos are between 0 and ''h'' are in the first queue, between ''h'' and 2 * ''h'' are in the second queue, etc. Negative heights are in a another queue and drawn before any layer. After each (action) layer is drawn, all particles in the queue are drawn as well. They could also be drawn interspersed with the tiles, though this could cause problems. If the queues are per action layer, they could be drawn in one of three ways:
Line 52: Line 64:
*:This layer  would be named particle and could include other tiles so the particles are drawn interspersed with them. This option could be combined with one of the other two as a fall back for when this layer isn't specified. Particle effects would also need an initial height (either in engine units or in layers).
*:This layer  would be named particle and could include other tiles so the particles are drawn interspersed with them. This option could be combined with one of the other two as a fall back for when this layer isn't specified. Particle effects would also need an initial height (either in engine units or in layers).
Doing the particles per action layer is preferred over per map layer to prevent particles from being hidden (see [http://mantis.themanaworld.org/view.php?id=188 Mantis 188] for a similar effect) and to reduce the number of queues and amount of math.
Doing the particles per action layer is preferred over per map layer to prevent particles from being hidden (see [http://mantis.themanaworld.org/view.php?id=188 Mantis 188] for a similar effect) and to reduce the number of queues and amount of math.
== Drawing ==
To make it easier for the players, action layers above them could be drawn with increasing transparency. This also makes the changes outlined above for the particle system more worthwhile and taller maps (with more action layers) more interesting.
== Battle ==

Revision as of 19:06, 7 August 2008

This article is currently only a proposal

The features or design guidelines described in this article are only a proposal made by one or some persons. It has not been evaluated or accepted by the core development team yet. Feel free to add your personal opinion about them or make counter proposals.

People who approve this proposal People who oppose this proposal
Example of map layers
Map (Name) Action
...
10 2
9 (Collision) 1
8
7
6 (Fringe)
5
4 (Collision) 0
3
2 (Fringe)
1
0

This is a proposal to resolve Mantis 21 and Mantis 188 and implement Action layers.


Some definitions:

Layer
A layer in the map file
Action Layer
Multiple layers in a logical group of map layers where beings can walk:
Action layer 0 is the lowest
Action layer 1 is the next one
...

Basics

Maps can have an unlimited number of layers, each one drawn in order by the client. There are two (or three, see below) special layers: fringe and collision. The fringe layer is where beings are drawn, intermixed with the layer's content. The collision layer isn't drawn, but defines where beings can walk and move between action layers. To allow more complex mapping, we must allow for multiple fringe/collision layer pairs, each pair defining a distinct action layer. To tell which layers are fringe/action layers, we could use either the layer name or set a layer property. If we use the name method, each pair could use a different number to define it's action layer or (more preferred) we use their relative positions to define their action layer. The second method is preferred as it's more intuitive and the first could cause situations where, for example, layer 1 is below layer 0. An action layer would consist of every map layer between the previous collision layer (if there is one) and the next collision layer).

Particle Engine

The particle engine could be left as it is, but that prevents lower actions layers from using the engine to it's fullest. To resolve this, I have outlined some changes that could be made below.

The particle engine would only need some minor changes. A layer height (h either map layer or action layer) needs to be defined. Particle processing would need to be move to before map drawing. Instead of immediately drawing each particle, they'd be moved into queues depending on their height, one queue for each (action) layer. Particles whose z-pos are between 0 and h are in the first queue, between h and 2 * h are in the second queue, etc. Negative heights are in a another queue and drawn before any layer. After each (action) layer is drawn, all particles in the queue are drawn as well. They could also be drawn interspersed with the tiles, though this could cause problems. If the queues are per action layer, they could be drawn in one of three ways:

  • After the fringe layer
  • After the collision layer (and therefore after the action layer itself)
  • After a new special layer
    This layer would be named particle and could include other tiles so the particles are drawn interspersed with them. This option could be combined with one of the other two as a fall back for when this layer isn't specified. Particle effects would also need an initial height (either in engine units or in layers).

Doing the particles per action layer is preferred over per map layer to prevent particles from being hidden (see Mantis 188 for a similar effect) and to reduce the number of queues and amount of math.

Drawing

To make it easier for the players, action layers above them could be drawn with increasing transparency. This also makes the changes outlined above for the particle system more worthwhile and taller maps (with more action layers) more interesting.

Battle