Topic: Trees and Terrains
Tibor |
Posted at: 2015-07-04, 21:28
Good point, I have not mentioned it but I believe that same terrains have "no trees" attribute, this would be preserved. Or even better, we can have another specific biome "no trees". This could be more "systematic" approach. Top Quote |
king_of_nowhere |
Posted at: 2015-07-05, 09:32
thanks kapputtnik, can you also give me the full equation used so i can have an idea of how much tweaking a value will affect the growth?? I think i see where the problem arise. the difference in temperature between the different terains are fairly low (ice is 240 to 260, and desert is 300 to 320), and many palms hhave a low pickiness, so the different temperature won't affect them much. I have a plan to change the values, according to the following general scheme
summer - - - - - - - - - - - - - - - - - - - - - - - - - - - - high - - - - - - - - - - - - - - - high - - - - - - - - - - - - - - - -- high greenland - - - - - - - - - - - - - - - - - - - - - - - - - - medium - - - - - - - - - - - - - medium - - - - - - - - - - - - - - medium wasteland - - - - - - - - - - - - - - - - - - - - - - - - - - medium - - - - - - - - - - - - - high - - - - - - - - - - - - - - - - - low iceland - - - - - - - - - - - - - - - - - - - - - - - - - - - - low - - - - - - - - - - - - - - - - low - - - - - - - - - - - - - - - - - - high At least, that referring to the green terrain types. I intend to make those values different enough that trees of the wrong biome will have a difficult time growing on the wrong biome, while the values within the same biome will be closer. Furthermore, I intend to set for every biome at least one kind of tree perfectly adapted, with ideal values falling in the middle of the biome range, but with high pickyness, and one with values somewhat distant, but lower pickiness. so the specialized tree will grow preferrably in a homogeneous terrain, while the generalistic tree will grow on the boundaries. a generalistic tree will occasionally be found in the wrong biome, but that's intended; it's the occasional palm that can spread to a temperate zone, or the occasional deciduous that will grow in cold climates too. but there won't be palms growing in the middle of the snow. However, to make it work, I need to know the equation. And if I can say it, using a program to find values for the trees was a bad idea. not only it was unreliable, but doing it manually would have probably been faster than making a program just for that. Edited: 2015-07-05, 09:36
Top Quote |
kaputtnik Topic Opener |
Posted at: 2015-07-05, 12:11
Sorry, no. I try'd myself to get this idea, but i am not able to understand the math behind it. At einstein's page (see his Signature) there is a explanation. I think there are more than one equatation necessary to get the resulting values. Einstein could may explain...
The program was used to get the current values as close to the values we have before the one world merge. This should made growing of trees on older maps as close to the behavior when the map is made. See https://bugs.launchpad.net/widelands/+bug/1348800 for more info. I like Tibors idea. Do you think old maps could be compatible with this idea? Top Quote |
king_of_nowhere |
Posted at: 2015-07-05, 18:45
I'd checked both einstein's signature and the bug report, but i have not found the equation i seek. in particular einstein's page has all imaginable equations in treatment of trees, except the one where it tells you how to calculate the actual probability of a tree growing or dieing. well, I can try to do some blind changing anyway. i willl post the file with the new values and then someone may try to implement them and see it they work Top Quote |
einstein13 |
Posted at: 2015-07-06, 01:34
To calculate the probability of growth we need values:
Mean ground is standard mean value between all 6 connected parts in single point where the tree lives. For one type of soil it will be just the value of the soil. For (example) coast it will be mix of soil and water. Then we use equations:
That is all what Widelands is calculating right now. I don't know how often it is calculated (the same time period or different for each tree type?). I know only that it is working, but not perfectly. Also it is good to notice that (basic power equation):
And that is why the function is looking a bit strange. Edited: 2015-07-07, 12:10
einstein13 |
king_of_nowhere |
Posted at: 2015-07-06, 03:58
i tried to manually tweak the values in those datsheets. i also indicated for each ttree where it is supposed to grow, anf for the terrains if they are supposed to grow anything. someoe could try to implement those values in the code and see if they work. unfortunately, i have no idea how to upload a file, so sommeone also has to explain me that. Top Quote |
kaputtnik Topic Opener |
Posted at: 2015-07-06, 07:56
Thanks einstein for the explanation.
There is currently no possibility to upload files to widelands.org. So you could make an account on launchpad (where the bugs are reported) or use another file hoster. But why do you not try your new values for your self? The files where the values are set are simple text files. You could find them in your widelands data folder:
Top Quote |
king_of_nowhere |
Posted at: 2015-07-06, 21:53
thanks, i will. just two questions: i openend the init.lua file and i see it's quite messy; I would have to rewrite manually every single value, one by one. for 3 values for 62 terrains it is quite a lot. is there any faster way to do it? and if i go to a new line for every terrain type (i mean, just pressing enter) to make it more readable, wiill the file stil work? Top Quote |
einstein13 |
Posted at: 2015-07-06, 22:06
From my point of knowledge lua scripting language: you can make any spaces https://en.wikibooks.org/wiki/Lua_Programming/whitespace And I don't know any good way to change all values at once. Sorry einstein13 |
kaputtnik Topic Opener |
Posted at: 2015-07-06, 23:07
Normally its a well structured file... if you change some of the values please use a simple text editor (nothing like "Word", "wordpad" or "Libre/Open office")
Did someone say that it is an easy job?
No, as i know. It's just work.... With a good editor or with regular expressions its maybe easier. But it's a lot of work in anyway... sorry. In the beginning you see the lot of work, but if you've begun, with every changed value the less values you have to change Top Quote |