Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Wed Jan 16, 2019 11:25 am

All times are UTC




Post new topic  Reply to topic  [ 27 posts ]  Go to page 1 2 Next
Author Message
 Post subject: Patch: Tree line height
PostPosted: Thu Jan 14, 2010 4:03 pm 
Offline
Engineer
Engineer

Joined: Thu Dec 18, 2008 7:39 am
Posts: 46
Location: Sweden
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! :D
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.
Attachment:
File comment: No trees where there's been snow for a hundred years...
Unnamed, 1st Jan 1910.png
Unnamed, 1st Jan 1910.png [ 283.55 KiB | Viewed 6986 times ]


New in current version: The patch applied itself to all climates (instead of just arctic). Solved now though :)


Attachments:
File comment: Diff against 19135
treelineheight_3.diff [23.57 KiB]
Downloaded 169 times


Last edited by loclahost on Mon Feb 15, 2010 12:19 pm, edited 9 times in total.
Top
   
PostPosted: Thu Jan 14, 2010 4:59 pm 
Offline
Engineer
Engineer

Joined: Fri Jan 09, 2009 11:46 am
Posts: 123
Wow, that is a really simple but effective patch and could make it into trunk due to its simplicity and effectiveness

_________________
ImageImage
ImageImage


Top
   
PostPosted: Thu Jan 14, 2010 5:12 pm 
Offline
Engineer
Engineer

Joined: Sat Mar 29, 2008 10:42 pm
Posts: 77
Skype: tvel___
Location: Bulgaria
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.


Attachments:
crash.log.zip [1.31 KiB]
Downloaded 125 times
Top
   
PostPosted: Thu Jan 14, 2010 5:30 pm 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Tue Dec 29, 2009 2:56 am
Posts: 688
Paltala wrote:
Wow, that is a really simple but effective patch

_________________
Image


Top
   
PostPosted: Thu Jan 14, 2010 10:43 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed May 16, 2007 4:59 pm
Posts: 2825
I think the treeline should be defined totally separately from the snowline, it looks wierd having no trees at all above the snow line...

_________________
GRVTS/eGRVTS --- Generic Tram Set --- UK Town Set --- zBase ---RichardWheeler.net


Top
   
PostPosted: Thu Jan 14, 2010 10:54 pm 
Offline
Engineer
Engineer

Joined: Sat Mar 29, 2008 10:42 pm
Posts: 77
Skype: tvel___
Location: Bulgaria
Zephyris 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...


It is defined separately. Just the crash needs to be fixed :)


Attachments:
screenshot_004.png
screenshot_004.png [ 34.62 KiB | Viewed 6867 times ]
Top
   
PostPosted: Thu Jan 14, 2010 11:06 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed May 16, 2007 4:59 pm
Posts: 2825
Ah, fair enough, good work then!

_________________
GRVTS/eGRVTS --- Generic Tram Set --- UK Town Set --- zBase ---RichardWheeler.net


Top
   
PostPosted: Thu Jan 14, 2010 11:10 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 21, 2007 11:47 am
Posts: 6559
Location: The Netherlands
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.

_________________
FooBar's Tram Tracks | TransRapid Track Set | Metro Track Set | OpenGFX base graphics set | FIRS Industry Replacement Set
Dutch Tram Set | Dutch Trainset 2 | Dutch Road Furniture


Top
   
PostPosted: Fri Jan 15, 2010 7:28 am 
Offline
Engineer
Engineer

Joined: Thu Dec 18, 2008 7:39 am
Posts: 46
Location: Sweden
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.
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.

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.
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 :wink:).
But thanks for the idea anyway, I'll look into it.


Top
   
PostPosted: Mon Jan 18, 2010 3:19 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7260
just a remark: you might want to check whether this is compatible with moving snow line (implemented in some newgrfs)

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Tue Jan 19, 2010 12:40 pm 
Offline
Engineer
Engineer

Joined: Thu Dec 18, 2008 7:39 am
Posts: 46
Location: Sweden
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


Top
   
PostPosted: Tue Jan 19, 2010 1:39 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Oct 04, 2008 11:05 pm
Posts: 2650
Location: Lost in spaces
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 ... :(

_________________
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.


Top
   
PostPosted: Tue Jan 19, 2010 5:02 pm 
Offline
Engineer
Engineer

Joined: Thu Dec 18, 2008 7:39 am
Posts: 46
Location: Sweden
ChillCore wrote:
Nice patch. I think I will include it in the moreheightlevels patch when you are done. :)

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

Ah, it's always easier to do the todo's when you know how to do. Or at least where :wink: . Many thanks
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 ... :(

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.


Top
   
PostPosted: Tue Jan 19, 2010 5:46 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Oct 04, 2008 11:05 pm
Posts: 2650
Location: Lost in spaces
loclahost wrote:
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 ... :(

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.

Lol. I mean something like treelineheight_01.diff, treelineheight_02.diff, ..., nothing complicated.

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.


Attachments:
treeline.png
treeline.png [ 364.47 KiB | Viewed 6499 times ]

_________________
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.
Top
   
PostPosted: Wed Jan 20, 2010 11:52 am 
Offline
Engineer
Engineer

Joined: Thu Dec 18, 2008 7:39 am
Posts: 46
Location: Sweden
ChillCore wrote:
EDIT: Screenshot with more heightlevels attached.


Sweet! Altough this really raises the need for a gradual tree line...


Top
   
PostPosted: Wed Feb 03, 2010 2:42 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Feb 08, 2009 6:36 pm
Posts: 2381
Location: Alberta, Canada
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.

_________________
Image
Total Alpine Replacement Set: Industry, Town, Objects
**ATTENTION**: If anyone would like me to help draw snow stages in any of their GRFs let me know. I genuinely enjoy drawing them.


Top
   
PostPosted: Mon Feb 08, 2010 11:48 am 
Offline
Engineer
Engineer

Joined: Thu Dec 18, 2008 7:39 am
Posts: 46
Location: Sweden
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.


Top
   
PostPosted: Mon Feb 08, 2010 12:10 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Apr 07, 2008 6:29 pm
Posts: 1872
Location: Czech Republic
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.


Did you consider implementing the gradual tree line?


Top
   
PostPosted: Mon Feb 08, 2010 12:16 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Oct 04, 2008 11:05 pm
Posts: 2650
Location: Lost in spaces
Hello loclahost,

loclahost wrote:
And it still builds, there hasn't been any conflicts since I last updated it.

Are you sure savegame has not bumped in the meantime?

loclahost wrote:
If there's anything preventing it from hitting trunk, please tell me and I'll fix it.

settings.gui and table/settings.h: Still depend on snowline.
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.


Top
   
PostPosted: Mon Feb 08, 2010 9:47 pm 
Offline
Engineer
Engineer

Joined: Thu Dec 18, 2008 7:39 am
Posts: 46
Location: Sweden
ChillCore wrote:
Hello loclahost,

loclahost wrote:
And it still builds, there hasn't been any conflicts since I last updated it.

Are you sure savegame has not bumped in the meantime?

Oops, it had. I just couldn't see it in-game since I don't play without may patch. Bumped it again.
ChillCore wrote:
loclahost wrote:
If there's anything preventing it from hitting trunk, please tell me and I'll fix it.

settings.gui and table/settings.h: Still depend on snowline.
tile_type.h : Coding style.

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 :wink: ).
Thank you ChillCore for pointing out my silly misstakes. I bow in your general direction :bow:. 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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 27 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2019 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2019.
Hosted by Zernebok Hosting.