[patch] disable/limit terraform

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

thepalm
Engineer
Engineer
Posts: 15
Joined: 25 Jun 2008 01:12

[patch] disable/limit terraform

Post by thepalm »

This patch adds a setting in the advanced settings menu to disable/enable terraforming.

I like this because I play without using any terraforming as an extra challenge.

The patch modifies about 7 lines of code in total.

Patch + win32 binary attached

edit:added copying to zip file - is this all that is needed?

edit2:added patch for 0.7.3
Attachments
No_Terraform_patch.patch
Patch File (created by tortoiseSVN)
(4.91 KiB) Downloaded 204 times
OTTD-No-Terraform-Patch.zip
exe+lng+copying
(1.03 MiB) Downloaded 174 times
ottd_73_limit_terraform.patch
patch for ottd 0.7.3
(8.83 KiB) Downloaded 145 times
Last edited by thepalm on 16 Oct 2009 10:44, edited 3 times in total.
User avatar
tsjook
Traffic Manager
Traffic Manager
Posts: 197
Joined: 22 Apr 2009 18:33

Re: [patch] disable terraform

Post by tsjook »

Good idea for an extra challenge.

Will one still be able to plant trees?
thepalm
Engineer
Engineer
Posts: 15
Joined: 25 Jun 2008 01:12

Re: [patch] disable terraform

Post by thepalm »

Will one still be able to plant trees?

This should still work
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: [patch] disable terraform

Post by planetmaker »

I like the general idea and once wrote a similar patch which restricts terraform to one tile at most: http://www.openttdcoop.org/files/pm/pat ... 13397.diff

Maybe you want to generalise the idea a bit and change the patch such that it allows to set the maximum area to concurrently terraform with a single action (line 84 of the linked patch)? E.g. introduce an int patch setting instead of a boolean.

EDIT: and please don't just post exe files but complete bundles or at least also the copying information. Your zip is a violation of the GPL.
deepblue2k8
Engineer
Engineer
Posts: 44
Joined: 06 Sep 2008 12:41
Location: Hamburg, Germany

Re: [patch] disable terraform

Post by deepblue2k8 »

I like the idea, too! :)

What about a time based terraforming constraint? Like you are only allowed to terraform 10 tiles per year.

Without any terraforming I think it would be hard to place large airports especially on rough terrain. So with a limited amount of tiles per year you would have to plan your bigger stations like airports oder train stations very carefully.

I would very like an option like this, because I find myself often in a position, that I am to lazy to build bridges over an sea but instead terraform my way through it...
thepalm
Engineer
Engineer
Posts: 15
Joined: 25 Jun 2008 01:12

Re: [patch] disable terraform

Post by thepalm »

Im trying to convert this to having a monthly limit on terraforming, except I am getting asserts in line 902 of settings_gui.cpp when advanced settings is opened. Obviously this patch doesn't quite work.

Any help?

patch:http://paste.openttd.org/217117
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Re: [patch] disable terraform

Post by Frostregen »

Just a suggestion:
Make it per year, as deepblue2k8 suggested.

TPM = Allowed Terraforms per Year
You could add 1/12 TPM each month, up to a maximum of TPM.

This way you do not have to wait a full year for this damn last terraform you need.
Also you do not have to jump every month to your construction site just to terraform the next few tiles before you loose this months terraform budget.

For values which are not divisable through 12:
January to November: Add (TPM / 12)
December: Add (TPM / 12) + (TPM % 12)

-Frostregen
thepalm
Engineer
Engineer
Posts: 15
Joined: 25 Jun 2008 01:12

Re: [patch] disable/limit terraform

Post by thepalm »

New version of patch which allows for limited terraforming per month.

If in a given month the full terraforming limit is not reached it will carry over to a maximum of 12*the monthly limit.
Attachments
OTTD-limit-terraform-per-month.zip
(1.33 MiB) Downloaded 162 times
limit_terraform_per_month.patch
(7.76 KiB) Downloaded 152 times
deepblue2k8
Engineer
Engineer
Posts: 44
Joined: 06 Sep 2008 12:41
Location: Hamburg, Germany

Re: [patch] disable/limit terraform

Post by deepblue2k8 »

