Polls

Default Game Speed

Log in to vote!

Latest Posts

Topic: documentation for "is" / terrain affinity

kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1771
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-02-11, 20:50

Is there somewhere a documention of the terrain property "is"? There are currently 7 values for that:

  1. green
  2. dry
  3. mountain
  4. water
  5. acid
  6. unpassable (only applied to greenland "swamp")
  7. dead (only applied to greenland "snow")

Some of them are selfexplaining, but some are not. What is the diference between "dead" and "acid"? Both are unpassable and dry (inarable)

The only values where buildings can be build, is "green" and "mountain" (only mines). "green" isn't very descriptive for this terrain type imho.

And there are the terrains affinites, which also plays around if a terrains is "green" (where plants can grow good or bad).

*confused*


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3058
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-02-11, 21:59

I'm afraid we only have the source code http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/logic/world/terrain_description.cc. The rules are:

init.lua C++
"green" GREEN
"dry" DRY
"water" WATER and DRY and UNPASSABLE
"acid" ACID and DRY and UNPASSABLE
"mountain" DRY and MOUNTAIN
"dead" DRY and UNPASSABLE and ACID
"unpassable" DRY and UNPASSABLE

The strings that get displayed in the Editor Info Tool http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/editor/tools/editor_info_tool.cc are:

  • GREEN = "arable"
  • DRY = "treeless";
  • WATER = "aquatic"
  • ACID = "dead"
  • MOUNTAIN = "mountainous"
  • UNPASSABLE = "unpassable"

The reason that these strings don't match up with the properties in the init.lua files is that people had already started making maps before we designed the strings, and we didn't want to break the maps. It's all a bit complicated, but I hope this helps...

Edited: 2015-02-12, 09:11

Busy indexing nil values

Top Quote
wl-zocker
Joined: 2011-12-30, 17:37
Posts: 494
Ranking
Tribe Member
Location: Germany
Posted at: 2015-02-11, 22:06

A quick search revealed this (in /world/terrains/init.lua):

Type of terrain. Describes if the terrain is walkable, swimmable, if mines or buildings can be build on it, if flags can be build on it and so on.

And to avoid confusion, a small dictionary for programmer's language and what is shown to the mapmaker:

Source code tooltip
green arable
dry treeless
mountain mountainous
water aquatic
acid dead
unpassable unpassable

My try for an explanation:

The default benavior is that flags can be set on the fields, but no buildings.

  • Green/arable allows normal buildings.
  • Mountains allow mines.
  • unpassable: If all triangles around a field are unpassable, no flag can be built. (But flags are possible at the border to other terrains.)
  • acid/dead: If at least one neighboring triangle has this property, no flags can be built. (It is not possible to build flags directly at the land - lava border.)
  • water: I am not sure what this actually means. Maybe for fishers/fish breeders/ships?
  • dry/treeless: I think this is not valid any more since we changed the way trees grow. I think I have seen mountains (which are "treeless") covered by trees.

Note that some properties include others. For example, water is only defined as is = "water", but the tooltip shows "water, unpassable and treeless". That happens probably here:
http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/editor/ui_menus/editor_tool_set_terrain_options_menu.cc

I think this explanation (once it is satisfactory) should be added to the Wiki somewhere. Otherwise, they will help the map maker very little. There has already been a bug report, see especially #8-#10 about outdated icons.

Edit: I did not see GunChleoc's post, but I hope my attempt to explain helps you. Btw, GunChleoc, your links do not work.

Edited: 2015-02-11, 22:11

"Only few people know how much one has to know in order to know how little one knows." - Werner Heisenberg

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1771
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-02-11, 23:24

GunChleoc wrote:

The reason that these strings don't match up with the properties in the init.lua files is that people had already started making maps before we designed the strings, and we didn't want to break the maps.

I understoud. Otherwise there is allready a hint about maps:

"This map requires a version of Widelands newer than build18!"

It's all a bit complicated, but I hope this helps...

Because of the hint there is no need to keep these old properties?

And what about the affinites? I ask, because i created a map with different terrains and wondering about trees do not grow, or very spare grows, even while the terrain is "green".

