Latest Posts

Topic: To all map creators; Terrain menu

SirVer

Joined: 2009-02-19, 15:18
Posts: 1445
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2015-03-28, 18:32

It looks as if trees were forgotten when the decision was made.

No, this is very much not the case - in fact trees cost me the most time when doing the one world merge. The feature is called terrain affinity, and it remains very difficult. For a full rundown, read on and read these three bugs in order:

https://bugs.launchpad.net/widelands/+bug/1328635
https://bugs.launchpad.net/widelands/+bug/1348800
https://bugs.launchpad.net/widelands/+bug/1430494

Before one world, every tree had a 'probability of growing' for each terrain - there were at most 16 terrains in a world, so we used 16 num of trees numbers for each world. Usually there were 8 trees, so we had 816 = 128 values per world. Merging the worlds, the numbers exploded and this became unfeasible: we now have ~64 terrains and ~30 trees, so we would need to tweak 1920 numbers. Also adding one terrain or one new tree would mean you need to add 30 or 64 new numbers into the system. So I decided to try to calculate probabilities out of a model.

The model we came up with is a gaussian one that compares a trees four values (preferred humidity, preferred temperature, preferred fertility and pickiness) against the 3 values a terrain (humidity, temperature, fertility). The better they match, the more likely it is that the tree grow. This only needs 644 + 303 = ~350 numbers. And adding a terrain means only 3 new values, for a tree 4 new values.

The values for these numbers were chosen to be 'physically feasible' at first, but with that the tree growth was too sparse on most maps. So the values have been retuned to be as close as possible to the original probabilities from build 18 using numeric optimization. These are the values we use right now at trunk.

Apparently, they are still not good enough - since there is a new bug open on the topic. It seems that the physical model is not flexible and not precise enough to express what players and mapmakers want. So something else must be tried. One important thing to keep in mind though is that we have a ton of old maps and we must still be able to load these maps and play games on them - i.e. backwards compatibility is super important for maps. So if we introduce a new concept - like for example the tree resources - we must have an idea how to backfill the tree resources from maps that have been created before they were available.


Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-03-28, 19:42

I agree with SirVer and want to say many thanks for his explanations.

But this issue shouldn't also discussed in this topic ....

This topic is about the design of the terrain menu. The result of implementing trees does maybe affect this menu but the concrete implementing of trees has nothing to do with the design of the menu. face-smile.png


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-03-28, 21:46

SirVer wrote: we now have ~64 terrains and ~30 trees

There is 50 terrain types (possible to grow), 7 types of water/swamp/ice possible to stand next to the tree and 22 tree types (according to 7428). But the whole system of numbers (57*22) is still big number: 1254 (instead of 1920).

@kaputtnik:

But this issue shouldn't also discussed in this topic ....

It is the correct place. Or you will have mix of non-related terrain types in your menu.

We can simply devide it into groups like: fertile terrain types, deserts, then mountains, waters, not passables. It should be much easier then face-smile.png


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-03-29, 12:25

einstein13 wrote:

There is 50 terrain types (possible to grow), 7 types of water/swamp/ice possible to stand next to the tree and 22 tree types (according to 7428). But the whole system of numbers (57*22) is still big number: 1254 (instead of 1920).

The problem here is: The menu has to show which tree grow on which terrain to prevent the disappointment king_of_nowhere has with the archipelago. In case we find a solution for showing all the tree types on the terrains in the menu, the mapmaker has to think of which tree he would like on his map and then choose the terrains. That could be fine, but if the terrains do not fit the coloring the mapmakers imagination, he get disappointet again.


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-03-29, 14:44

I think tree resources could be made, and they could also be retroactively compatible. It would simply have to be a facultative thing. you don't have to set them. if you don't set tree resources (which would be good for most maps) then the trees are chosen according to fertility and humidity and temperature. If you put tree resources, only the selected trees can grow there - while still taking into account fertility and humidity. the tree growth will be exactly the same, except that only trees of the approved kind can spawn there. and if one does not set that option up, then the map behaves as it does right now, so it's still retrocompatible - and people making a map that is not thematically tied to a particular kind of trees don't neeed to be bothered by it.


Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-03-29, 19:26

kaputtnik wrote:

but if the terrains do not fit the coloring the mapmakers imagination,

I don't get the point here: why coloring is so important? I understand that you want to produce "beautiful" map, but imagine that in the future somebody will change the textures. What happened then? Your "beautiful" map become "ugly", because color will change? For me better solution for making maps is to make them playable, then "beautiful". There is number of maps which are only "beautiful", but I've never seen anybody playing them.

And if you want to create another types of soils, just do it. It is simple now face-smile.png Especially when you want to create special soils for special types of trees. face-wink.png


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-03-29, 20:11

einstein13 wrote:

For me better solution for making maps is to make them playable, then "beautiful".

Yes, thats the main difference between your point of view and mine face-smile.png But beautiful maps could also be playable face-tongue.png

And if you want to create another types of soils, just do it. It is simple now face-smile.png Especially when you want to create special soils for special types of trees. face-wink.png

We will see face-smile.png


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
fk
Avatar
Joined: 2013-07-30, 22:58
Posts: 151
Ranking
At home in WL-forums
Posted at: 2015-03-30, 09:53

einstein13 wrote:

For me better solution for making maps is to make them playable, then "beautiful".

If appearance of the map doesn't matter, then why so much trouble to enable mixing of terrain types? This sounds like a hapless decision in order to achieve something that it disables.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-03-30, 11:55

king_of_nowhere wrote:

I think tree resources could be made, and they could also be retroactively compatible. It would simply have to be a facultative thing. you don't have to set them. if you don't set tree resources (which would be good for most maps) then the trees are chosen according to fertility and humidity and temperature. If you put tree resources, only the selected trees can grow there - while still taking into account fertility and humidity. the tree growth will be exactly the same, except that only trees of the approved kind can spawn there. and if one does not set that option up, then the map behaves as it does right now, so it's still retrocompatible - and people making a map that is not thematically tied to a particular kind of trees don't neeed to be bothered by it.

This sounds like something that could be implemented, if we want it. It is a restriction rather than a resource though, so we should call it that - also, we can't make it a resource, because that would collide with setting water resources. Implementation might be less trivial than it sounds, but this would certainly be doable.


Busy indexing nil values

Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-03-30, 12:22

fk wrote:

einstein13 wrote:

For me better solution for making maps is to make them playable, then "beautiful".

If appearance of the map doesn't matter, then why so much trouble to enable mixing of terrain types?

I didn't tell any word that the appearance of map doesn't matter. face-smile.png


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote