Patch: Forbid rocks terraforming

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
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Patch: Forbid rocks terraforming

Post by Roujin »

I made a new patch that can be used to make some challenging games where you cannot terraform/build on some areas.

Basically it forbids you to do anything that removes rocky tiles (as clearing the tiles, building something on them, terraforming them up/down).
It comes with a patch option to enable/disable.

I've also made a second patch option to forbid tunnelling under rocky tiles (makes most sense in combination with the first option).

edit: removed, see some posts below.
Last edited by Roujin on 17 May 2008 18:08, edited 1 time in total.
* @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
Mchl
Director
Director
Posts: 611
Joined: 05 Jan 2007 15:50
Location: Poland
Contact:

Re: Patch: Forbid rocks terraforming

Post by Mchl »

Yay! Multiplayer lame-all-map-levellers stopper!
User avatar
cmoiromain
Chief Executive
Chief Executive
Posts: 655
Joined: 15 Jan 2007 21:45
Location: FRANCE
Contact:

Re: Patch: Forbid rocks terraforming

Post by cmoiromain »

what a great idea! Roujin you are truly extraordinary

I don't know how to compile, so I cannot test it, but I have a few questions that come to mind: are each of the restrictions configurable (forbid each listed action separately, e.g only terraform, only tunnels, or only building and tunnels but not terraform). But in all cases the buy land shouldn't be allowed on them, neither should the dynamite tool. And make it so that when anything built on it is removed, the rock reappears (or else it would allow "cheating" to overcome the patch restriction)

Is this already done? If not, is it doable, or too complicated/not worth it?
I am little, ugly, and nasty. How do you do?
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Patch: Forbid rocks terraforming

Post by Roujin »

cmoiromain wrote:what a great idea! Roujin you are truly extraordinary

I don't know how to compile, so I cannot test it, but I have a few questions that come to mind: are each of the restrictions configurable (forbid each listed action separately, e.g only terraform, only tunnels, or only building and tunnels but not terraform). But in all cases the buy land shouldn't be allowed on them, neither should the dynamite tool. And make it so that when anything built on it is removed, the rock reappears (or else it would allow "cheating" to overcome the patch restriction)

Is this already done? If not, is it doable, or too complicated/not worth it?
The two things "tunnel under" and "remove rocks" are completely independant. Everything that removes rocks though (= build something on it; dynamite; terraform; buy land) is either allowed or forbidden.
It is not really doable with moderate effort to have rock reappear when removing something that was built on it. That is because currently no information is stored what kind of clear land there was before something was built on it. In fact, it is implicitly cleared before building something on it.

And due to that, it doesn't really make sense to seperate "build on it", "dynamite", "terraform" and "buy land" (and whatever more functions there might be that I haven't thought about. Because you could abuse building something on it then removing it again to make it clear.

Thanks for your ideas though :)

Oh, something that came to my mind: should I maybe limit it to players? Because right now towns arent't allowed to remove them either, which could restrict them in their growth... don't know if that's desirable or not...

edit: yes, definately need to restrict it a bit.. just checked, and you can't remove them in scenario editor either, should fix that ^^
AND not even water is able to remove rocks if it tries to flood them. Now that's what I call some sturdy rocks :mrgreen:
* @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
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: Patch: Forbid rocks terraforming

Post by SirkoZ »

Mchl wrote:Yay! Multiplayer lame-all-map-levellers stopper!
While this is a nice patch and all it doesn't at all mean that flooding is not possible because of position of the rocks is not on hill/mountain-tops.

Roujin - could you instead make a non-flooding patch by limiting how many tiles in depth and how many tile area a player is allowed to modify _only_ around his infrastructure = road/rail/airport. Could also be configurable per infrastructure type.

As an avid anti-flooder I would appreciate such a patch very much.

Oh :oops: :D and tell me - what you think about the proposed criteria for terraform-limits.

S/Z
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Patch: Forbid rocks terraforming

Post by planetmaker »

Nice patch. But the patch part concerning the tunnels doesn't compile:

Code: Select all

/Users/ingo/ottd/trunk/src/tunnelbridge_cmd.cpp: In function 'CommandCost CmdBuildTunnel(TileIndex, uint32, uint32, uint32)':
/Users/ingo/ottd/trunk/src/tunnelbridge_cmd.cpp:518: error: 'tile' was not declared in this scope
/Users/ingo/ottd/trunk/src/tunnelbridge_cmd.cpp:518: error: 'CLEAR_ROCKS' was not declared in this scope
/Users/ingo/ottd/trunk/src/tunnelbridge_cmd.cpp:518: error: 'IsClearGround' was not declared in this scope
make[1]: *** [tunnelbridge_cmd.o] Error 1
make: *** [all] Error 2
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Patch: Forbid rocks terraforming

Post by Roujin »

heh, seems I didn't make a new .diff after fixing :P here's the right one now...
Attachments
forbid_rocks_terraform_v2.diff
forbid rocks terraforming v2
(5.13 KiB) Downloaded 130 times
* @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
User avatar
Ameecher
Tycoon
Tycoon
Posts: 11919
Joined: 12 Aug 2006 15:39
Contact:

Re: Patch: Forbid rocks terraforming

Post by Ameecher »

I think prohibiting destruction of rocks is good but could it not be too prohibitive. There are many routes built through very mountainous areas that are blasted through a rock face. I'm not sure what I'm getting at here but maybe you are being too prohibitive*.

*Within the confines of the current set up of TTD I'm not sure how you could make it less extreme than either total destruction or no building whatsoever.
Image
hjxbf
Engineer
Engineer
Posts: 38
Joined: 11 Aug 2007 15:35

Re: Patch: Forbid rocks terraforming

Post by hjxbf »

Being from Norway, I find this patch sort of strange... Almost every means of transport in this country are built in or on rocky land, which illustrates that this is both possible and quite common in Norway. I'd say the same goes for Switzerland... Building on rocks requires heavier tooling and more time and money than building on dirt or sand, but is not downright impossible. I don't think it should be in the game either...
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Patch: Forbid rocks terraforming

Post by Roujin »

I understand that this is neither realistic, nor a candidate for trunk inclusion. It is rather a "hack" to be able to make games where it is forbidden to alter certain areas.
Once I made a scenario myself with pseudo-realistic mountains with rocks placed on them and I thought "now these shouldn't be flattenable by the player in game"... that's where the idea for this patch originally came from.

I have talked to the guys planning the next WWOTTDGD and they were interested in this behavior, so I contribute this patch to their event. And of course anyone who would like to use it is free to, as well. But I'm not forcing anyone - if you don't want this, don't use it...

(even if it were to go in trunk, it still has a switch to turn on/off.. :roll: )

Ameecher: The only way to make it "a bit prohibitive, but not completely" in my opinion is raising the costs. This can be done without problems with a .grf if I'm not mistaken. I think I've even seen .grfs to make terraforming actions expensive...
* @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
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Patch: Forbid rocks terraforming

Post by planetmaker »

Roujin wrote:The only way to make it "a bit prohibitive, but not completely" in my opinion is raising the costs. This can be done without problems with a .grf if I'm not mistaken. I think I've even seen .grfs to make terraforming actions expensive...
These approaches are also included in our wwottdgd patch; look at the wwottdgd wiki page to find both, grf and patch. But as money is no issue after some time, we would like some possibility to make sure that mountain ranges remain mountain ranges without big channels blasted through them.

As for Roujin, the reasons to include it in our patch, are just the same. And choosing rocks as an undestructible tile, just like light houses, makes for more realistically looking landscapes :).
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 4 guests