[Patch] Disable Tree Growth

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

[Patch] Disable Tree Growth

Post by Frostregen »

This patch adds a patch setting which will control if trees are allowed to grow, or not.

This may be useful for scenario creators, who want to create customized forests, which stay the same during editing.
Or for players who do not want to have the entire map filled with trees sooner or later.

Patch available at flyspray:
http://bugs.openttd.org/task/1605

Please comment.
Last edited by Frostregen on 31 Dec 2007 10:27, edited 1 time in total.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: [Patch] Disable Tree Growth

Post by Bilbo »

I think the patch is good, perhaps just add some quick-switch at some place in scenario editor (in the "create new landscape" gui, perhaps? So you can toggle this once you create the map .... )

Also, some settings like "no growth in editor, but grow in the game" may be useful. Sometimes you want the trees to grow once in the game but you do not want such interference while in editor and you are likely to forgot to turn it off when saving. Therefore I think this should split into two settigns, enable tree grownt at all (as you have made) and add "disable tree growth while in editor" which won't be saved with the map but will be saved in local settigns.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
rbenevid
Traffic Manager
Traffic Manager
Posts: 192
Joined: 14 Oct 2004 20:08
Location: Brazil

Re: [Patch] Disable Tree Growth

Post by rbenevid »

Disabling tree growth during gameplay is almost a cheat, as it greatly reduces problems
with local authority. And it breaks lumber mills in tropical. Maybe this could be on the
cheat menu during gameplay and automatically enabled during editor (or a patch
"disable tree growth in editor)?
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: [Patch] Disable Tree Growth

Post by Bilbo »

rbenevid wrote:Disabling tree growth during gameplay is almost a cheat, as it greatly reduces problems
with local authority. And it breaks lumber mills in tropical. Maybe this could be on the
cheat menu during gameplay and automatically enabled during editor (or a patch
"disable tree growth in editor)?
In WWOTTDGD disabling automatic tree growing was one of the "features" (yes, crippling lumber mills in troppical :), so IMHO not a cheat, rather a special server setting for some games.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Re: [Patch] Disable Tree Growth

Post by Frostregen »

The main reason for not separating editor and ingame is:
-a scenario creator may decide if he wants the trees to grow on his map, or not.
(By saving the scenario with the appropriate patch setting)

Your "quick-switch at some place in scenario editor" idea sounds good,
but I want to keep the patch as small as possible at first.
Once it is accepted into trunk, this extra button may be added.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: [Patch] Disable Tree Growth

Post by Bilbo »

Frostregen wrote:The main reason for not separating editor and ingame is:
-a scenario creator may decide if he wants the trees to grow on his map, or not.
(By saving the scenario with the appropriate patch setting)

Your "quick-switch at some place in scenario editor" idea sounds good,
but I want to keep the patch as small as possible at first.
Once it is accepted into trunk, this extra button may be added.
But what if the scenario creator want the trees to be grown once the game start, but not while he is placing them in editor? He'll turn it off, but before every save, he'll have to turn it on momentarily (in these few ticksd trees will grow a little), save the scenario and turn it off again. Therefore I suggested for extra option for the scenario editor. While you can pause the scenario editor, you can't build while paused in it. (though build-while-paused in scenario editor may solve this probably too)
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: [Patch] Disable Tree Growth

Post by Ammler »

Bilbo wrote:
In WWOTTDGD disabling automatic tree growing was one of the "features" (yes, crippling lumber mills in troppical :), so IMHO not a cheat, rather a special server setting for some games.
We had this feature to reduce the filesize, a map full of trees could be double the size then without... I would really like to have that switchable over the console too, while running a server, like "normal" patches.

Greets
Ammler
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: [Patch] Disable Tree Growth

Post by Bilbo »

So in WWOTTDGD the only purpose this have is to lower the map size to lower (re)conection times? Still, may be helpful even with other servers having 2048x2048 maps ....

Perhaps even the speed at which the trees are grown could be set (from 0 to say saomething like multiple times the current value :) ... perhaps I'll make another patch with it :)
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: [Patch] Disable Tree Growth

Post by athanasios »

I vote for a switch or slider in scenario editor to allow/not allow growth of trees after the game starts.
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
User avatar
Expresso
Tycoon
Tycoon
Posts: 1760
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

Re: [Patch] Disable Tree Growth

Post by Expresso »

How about giving players control over how many trees are allowed to grow on the map as an additional option? Not as an arbitrary limit (i.e. players should always be able to place trees), but rather to make sure the game plants trees but doesn't fill the map with trees.
User avatar
electricmonk
Engineer
Engineer
Posts: 50
Joined: 11 Aug 2006 08:20
Location: Earth

Re: [Patch] Disable Tree Growth

Post by electricmonk »

Here's an idea: If tree growth is disabled but new trees can still be planted, you could 'borrow' the trees from Rollercoaster Tycoon and create 'parks' with a huge variety of trees (and other scenery). Using the ECS 'Tourists' cargo, trains (or busses) full of tourists will ride through the park. The ammount of revenue generated will be according to how 'interesting' the journey is (Rollercoaster Tycoon calculates the 'ride excitement' based on how interesting the ride is, so we could use a similar algorithm to work out how much tourists will pay).

But then, of course, the AI will sooner or later come along and terraform all over your masterpiece :(
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Re: [Patch] Disable Tree Growth

Post by Frostregen »

-Patchfile updated (synced with trunk r11811)

-Added patchsetting: "Disable Tree grow in scenario editor" as Bilbo suggested.
This is a config setting only -> not saved with map.


Something else:
Did the tree-planting method change in scenario editor?
I can only plant fully grown trees now...
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [Patch] Disable Tree Growth

Post by planetmaker »

I updated the patch to current trunk (r13305).
Attachments
patchsetting_treegrowth_r13119.diff
patch setting: disable tree growth for r13119
(7.77 KiB) Downloaded 141 times
patchsetting_treegrowth_r13305.diff
patch setting: disable tree growth for r13305
(9.08 KiB) Downloaded 155 times
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [Patch] Disable Tree Growth

Post by planetmaker »

updated to trunk
Attachments
patchsetting_treegrowth_r13397.diff
updated patchsetting treegrowth to r13397
(3.71 KiB) Downloaded 295 times
Tiberius
Engineer
Engineer
Posts: 86
Joined: 17 Sep 2004 03:15

Re: [Patch] Disable Tree Growth

Post by Tiberius »

hooray! this one's MUCH cleaner. I'll include it ASAP :)
I may implement/fix/tweak/eat/ditch it soon (or in distant future, if at all, so don't hold your breath).
If anyone want to be the one please implement it for us all 8)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [Patch] Disable Tree Growth

Post by planetmaker »

Tiberius wrote:hooray! this one's MUCH cleaner. I'll include it ASAP :)
You're welcome. But I think it's exactly the same as Frostregen's. The difference between before and now is that it's now smaller due to missing indentation correction so it does NOT follow coding style with that... But it saves to replace all those lines which actually are not changed except in their indentation - an that enhances readability :)

So I'm rather in doubt that I did there too well :)

EDIT: That said, Belugas pointed out about the style violations in this patch and supplied the attached and even more simplified version of the patch. Enjoy.

Note: you don't want to disable tree growth in desert climate as the lumber mill won't work anymore, if it has not trees any longer. Don't ask for trunk inclusion therefor :)
Attachments
patchsetting_treegrowth_v2_r13435.diff
svn diff of Belugas solution to the problem
(3.59 KiB) Downloaded 180 times
User avatar
Two5Kid
Chief Executive
Chief Executive
Posts: 660
Joined: 26 Feb 2007 07:10
Location: Kota Bharu, Malaysia

Re: [Patch] Disable Tree Growth

Post by Two5Kid »

This is a good patch. Except for the desert scenario, almost all temperate games would be affected with the uncontrolled tree growth and also the reduction in town ratings once you start to blast them away.

Edit: Now to get someone to patch it in Mac with YAPP, DistantJoinStations & Daylength. Shameful request. :(
Any dream worth having,
Is a dream worth fighting for!
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 21 guests