Page 1 of 1

River under forest

Posted: Fri Aug 26, 2016 10:36 pm
by mir3x
Can i specify in tileset to draw river first, then forest ?
Otherwise I get something like this.

Re: River under forest

Posted: Sat Aug 27, 2016 6:47 pm
by dunnoob
mir3x wrote:Can i specify in tileset to draw river first, then forest ?
Untested theory: Rivers are natural roads, natural roads are roads, roads are extras, and extras are drawn on top of the terrain. There are still lots of gaps in what I understand, including "what is a darkness layer" and "what is a blend layer", but I guess that both won't help for your problem.

Re: River under forest

Posted: Sun Aug 28, 2016 12:25 pm
by louis94
tilespec.h:115

Code: Select all

/* Items on the mapview are drawn in layers.  Each entry below represents
 * one layer.  The names are basically arbitrary and just correspond to
 * groups of elements in fill_sprite_array().  Callers of fill_sprite_array
 * must call it once for each layer. */
enum mapview_layer {
  LAYER_BACKGROUND,
  LAYER_TERRAIN1,
  LAYER_TERRAIN2,
  LAYER_TERRAIN3,
  LAYER_WATER,
  LAYER_ROADS,
  LAYER_SPECIAL1,
  LAYER_GRID1,
  LAYER_CITY1,
  LAYER_SPECIAL2,
  LAYER_FOG,
  LAYER_UNIT,
  LAYER_SPECIAL3,
  LAYER_CITY2,
  LAYER_GRID2,
  LAYER_OVERLAYS,
  LAYER_TILELABEL,
  LAYER_CITYBAR,
  LAYER_FOCUS_UNIT,
  LAYER_GOTO,
  LAYER_WORKERTASK,
  LAYER_EDITOR,
  LAYER_COUNT
};
tilespec.h:147

Code: Select all

#define mapview_layer_iterate(layer)              \
{                                                 \
  enum mapview_layer layer;                       \
                                                  \
  for (layer = 0; layer < LAYER_COUNT; layer++) { \

Any extra with style "river" is drawn on layer "LAYER_RIVER", above the three terrain layers. There is no way to change this, but adding configuration of the layer drawing order would be feasible (if the three terrain layers can be separated).

Louis

Re: River under forest

Posted: Sun Aug 28, 2016 3:31 pm
by cazfi
I just added the layer configuration stuff to my TODO a week ago (mainly for alio forest/river in 3.0). Feel free to submit patch if you beat me to it.

Re: River under forest

Posted: Fri Sep 02, 2016 6:17 pm
by louis94
Drawing only the first 10 layers (hardcoded) was very straightforward. In fact, I can use any given order -- what's missing is loading.
Spectacle.E12434.png
I wonder if the layer order should be fully configurable, or if some layers should be locked (background, goto, editor, …).

Edit:
In Amplio, hills are drawn on the same layer as forests. So both of them rivers are either above or below rivers. But it can be changed :)
Rivers below.png
Rivers below.png (61.55 KiB) Viewed 7985 times
Louis

Re: River under forest

Posted: Sat Sep 10, 2016 1:16 am
by GriffonSpade
dunnoob wrote:
mir3x wrote:Can i specify in tileset to draw river first, then forest ?
Untested theory: Rivers are natural roads, natural roads are roads, roads are extras, and extras are drawn on top of the terrain. There are still lots of gaps in what I understand, including "what is a darkness layer" and "what is a blend layer", but I guess that both won't help for your problem.
Darkness Layer is drawn on explored tiles next to unexplored tiles. It's what creates the 'spillover' look. In 2.4 it was always drawn over layer0, so anything on layer1 or layer2 (mountains, hills, trees, etc.) would wind up being drawn over top the darkness. In 2.5 it was changed to allow it to be drawn over any of the layers desirable, and in A6B 2.5 I chose to draw it over layer2 (With a gradient, of course).

Blend Layer is that dithering effect where the adjacent tile is dithered over its neighbors, which gives tiles their 'speckled' borders instead of clean ones. I do believe by default it uses the other terrain's own tiles for it, but can be set to alternate tiles. For example, ocean tiles might have sandy-colored blending tiles set so that the grassland next to it gets sand on it rather than water.

Re: River under forest

Posted: Sun Sep 18, 2016 11:08 pm
by louis94
This will be possible in Freeciv 3.0 See patch #7667

By adding a new key to the tileset,

Code: Select all

layer_order = <comma-separated string list>
one will be able to configure the drawing order of map layers. See here for an example of how it might look like. You'll also find there a brief explanation of what's drawn on each layer.

Louis