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
Fix: Don't allow towns to terraform certain floodable tiles #8492
base: master
Are you sure you want to change the base?
Conversation
3b54d10
to
64e0307
Compare
bb1550b
to
348b3c0
Compare
c214542
to
0ba13de
Compare
0ba13de
to
5475145
Compare
5475145
to
a45e8cd
Compare
This commit is used for debugging OpenTTD#8492. Intended to use when starting a new game. Affected tiles will have a sign placed on them, so you can quickly get to them after world generation. During world generation, town growth algorithm is speed up, allowing the town to perform multiple sequential growth actions, like building houses, roads, and terraforming. If it happens to lower terrain adjacent to sea and then in one of those sequences it builds a road or a house there, it will end up flooded during the "run tile loop" phase of world generation.
You can use this commit SamuXarick@3939097 for debugging purposes, to check the existance of flooded tiles after a world is generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced this problem occurs frequently enough to worry about it, but that's not a good reason to unilaterally close this PR or continue to leave it in limbo. Code looks fine to me.
This commit is used for debugging OpenTTD#8492. Intended to use when starting a new game. Affected tiles will have a sign placed on them, so you can quickly get to them after world generation. During world generation, town growth algorithm is speed up, allowing the town to perform multiple sequential growth actions, like building houses, roads, and terraforming. If it happens to lower terrain adjacent to sea and then in one of those sequences it builds a road or a house there, it will end up flooded during the "run tile loop" phase of world generation.
This commit is used for debugging OpenTTD#8492. Intended to use when starting a new game. Affected tiles will have a sign placed on them, so you can quickly get to them after world generation. During world generation, town growth algorithm is speed up, allowing the town to perform multiple sequential growth actions, like building houses, roads, and terraforming. If it happens to lower terrain adjacent to sea and then in one of those sequences it builds a road or a house there, it will end up flooded during the "run tile loop" phase of world generation.
a45e8cd
to
b6b1cc3
Compare
This commit is used for debugging OpenTTD#8492. Intended to use when starting a new game. Affected tiles will have a sign placed on them, so you can quickly get to them after world generation. During world generation, town growth algorithm is speed up, allowing the town to perform multiple sequential growth actions, like building houses, roads, and terraforming. If it happens to lower terrain adjacent to sea and then in one of those sequences it builds a road or a house there, it will end up flooded during the "run tile loop" phase of world generation.
@SamuXarick You mentioned on Discord that this may have been broken by my fix to wide river terraforming. Is this ready for review? |
This commit is used for debugging OpenTTD#8492. Intended to use when starting a new game. Affected tiles will have a sign placed on them, so you can quickly get to them after world generation. During world generation, town growth algorithm is speed up, allowing the town to perform multiple sequential growth actions, like building houses, roads, and terraforming. If it happens to lower terrain adjacent to sea and then in one of those sequences it builds a road or a house there, it will end up flooded during the "run tile loop" phase of world generation.
b6b1cc3
to
23ea20d
Compare
This is ready for review, but... Wide river generator needs to water the tiles that terraform left behind for my fix to work properly. |
23ea20d
to
e9aa076
Compare
This commit is used for debugging OpenTTD#8492. Intended to use when starting a new game. Affected tiles will have a sign placed on them, so you can quickly get to them after world generation. During world generation, town growth algorithm is speed up, allowing the town to perform multiple sequential growth actions, like building houses, roads, and terraforming. If it happens to lower terrain adjacent to sea and then in one of those sequences it builds a road or a house there, it will end up flooded during the "run tile loop" phase of world generation.
e9aa076
to
6cfdcda
Compare
9587490
to
75b55ff
Compare
This commit is used for debugging OpenTTD#8492. Intended to use when starting a new game. Affected tiles will have a sign placed on them, so you can quickly get to them after world generation. During world generation, town growth algorithm is speed up, allowing the town to perform multiple sequential growth actions, like building houses, roads, and terraforming. If it happens to lower terrain adjacent to sea and then in one of those sequences it builds a road or a house there, it will end up flooded during the "run tile loop" phase of world generation.
75b55ff
to
36e1fb9
Compare
This commit is used for debugging OpenTTD#8492. Intended to use when starting a new game. Affected tiles will have a sign placed on them, so you can quickly get to them after world generation. During world generation, town growth algorithm is speed up, allowing the town to perform multiple sequential growth actions, like building houses, roads, and terraforming. If it happens to lower terrain adjacent to sea and then in one of those sequences it builds a road or a house there, it will end up flooded during the "run tile loop" phase of world generation.
Prevent rare occurrences of roads and houses being flooded, resulting in disconnected towns.
36e1fb9
to
2d4e397
Compare
This commit is used for debugging OpenTTD#8492. Intended to use when starting a new game. Affected tiles will have a sign placed on them, so you can quickly get to them after world generation. During world generation, town growth algorithm is speed up, allowing the town to perform multiple sequential growth actions, like building houses, roads, and terraforming. If it happens to lower terrain adjacent to sea and then in one of those sequences it builds a road or a house there, it will end up flooded during the "run tile loop" phase of world generation.
Motivation / Problem
During world generation, town growth algorithm is speed up, allowing the town to perform multiple sequential growth actions, like building houses, roads, and terraforming. If it happens to lower terrain adjacent to sea and then in one of those sequences it builds a road or a house there, it will end up flooded during the "run tile loop" phase of world generation.
The result could be similar to what the screenshot shows: disconnected roads and/or houses.
This happens very rarely. I tried 12k towns 4096x4096 map, and detected no more than 3 flooded road or house tiles.
Description
Prevent rare occurrences of roads and houses being flooded, resulting in disconnected towns.
If the terraform command finds a certain floodable tile, the terraform fails. This works even for a sequence of commands during town generation. So far, the tests have not yet produced any flooded houses or roads.
Limitations
Void tiles were a problem. Terraform command ignores them. If the town terraformed one of the tiles at the edges of the map, there was no checking happening for the void tiles, and it could result in a flood coming in the direction of the void tile. I added checks coming from the edge tiles. Terraform command shall fail if the resulting slope on an edge tile is flat and has a height of zero.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.