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

kaputtnik |
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: |

king_of_nowhere |
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 |
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 |
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 |
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 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 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... einstein13 |

GunChleoc |
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 |
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 Fight simulator for Widelands: |

GunChleoc |
Posted at: 2015-12-09, 18:14
But still pretty Busy indexing nil values Top Quote |

GunChleoc |
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 |
Posted at: 2015-12-10, 22:34
The editor help should be discussed in another topic i think 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: |