Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cities build irrational bridges: right on the shore, along the lake, next to each other #9051

Closed
LC-Zorg opened this issue Apr 18, 2021 · 6 comments

Comments

@LC-Zorg
Copy link

LC-Zorg commented Apr 18, 2021

Version of OpenTTD

1.11.0 (also earlier, but a bit less problematic)

Expected result

Bridges are built across the width not length of water bodies, in the narrowest, not the widest places.
Long bridges are not built side by side and do not cover the entire lake.

Actual result

The city builds bridges wherever it can. He will build a bridge right along the shore or along the lake. This is especially noticeable since version 1.11.0 where the length of the city bridge can be much longer. However, this is not an issue resulting from this change.
Irrational bridges 1
Irrational bridges 2

Possible solution

If a game could check for land or another bridge in adjacent tiles before building a bridge over water, it might work like this:
Bridge building restriction - Low v0 1

Unfortunately, this is just an idea. I am not able to code it, or even verify whether it is possible at all. But if any of you have thought about it, it might be helpful. I have tentatively named the function Bridge building restriction. Could have settings where the control area would increase depending on them. Of course, the restrictions would only apply to bridges built by cities.
Bridge building restriction - Medium v0 1

@nielsmh
Copy link
Contributor

nielsmh commented Apr 18, 2021

I don't think it's feasible to begin adding land mass shape and reachability analysis to town expansion just to avoid silly bridges.

A simpler solution I think will solve this problem, and other oddities with town expansion, might be to let towns have an expansion budget. A smaller town has a smaller budget, obviously, and different expansions have different costs. Bridges would have a rather large cost. Expanding with a road tile on flat land would be cheap, expanding with small houses on flat land is cheap, expanding with roads on slopes somewhat more expensive, building houses on slopes again more expensive. Destroying existing buildings to replace them with others can be significantly more expensive than building on empty land. Expanding further from the town center is more expensive.
If a town can't find an expansion with its current budget, it saves up and the next expansion attempt has a larger budget.

This will make bridges unlikely to happen until a town has no choice but expand over a body of water, or over some railroad tracks, and because the bridges have a cost the town will be more likely to choose a shorter bridge. It will also be more likely to have built all along the shore/track that needs to be expanded past and thus have more options open for places to build the bridge.
Additionally, by making removing existing buildings dig into the budget, towns would be less likely to remove existing buildings (like a stadium or shopping centre) and thus become smaller, until it becomes too expensive for it to expand outwards rather than upwards.

@michicc
Copy link
Member

michicc commented Apr 18, 2021

There would need to be some kind of limit/random chance to not just take the cheapest current option, as otherwise towns on mostly flat maps would just sprawls endlessly. While this might be realistic, it's not not visually appealing. Also, it would make a reworking of the town zones almost mandatory.

@nielsmh
Copy link
Contributor

nielsmh commented Apr 18, 2021

I think two parts in my idea as written will prevent endless sprawl. First is that expanding further from centre has a higher cost, second that larger towns have bigger budget. It obviously needs tuning, but eventually the cost of expanding outwards will be higher than the cost of expanding upwards. Since low density buildings have much less population, large sprawl should not contribute as much to the budget of the town.

Possibly, the budget should not be linear on the population count, but rather each house contributes exponentially more depending on its size.
Additionally, perhaps active transportation also affects the budget, making it easier for a well-serviced town to build up.

@LC-Zorg
Copy link
Author

LC-Zorg commented Apr 18, 2021

Whether you add a budget or not, it has nothing to do with how or where cities build their bridges.

Well, a similar restriction is currently in use, and it doesn't work good. The bigger the city (bigger budget), the longer the bridges. What you write about will not prevent situations from the screenshots. If the big city has only one lake nearby, he will build all the bridges over that lake. Bridges along the coast will continue to be built.

Basically the whole idea of a budget would not affect the method of construction but rather only the pace. In order to maintain the current growth speed settings of cities, you would have to raise the budget, which means that nothing would change with main issue.

Currently when building anything, the terrain is always checked, so why shouldn't it be like that here?

@nielsmh
Copy link
Contributor

nielsmh commented Apr 18, 2021

You're making assumptions about my idea to break it instead of thinking of ways it can work. For example if a 6 tile long bridge over water is more expensive than expanding with an office building 20 tiles out from the city center, then those bridges would still not be built except when the town has literally no more options. I say "cost" and you probably think of the same costs players see when building bridges, where additional length doesn't have that much effect on the total cost. When I say cost I mean an abstract cost, that might have exponential growth on length.

You suggest "look at the landscape", but do you actually know what you are asking for there? What you are asking for is a detailed analysis of the shape of the land and making a choice of optimal positioning to maximize the ability of the town to expand while minimizing the length of bridges. That's a very computationally heavy problem, my stomach feeling says similar to the difficulty of building an analytical system to evaluate moves in the game of Go.
Additionally, it would demand that towns have a (stored) grand plan for expansion, instead of working iteratively as they do now.

@LC-Zorg
Copy link
Author

LC-Zorg commented Apr 18, 2021

Yes, I understand what you are writing about.
A bridge will always be more expensive than a building, so with the assumption you are writing about, it will never be built, because the city will always have space for development a new buildings, roads etc.

No, this is just a check on specific tiles (shown in the graphic) if there is land or another bridge there. Nothing more. Is there a detailed analysis when building a enterprise? Rather not. There is no planning here. At most, coordinates could be saved where a bridge could not be built, so as not to repeat the same action every now and then.

@OpenTTD OpenTTD locked and limited conversation to collaborators May 27, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants