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

 kaputtnik Joined: 2013-02-18, 19:48 Posts: 2456 OS: Archlinux Version: current master One Elder of Players Location: Germany Posted at: 2015-12-08, 22: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 Topic Opener Joined: 2014-09-15, 17:35 Posts: 1668 One Elder of Players Posted at: 2015-12-09, 04: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 Joined: 2013-10-07, 14:56 Posts: 3324 One Elder of Players Location: RenderedRect Posted at: 2015-12-09, 07: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 Topic Opener Joined: 2014-09-15, 17:35 Posts: 1668 One Elder of Players Posted at: 2015-12-09, 08: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, 08:41 Top Quote einstein13 Joined: 2013-07-28, 23:01 Posts: 1118 One Elder of Players Location: Poland Posted at: 2015-12-09, 13: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... einstein13calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/backup website files: http://kartezjusz.ddns.net/upload/widelands/ Top Quote GunChleoc Joined: 2013-10-07, 14:56 Posts: 3324 One Elder of Players Location: RenderedRect Posted at: 2015-12-09, 17: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 Joined: 2013-02-18, 19:48 Posts: 2456 OS: Archlinux Version: current master One Elder of Players Location: Germany Posted at: 2015-12-09, 17: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:https://wide-fighter.netlify.app/ Top Quote GunChleoc Joined: 2013-10-07, 14:56 Posts: 3324 One Elder of Players Location: RenderedRect Posted at: 2015-12-09, 17:14 kaputtnik wrote: If you find a solution my work on the wikipage was useless But still pretty Busy indexing nil values Top Quote GunChleoc Joined: 2013-10-07, 14:56 Posts: 3324 One Elder of Players Location: RenderedRect Posted at: 2015-12-10, 19:31 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, 19:32 Busy indexing nil values Top Quote kaputtnik Joined: 2013-02-18, 19:48 Posts: 2456 OS: Archlinux Version: current master One Elder of Players Location: Germany Posted at: 2015-12-10, 21: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:https://wide-fighter.netlify.app/ Top Quote