To adjust tree growth in the main branch

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
chmykh
Engineer
Engineer
Posts: 2
Joined: 27 Aug 2020 15:11

To adjust tree growth in the main branch

Post by chmykh »

Hi folks,

Would you please tell your opinion on extending the tree growth behavior in the main branch.

I am among the people who prefer to reduce number of trees / alter tree behavior / make tree density depending on altitude. I searched through the forum and have found some patches, starting from 2010, targeting the issue in different ways (like this viewtopic.php?f=33&t=72502, this viewtopic.php?p=848591#p848591 and this viewtopic.php?f=33&t=83465).

As far as I understand none of them made a way to the official branch, probably due to reasons explained here https://github.com/OpenTTD/OpenTTD/blob ... ject-goals. But to my current understanding the trees behavior cannot be altered "via add-ons like NewGRF and GameScripts". (Is it so?)

I'm very much interested what would be accepted way to provide the functionality of fine-tuning tree behavior to general users and to accept tree-related patches in trunk.

My particular interest is to host game server with altered tree behavior which would work with clients using main branch version.
User avatar
jfs
Tycoon
Tycoon
Posts: 1812
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: To adjust tree growth in the main branch

Post by jfs »

Whenever changing tree growth algorithms comes up in the IRC chat, someone will argue that tree growth should be removed entirely from the game and trees should be abstracted out such that they don't really grow, and are just a visual effect applied client-side. The reasoning being that the random nature of trees means tiles with trees contribute a very large amount of "noise" to savegame files, and are in fact a major contributing factor to large maps having huge savegame files. And huge savegame files mean much longer time to join multiplayer servers.
The argument against abstracting away trees is that they have two gameplay effects, one is town rating (destroying or planting trees altering your rating), the other being for the tropical landscape sawmill to cut down for production.

You won't be able to make a server with altered tree growth algorithm and have unmodified clients work with it. Tree growth is part of the simulation, which means the server does not send which tiles get new trees or where trees wither, etc., those are decided based on the RNG and reproduced on server and client identically. If you modified the server when the RNG progression would differ between server and clients and cause very fast desyncs, and also clients would never know how the server placed trees differently anyway.
chmykh
Engineer
Engineer
Posts: 2
Joined: 27 Aug 2020 15:11

Re: To adjust tree growth in the main branch

Post by chmykh »

Thank you for reply.

I have looked thru code and understand the current situation. But what kind of changed might be done to be accepted to main branch? As none of existing patches were accepted.

Could tree growth logic be implemented with some pluggable mechanism, like newgrfs or scripts?
User avatar
jfs
Tycoon
Tycoon
Posts: 1812
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: To adjust tree growth in the main branch

Post by jfs »

Yes NewGRF trees is what I have argued for myself, mostly with some vague ideas so far. Features such as height level checks, proximity to water, tile slope, proximity to other tree types, proximity to other tile types (town, industry, farmland, etc.)
It could give a lot of interesting effects, and would probably cost a lot of simulation speed on large maps.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 1 guest