River under forest

Contribute, display and discuss art and tilesets for use in Freeciv here.
User avatar
mir3x
Veteran
Posts: 108
Joined: Sat Jan 30, 2016 6:17 pm

River under forest

Postby mir3x » Fri Aug 26, 2016 10:36 pm

Can i specify in tileset to draw river first, then forest ?
Otherwise I get something like this.
Attachments
t3.png
t3.png (8.78 KiB) Viewed 2831 times

User avatar
dunnoob
Elite
Posts: 326
Joined: Mon Dec 23, 2013 3:13 am
Location: Hamburg
Contact:

Re: River under forest

Postby dunnoob » Sat Aug 27, 2016 6:47 pm

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.

louis94
Hardened
Posts: 193
Joined: Thu Apr 25, 2013 10:17 pm
Location: Belgium

Re: River under forest

Postby louis94 » Sun Aug 28, 2016 12:25 pm

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

cazfi
Elite
Posts: 1505
Joined: Tue Jan 29, 2013 6:54 pm

Re: River under forest

Postby cazfi » Sun Aug 28, 2016 3:31 pm

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.

louis94
Hardened
Posts: 193
Joined: Thu Apr 25, 2013 10:17 pm
Location: Belgium

Re: River under forest

Postby louis94 » Fri Sep 02, 2016 6:17 pm

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 2751 times

Louis

User avatar
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

Re: River under forest

Postby GriffonSpade » Sat Sep 10, 2016 1:16 am

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.

louis94
Hardened
Posts: 193
Joined: Thu Apr 25, 2013 10:17 pm
Location: Belgium

Re: River under forest

Postby louis94 » Sun Sep 18, 2016 11:08 pm

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