Seems to work. Astonishing to see how little you can do with 10 terraforms / month :).
I dont know how or where, but a display of your terraforming count, would be nice.

One suggestion for the "text" of the advanced option? I didn't really get, wheter 1000 = DISABLED means, that I can do no terraforming at all. Or that the limit is disabled?
Maybe (1000 = unlimited) would be a better wording.

And the language file you included did not match the executable file, so I had to compile my own language file :)

Great work so far! :)
User avatar
Expresso
Tycoon
Tycoon
Posts: 1760
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

Re: [patch] disable/limit terraform

Post by Expresso »

errrr... how about making a patch which makes the user able to set the cost of terraforming, instead of is simply limiting terraforming? That would make everyone happy.

This won't make it annoying (translation: fun reducing) to get to a town on the top of a mountain (for example), like this patch will.

Another idea could be to block terraforming the moment the local authorities find you 'appalling', due to you devestating the environment. This is a much more natural solution then providing the player with X terraforms per month.
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: [patch] disable/limit terraform

Post by SirkoZ »

Nice patch, thepalm, though perhaps it would be better named disable/limit landscaping.

And, no, I don't agree with Expresso here because for costs there are already available at least two new .grf's. So again - nice patch. Perhaps it even gets included and prevents those pesky kids from flooding server maps so often. :)
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: [patch] disable/limit terraform

Post by Bilbo »

Expresso wrote:errrr... how about making a patch which makes the user able to set the cost of terraforming, instead of is simply limiting terraforming? That would make everyone happy.
This can be done by newGRF. Unfortunately, NewGRF that changes cost of terraforming changes cost of foundations (those half-tiles that gets automatically built under your construction when the land is not exactly flat) as well. But some patch that will allow controlling these two base costs separately with a NewGRF would be nice :)
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
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: [patch] disable/limit terraform

Post by CommanderZ »

Bilbo wrote:
Expresso wrote:errrr... how about making a patch which makes the user able to set the cost of terraforming, instead of is simply limiting terraforming? That would make everyone happy.
This can be done by newGRF. Unfortunately, NewGRF that changes cost of terraforming changes cost of foundations (those half-tiles that gets automatically built under your construction when the land is not exactly flat) as well. But some patch that will allow controlling these two base costs separately with a NewGRF would be nice :)
Increasing cost doesn't really help (unless you increase it like million times), because late-game you always end up with billions of money (whatever currency you use).
thepalm
Engineer
Engineer
Posts: 15
Joined: 25 Jun 2008 01:12

Re: [patch] disable/limit terraform

Post by thepalm »

Patch updated: The company screen now shows the amount of terrraforming remaining, also fixed the text so that it says 1000 = unlimited
Attachments
limited-terraform-r17719.patch
(8.91 KiB) Downloaded 270 times
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: [patch] disable/limit terraform

Post by petert »

Is this the type of patch that is able to be applied to 0.7.3 and run as a No Terraforming server?
thepalm
Engineer
Engineer
Posts: 15
Joined: 25 Jun 2008 01:12

Re: [patch] disable/limit terraform

Post by thepalm »

Is this the type of patch that is able to be applied to 0.7.3 and run as a No Terraforming server?
I had a quick look, most functions have been renamed / are working differently, so I might give this a try on the weekend
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: [patch] disable/limit terraform

Post by petert »

Great. Thank you.
boekabart
Transport Coordinator
Transport Coordinator
Posts: 333
Joined: 25 Aug 2005 09:44
Location: Eindhoven, Netherlands

Re: [patch] disable/limit terraform

Post by boekabart »

Another option, of course, though a lot harder to implement: Make terraforming a slow process, allowing only so much 'sand' to be (re)moved/added per tick...
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: [patch] disable terraform

Post by Kogut »

planetmaker wrote:EDIT: and please don't just post exe files but complete bundles or at least also the copying information. Your zip is a violation of the GPL.
Why?

//Thanks for answer!
Last edited by Kogut on 12 Oct 2009 12:30, edited 1 time in total.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [patch] disable/limit terraform

Post by Roujin »

OpenTTD is licensed under the GPL. That means you may make copies and derivated works of it, as long as you put them under the same license. This means you have to include the file that says "this is under the GPL license [etc.etc.]".
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 11 guests