Patch: Tree line height
Moderator: OpenTTD Developers
Patch: Tree line height
When playing arctic maps, I have often been irritated on the fact that trees get everywhere, even where there is snow. Snow -> minus degrees -> no growth, right?
Anyway, I decided to go for it and therefor present my first patch!
It allows the user to set a tree line height, that is, a height at which no trees grow above, at the begining of a game.
Enjoy not having your alps covered in trees. New in current version: The patch applied itself to all climates (instead of just arctic). Solved now though
Anyway, I decided to go for it and therefor present my first patch!
It allows the user to set a tree line height, that is, a height at which no trees grow above, at the begining of a game.
Enjoy not having your alps covered in trees. New in current version: The patch applied itself to all climates (instead of just arctic). Solved now though
- Attachments
-
- treelineheight_3.diff
- Diff against 19135
- (23.57 KiB) Downloaded 424 times
Last edited by loclahost on 15 Feb 2010 12:19, edited 9 times in total.
Re: Patch: Tree line height
Wow, that is a really simple but effective patch and could make it into trunk due to its simplicity and effectiveness
Re: Patch: Tree line height
Cool. Nice patch.
2 problems however.
I got a crash when i tried to plant trees on the open snow.
And also i looks kinda strange with forest industries in the open with no trees, only snow.
EDIT: crash log added.
2 problems however.
I got a crash when i tried to plant trees on the open snow.
And also i looks kinda strange with forest industries in the open with no trees, only snow.
EDIT: crash log added.
- Attachments
-
- crash.log.zip
- (1.31 KiB) Downloaded 257 times
Re: Patch: Tree line height
I think the treeline should be defined totally separately from the snowline, it looks wierd having no trees at all above the snow line...
Re: Patch: Tree line height
It is defined separately. Just the crash needs to be fixedZephyris wrote:I think the treeline should be defined totally separately from the snowline, it looks wierd having no trees at all above the snow line...
- Attachments
-
- screenshot_004.png (34.62 KiB) Viewed 11555 times
Re: Patch: Tree line height
Ah, fair enough, good work then!
Re: Patch: Tree line height
Very well done indeed, I like this idea.
One suggestion: allow a transition of let's say 2 height levels where only small trees grow. That way trees don't just stop all of a sudden, but actually show that they have a hard time growing at greater height.
One suggestion: allow a transition of let's say 2 height levels where only small trees grow. That way trees don't just stop all of a sudden, but actually show that they have a hard time growing at greater height.
Re: Patch: Tree line height
Thanks a lot for all the positive comments guys. As you can see in the first post I've updated it against todays trunk and fixed the assert.
On the other hand there's new mountains, like the alps, which are rather steep. On such mountains, the effect of thinning out the trees is almost nonexistent. You can go from compact forest to only grass in just a couple of hundred meters (been there, done that ).
But thanks for the idea anyway, I'll look into it.
Well, that depends on the type of mountain really. Old and compartivly flat mountains, like the swedish "fjällen" usually have a height intervall where trees get smaller and more far between.FooBar wrote: One suggestion: allow a transition of let's say 2 height levels where only small trees grow. That way trees don't just stop all of a sudden, but actually show that they have a hard time growing at greater height.
On the other hand there's new mountains, like the alps, which are rather steep. On such mountains, the effect of thinning out the trees is almost nonexistent. You can go from compact forest to only grass in just a couple of hundred meters (been there, done that ).
But thanks for the idea anyway, I'll look into it.
Re: Patch: Tree line height
just a remark: you might want to check whether this is compatible with moving snow line (implemented in some newgrfs)
Re: Patch: Tree line height
Since trees don't move with the snowline, that should not be a problem. My code only introduces another condition as to whether trees can be planted on a tile. This condition has nothing to do with the snowline, except for sharing its maximum and minimum limits (which, I guess, is only used before the game starts).
Updated the diff against the current trunk: 18866
Updated the diff against the current trunk: 18866
Re: Patch: Tree line height
Nice patch. I think I will include it in the moreheightlevels patch when you are done.
Like Eddi said, I would not let the max tree height value depend on the max snowline height value.
For them todo's, have a looksie at tile_type.h.
Also, table/settings.h and settings_type.h could use a little coding style.
ps:
May I suggest using some form of versioning with patches you post.
It gets a bit confusing if you have different versions in different folders.
There is always the solution of opening the file and looking but ...
Like Eddi said, I would not let the max tree height value depend on the max snowline height value.
For them todo's, have a looksie at tile_type.h.
Also, table/settings.h and settings_type.h could use a little coding style.
ps:
May I suggest using some form of versioning with patches you post.
It gets a bit confusing if you have different versions in different folders.
There is always the solution of opening the file and looking but ...
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Re: Patch: Tree line height
Splendid! It's always boring to make something noone will ever use. Looking forward to your height level patch by the way, with or without this as an addition. I miss mountains...ChillCore wrote:Nice patch. I think I will include it in the moreheightlevels patch when you are done.
Ah, it's always easier to do the todo's when you know how to do. Or at least where . Many thanksChillCore wrote: Like Eddi said, I would not let the max tree height value depend on the max snowline height value.
For them todo's, have a looksie at tile_type.h.
Also, table/settings.h and settings_type.h could use a little coding style.
Now I'm confused too. Versioning with patches? Are there more options than the "attach file" present here in the post editor? Or are you refering to some kind of template? Currently I'm posting the patch in the first post with the revision I built it against in the file comment. Please describe your favoured way further or point me at a page describing it.ChillCore wrote: ps:
May I suggest using some form of versioning with patches you post.
It gets a bit confusing if you have different versions in different folders.
There is always the solution of opening the file and looking but ...
Re: Patch: Tree line height
Lol. I mean something like treelineheight_01.diff, treelineheight_02.diff, ..., nothing complicated.loclahost wrote:Now I'm confused too. Versioning with patches? Are there more options than the "attach file" present here in the post editor? Or are you refering to some kind of template? Currently I'm posting the patch in the first post with the revision I built it against in the file comment. Please describe your favoured way further or point me at a page describing it.ChillCore wrote: ps:
May I suggest using some form of versioning with patches you post.
It gets a bit confusing if you have different versions in different folders.
There is always the solution of opening the file and looking but ...
You see when i first tested i applied your patch in my "test" folder.
Next version was against "a" moreheightlevels folder,
and the latest version(modified) against my "official" moreheightlevels patch folder.
If it were not for the little typo in the last version I would have to open all tree versions to see which is the newest.
Good luck getting it in trunk.
EDIT: Screenshot with more heightlevels attached.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Re: Patch: Tree line height
Sweet! Altough this really raises the need for a gradual tree line...ChillCore wrote: EDIT: Screenshot with more heightlevels attached.
- SwissFan91
- Tycoon
- Posts: 2395
- Joined: 08 Feb 2009 18:36
- Location: Alberta, Canada
Re: Patch: Tree line height
Sorry to bump this, but is there any likelihood of this being put into trunk any time soon? IMHO it is one of the most useful patches made in recent months.
Re: Patch: Tree line height
And it still builds, there hasn't been any conflicts since I last updated it. I have also played it ever since (one game to "the end") and there has been no side effects, at least that I have been aware of. If there's anything preventing it from hitting trunk, please tell me and I'll fix it.
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Patch: Tree line height
Did you consider implementing the gradual tree line?loclahost wrote:And it still builds, there hasn't been any conflicts since I last updated it. I have also played it ever since (one game to "the end") and there has been no side effects, at least that I have been aware of. If there's anything preventing it from hitting trunk, please tell me and I'll fix it.
Re: Patch: Tree line height
Hello loclahost,
tile_type.h : Coding style.
Are you sure savegame has not bumped in the meantime?loclahost wrote: And it still builds, there hasn't been any conflicts since I last updated it.
settings.gui and table/settings.h: Still depend on snowline.loclahost wrote: If there's anything preventing it from hitting trunk, please tell me and I'll fix it.
tile_type.h : Coding style.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Re: Patch: Tree line height
Oops, it had. I just couldn't see it in-game since I don't play without may patch. Bumped it again.ChillCore wrote:Hello loclahost,
Are you sure savegame has not bumped in the meantime?loclahost wrote: And it still builds, there hasn't been any conflicts since I last updated it.
I haven't made any changes to settings_gui, so I guess you mean genworld_gui . Anyway; fixed all three of them and updated the diff in the first post. I had forgotten how space-happy the coding style is (myself being more of a tab person ).ChillCore wrote:settings.gui and table/settings.h: Still depend on snowline.loclahost wrote: If there's anything preventing it from hitting trunk, please tell me and I'll fix it.
tile_type.h : Coding style.
Thank you ChillCore for pointing out my silly misstakes. I bow in your general direction . Hopefully I remember to read my own diff file next time.
CommanderZ:
Not yet. I'm lacking in IDE (and linux skills) so my traversal of the code is quite slow. But if that is something you want, I'll increase my efforts in finding where to make it work. Maybe I'll have some more time this weekend than the ten minutes I had today. Stay tuned.
Who is online
Users browsing this forum: No registered users and 51 guests