Because the terrain affinity isn't shown anywhere, i couldn't regard the affinity. The only thing i could regard is the "is" value, because it is shown in the terrain menu.

Maybe it would help to difference more between "is" and "affinity":

  • "is" should be values for how the terrain could be used, e.g. if it is arable (buildable), or unpassable and so on.
  • "affinity" should be used for the vegetation zone or climate zones. Instead of making three values for the affinity, there could be one keyword for each terrain.

Is it possible to make a switch button on the menus? If so, could it be made to switch the tabs from "is" values to "climate zone" values? Explainig: In normal view the terrains are shown in tabs for the "is" value: Buildable, unpassable, only walkable.... Clicking on the "switch button" will turn the tabs to: plants grow good, grow middle, grow bad.

Maybe my thoughts aren't finished yet... face-grin.png


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3058
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-02-12, 09:14

I am not familiar with the terrain affinity code.

@wl-zocker: thanks, WikiSyntax didn't like the links.

I understoud. Otherwise there is allready a hint about maps:

"This map requires a version of Widelands newer than build18!"

We had a big change after build18 ("One World"). People then submitted maps, and we didn't want to break things again.


Busy indexing nil values

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1771
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-02-12, 17:58

GunChleoc wrote:

@wl-zocker: thanks, WikiSyntax didn't like the links.

Its because of the double point...

We had a big change after build18 ("One World"). People then submitted maps, and we didn't want to break things again.

Understandable.

Maybe it would be the best, if the description of these strings is stored in the corresponding init.lua file http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/world/terrains/init.lua#L38

Suggestion:

-- Type of terrain. Describes the build possibilities while gameplay with following meanings:
-- "green": could contain normal buildings and roads
-- "mountain": could contain mines and roads
-- "dry": only roads possible
-- "water": no buildings, no roads, but swimmable (ships)
-- "acid"/"dead"/"unpassable": no buildings and no roads

The "swimmable" meaning of "water" is just guessed.

Not the best way, but maybe better as no explanation.

Edit: Thanks for clarifying face-smile.png

Edited: 2015-02-12, 18:00

Top Quote
gnarfk
Avatar
Joined: 2015-01-05, 16:18
Posts: 70
Ranking
Likes to be here
Location: France
Posted at: 2015-02-14, 10:22

there is a slight difference between unpassable and dead/acid.

We can build road on borders of unpassable zones, and cross very thin unpassable zones by roads .


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3058
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-02-14, 10:42

Does this work?

http://bazaar.launchpad.net/~widelands-dev/widelands/terrain_doc/revision/7404

I also suspect that acid and dead do the exact same thing.


Busy indexing nil values

Top Quote
wl-zocker
Joined: 2011-12-30, 17:37
Posts: 494
Ranking
Tribe Member
Location: Germany
Posted at: 2015-02-14, 12:31

I think that acid and dead are the exactly same thing (see https://wl.widelands.org/forum/topic/1652/?page=1#post-12458). Same goes for dry/treeless.


"Only few people know how much one has to know in order to know how little one knows." - Werner Heisenberg

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1771
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-02-14, 13:41

gnarfk wrote:

there is a slight difference between unpassable and dead/acid.

We can build road on borders of unpassable zones, and cross very thin unpassable zones by roads .

I think this is related to the dithering (which terrain covers an other terrain). The terrains are splitted into triangles and the corners are sometimes difficult to see. Next week i will try to explain this further. Today i couldn't because of not at home ....

GunChleoc wrote:

Does this work?

http://bazaar.launchpad.net/~widelands-dev/widelands/terrain_doc/revision/7404

I think so. BUt im unsure about the "trees don't like this terrain". Today it is maybe so, but in future we may need "unbuildable" terrains where trees could be grow good. Maybe some kind of jungle...

I also suspect that acid and dead do the exact same thing.

wl-zocker wrote:

Same goes for dry/treeless.

treeless isn't a value for "is".

Thats what i meant: The current values do not explain the fertility or the things what can be build or not.


Top Quote