[Patch] bypass restricted road removal (r17654)

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
sulai
Traffic Manager
Traffic Manager
Posts: 159
Joined: 24 Sep 2004 18:23

[Patch] bypass restricted road removal (r17654)

Post by sulai »

This patch is about this advanced setting:
remove_more_town_owned_roads1.png
remove_more_town_owned_roads1.png (1.01 KiB) Viewed 2714 times
Without this patch: If this setting is enabled, you may delete roads inside a town no matter where. Penalty is low. Road vehicles maybe have to take long bypasses or even find no bypass at all.

What this patch does: local authorities refuse to delete road tiles where there is no bypass. Local authorities additionally claim both money and rating points depending on the length of the shortest bypass. As a result, the local authorities allow a bypass length limited by the player's town rating. Money penalty is quite high.

The patch makes operation in town more interesting. Deleting town owned roads and bridges is not forbidden yet not too easy to perform. Players need to think about bypasses before deleting town-owned roads. Road vehicles benefit from that.

FAQ
The patch itself is rather small, but it has quite some impact on the game. This FAQ summarizes some discussion points.

>> what does this patch do?
This patch changes the behavior of the town, if the player tries to delete a road tile, that is connected to 2 neighbor road tiles. If there is no bypass, it will not allow to delete it. If there is a bypass, it will charge money and rating points depending on the bypass length.

>> Which town-owned roads may be deleted?
This is determined by connected neighbors of the road piece.
1 neighbor - original behavior: may be deleted if money and rating is sufficient.
2 neighbors - behavior added by this patch: may be deleted, but it's bypass-restricted. Costs are heavy and depend on shortest bypass length.
3,4 neighbors - deletion not allowed

>> How to delete a crossing then?
Imagine this is a crossing where you delete (*) some pieces:

Code: Select all

  |      |      |      |       |   
  |      |      |      |       |   
--+--  --+*-  -*+.-  -.*.-   -...- 
  |      |      |      |       |   
  |      |      |      |       |   
In this manner, any possible setup of roads may be deleted -- if you have the money and sufficient rating. Note that all 3 deletions shown above are bypass-restricted and cost a lot of money. To delete the road bits of the resulting dead ends is really cheap (not changed by this patch).

>> Isn't bypass_length^3 a little too expensive?
This patch has 3 main goals: (1) Make it theoretically possible to delete any town owned road, -- but (2) make it harder charging a lot of money and rating points, and (3) keep important connections. Since money doesn't matter at some point of the game, costs are quite high. Remember, to delete dead-end-tiles is not expensive at all, so you have to pay the price only if you break a ongoing non-dead-end-road. To break open a 2x2 grid town's road, it costs 45k GBP, in a 3x3 town it costs 123k GBP, while deleting long bridges may cost several millions. There is a upper border at ca 10 million, because town rating costs restict the bypass to a certain length.

>> What about road stops?
For now, town owned roads that have road stops may not be deleted. A clean solution has yet to be found. Work-around: first delete the road stop, then the road.

>> What about bridges and tunnels?
Bridges are working fine. Towns build no tunnels.

>> What about one-way-roads?
They are covered by the patch. Deletion is only allowed if there is a bypass in both directions.

>> Does multi-tile-dynamite work?
Yes, it works where bypass-restriction takes effect.
However, original behavior of one-neighbour-tile-destruction is not changed. If you try to delete multiple tiles of dead-end-roads coming from south, you will only succeed with the last tile of the dead end. You need to do tile-by-tile destruction in that case. This is a minor bug of general OpenTTD.

>> Can't you abuse the detour calculation by building a short detour, remove the road, then remove the detour again?
Yes. The patch *encourages* the player to consider bypasses. It can't enforce them. Well, it could, if even the deletion of player-owned roads were bypass restricted. This maybe is worth a try, since roads may be used by any player. Players even might depend on other player's roads.

----

This FAQ is a result of this forum thread and a chat session with Rubidium, Eddi and Alberth. Thanks for feedback guys!
Attachments
allow_removal_of_more_town_owned_roads_r17654.diff
(13.64 KiB) Downloaded 90 times
Last edited by sulai on 09 Oct 2009 13:14, edited 9 times in total.
sulai
Traffic Manager
Traffic Manager
Posts: 159
Joined: 24 Sep 2004 18:23

Re: [blue print] remove more town owned roads

Post by sulai »

See File Comments.
Attachments
The local authorities refuse to allow the removal of that road - because road vehicles won't find any rerouting
The local authorities refuse to allow the removal of that road - because road vehicles won't find any rerouting
remove_more_town_owned_roads2.png (179.3 KiB) Viewed 2717 times
The town allows to remove this bridge, because the player built up a bypass. Money and Rating Costs depend on the length of the bypass.
The town allows to remove this bridge, because the player built up a bypass. Money and Rating Costs depend on the length of the bypass.
remove_more_town_owned_roads3.png (186.34 KiB) Viewed 2716 times
No problem to remove that town owned road, because there is a bypass in the south west.
No problem to remove that town owned road, because there is a bypass in the south west.
remove_more_town_owned_roads4.png (186.17 KiB) Viewed 2717 times
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: [blue print] remove more town owned roads

Post by CommanderZ »

Is this a suggestion or patch development thread?

Btw, I like the idea quite a lot. It introduces the something-for-something negotiation model that is often utilized in RL to OTTD (where it was missing till now, mass planting trees doesn't count :) ).

The length of the new route should be limited in relation to the original length.
User avatar
pavel1269
Route Supervisor
Route Supervisor
Posts: 473
Joined: 03 Dec 2006 13:22
Location: Czech Republic
Contact:

Re: [blue print] remove more town owned roads

Post by pavel1269 »

Nice, but I would suggest to make this without patch option. Just make it as it is. ...... Also, Suggestion only? :-)
CommanderZ wrote:The length of the new route should be limited in relation to the original length.
Also this. But would need carefull use.
sulai
Traffic Manager
Traffic Manager
Posts: 159
Joined: 24 Sep 2004 18:23

Re: [blue print] remove more town owned roads

Post by sulai »

I try to implement that patch, but there is a chance I fail.
If I succeed, this is a patch thread, else it's a suggestion thread.
I hope it becomes a patch thread :)
sulai
Traffic Manager
Traffic Manager
Posts: 159
Joined: 24 Sep 2004 18:23

Re: [Patch] remove more town owned roads (r17612)

Post by sulai »

I attached the patch to the first post. Have fun :)
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: [Patch] remove more town owned roads (r17612)

Post by CommanderZ »

How does it treat deleting ending piece of the road?
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: [Patch] remove more town owned roads (r17612)

Post by Terkhen »

I like the idea of this patch: but in my opinion the prices are way too expensive. More important: floats can cause desyncs in multiplayer, so you should avoid using them.
sulai
Traffic Manager
Traffic Manager
Posts: 159
Joined: 24 Sep 2004 18:23

Re: [Patch] remove more town owned roads (r17612)

Post by sulai »

CommanderZ wrote:How does it treat deleting ending piece of the road?
Treatment of Ending pieces of roads is unchanged: you may delete them.
Terkhen wrote:More important: floats can cause desyncs in multiplayer, so you should avoid using them.
Thanks for that hint, I fixed that.
There were also minor issues with bridges and road stops that are now fixed. Updated patch see first post.

The patch itself is rather small, but it has quite some impact on the game. Thats why I added a FAQ which summarizes some discussion points.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 20 guests