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
Change: Towns don't build dead-end road bridges #8395
Conversation
I can't see the whitespace which is failing CI in Visual Studio. Any tips? |
You need to squash these commits. |
I don't quite understand that, why it would result in big |
The problem with returning false if no road is allowed to be built, is that there are several conditions in which the bridge should be allowed and returning false short-circuits those next checks. Specific situations are when a valid road tile already exists in the next tile: a road station, depot, bridge, tunnel, or a complete road tile facing the correct direction. |
4657d69
to
9b88688
Compare
I also send you some words on Discord too, but in summary here too: You now define all the possible ways the bridge would be invalid, which is a pretty lengthy list. Possibly it is better to do the reverse: define what are valid scenarios, as I think that list would be a lot shorter:
C'est tout! This would be, I think, much easier code to read, but also much less likely to have a flaw somewhere in the logic :) |
Per my conversation with TrueBrain on Discord, I will be rewriting this to use a new function. Stay tuned. |
c675d1b
to
f997fac
Compare
a2ccc87
to
f997fac
Compare
cc53efa
to
2714e0a
Compare
I need to sleep before I break anything further. I'll try this again in the morning. The correct commit should be cc53efa |
Co-authored-by: Owen Rudge <owen@owenrudge.net>
This in preparation for other architectures, like arm64.
This has several ways of being triggered: - When creating a new release via the GitHub interface. Fully automated that will produce new binaries, upload them, and it will even update the website to tell about the new version. - When triggered in an automated way from OpenTTD/workflows to start a nightly. - Manually via the Release workflow, which accepts branches, Pull Requests and tags to build. Rerunning a job is safe and should be without issues. Everything retriggers and updates what-ever might have been broken. In fact, except for dates, it should produce identical results. Co-authored-by: Charles Pigott <charlespigott@googlemail.com>
Azure Pipelines has build our releases for two years now, but we are finally switching to GitHub Actions. This to bring the full workflow to a single place, making it easier for people to see what is going on and how to influence the process.
Signed-off-by: 2TallTyler <tyler@tylertrahan.com>
Per my discussion with TrueBrain on Discord, I appear to have broken GitHub and the easiest fix is starting a new branch and making a new PR. |
Currently, towns build bridges over ocean tiles or tracks without checking if the tile past the bridge will allow them to continue building the road. This frequently leads to bridges dead-ending at industries, houses, tracks, etc.
I have created a test savegame to demonstrate each case where the bridge should be allowed, and each case where it should be prohibited. You can run it on fast-forward to let the towns grow (I have included buses to drive growth). You can tell that a bridge has been rejected when the town grows the road to the end of the tile without bridging.
Bridge_Test_Save.zip
TrueBrain suggested using a DoCommand to try building a road in lieu of the industry/object/house/railway tile checks, but after some experimentation I decided that separate checks rejecting the bridge is more maintainable than one big
if
chain with a singlereturn false
at the end. Feel free to correct me, as I'm pretty new to all of this. :)