Latest Posts

Topic: wouldn't it be nice to have a minable tree-friendly terrain?

kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-12-08, 23:04

terrain_r() and terrain_d() are the terrains in the triangles right(=r) and down(=d) of the actual field (where field is the node) It's explained in http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/graphic/game_renderer.cc#L38 as far as i understand.....


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

Top Quote
king_of_nowhere
Avatar
Topic Opener
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-12-09, 05:50

calculating the probability of trees growing is complicated by the fact that trees can also generate spontaneously, and their probability of doing so is dependant on the trees around them. As I once remarked, you can't really define the probability of growing a tree, because an open field will have one value, while a field divided by roads and dotted with buildings will have a lower one. certainly calculating the likelihood of a single tree growing from sapling to old is not indicative of the amount o logs you can get from a forester and woodcutter. So in the end running a test with foresters and woodcutters and seeing how many logs are produced is the best approximation, and the only realistic test.


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

The probability to grow for an actual tree depends on all kinds of stuff, because they grow on nodes and not on terrains. We could still have a note on how good a terrain is for each tree type though.


Busy indexing nil values

Top Quote
king_of_nowhere
Avatar
Topic Opener
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-12-09, 09:13

yes, of course we can do that. i was merely stating that we can't simply calculate the percentages by taking the equations saying if a tree grows one more step or dies and feeding them to a program, because there are many other variables.

Edited: 2015-12-09, 09:41

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

Calculating probability of growth is not very complicated. For exact situation. There is many factors, but I assume that there is a possibility to simplify, to approximate the result.

Calculating probability of growth for any situation is a bit more complicated, but still doable. There are finite equations for all you want here face-smile.png There is also a possibility to calculate how good the terrain (or terrain mix) is for the forester, but it needs a bit more calculations to do so face-wink.png

Finding good equations for all terrain types & mixes is the second thing I want to do for Widelands. And it is waiting for a long time... face-sad.png


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

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

What I am planning for the in-game help is a simple refactoring of the code - at the moment, the code creates an average terrain affinity of the terrains surrounding a node, and then applies the results. I will pull out the formula so we can calculate the same for 1 piece of terrain. Giving information on terrain combinations would be a bit much for starters.


Busy indexing nil values

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

Yes, having the trees for one terrain is enough to know. There could be a hint on mixed terrains like "Be aware that trees will grow different if terrains are mixed."

If you find a solution my work on the wikipage was useless face-grin.png


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

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

kaputtnik wrote:

If you find a solution my work on the wikipage was useless face-grin.png

But still pretty face-smile.png


Busy indexing nil values

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-12-10, 20:31

Branch: https://code.launchpad.net/~widelands-dev/widelands/editor_help

It still needs a bit of C++ refactoring, and the information for each entry should be sorted according to percentage.

We should also add the new Lua functions to the test suite.

Edited: 2015-12-10, 20:32

Busy indexing nil values

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-12-10, 22:34

The editor help should be discussed in another topic i think face-smile.png

The forested mountains are now proposed to merge. If a developer approves it, it will be merged and soon become available. If it will not be approved, it took a little more time to get into the game...


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

Top Quote