Skip to content
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

AIs cannot detect river tiles #5377

Closed
DorpsGek opened this issue Dec 1, 2012 · 5 comments
Closed

AIs cannot detect river tiles #5377

DorpsGek opened this issue Dec 1, 2012 · 5 comments

Comments

@DorpsGek
Copy link

@DorpsGek DorpsGek commented Dec 1, 2012

krinn opened the ticket and wrote:

We cannot detect river tiles, currently openttd consider them a bit like roads, could be destroy, but cannot built on them until you removed them.

But noai/nogo API doesn't consider rivers at all. So we need AITile.IsRiverTile to detect them and AITile.IsBuildable should also be change to not return true for river tiles.
And because it wouldn't be fun if it was too easy, many functions should have a better error handling for rivers failure, AIAirport.BuildAirport return ERR_TUNNEL_CANNOT_BUILD_ON_WATER error, i suppose an ERR_CANNOT_BUILD_ON_WATER or ERR_AREA_NOT_CLEAR should be somehow a better error to return.

I'm using 1.2.1 still so maybe it has been changed for AITile.IsBuildable already, but i don't see a way to test for river tiles in trunk noai doc, except using tricky tests with AITestMode

Reported version: other
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5377
@DorpsGek

This comment has been minimized.

Copy link
Author

@DorpsGek DorpsGek commented Dec 4, 2012

krinn wrote:

Here a patch that will :
- Add (AI/GS)Tile.IsRiverTile(tile)
- Add BT_CLEAR_RIVER to AI/GS enum BuildType http://noai.openttd.org/docs/trunk/classAITile.html# 133f5d7f78a0b1aae62c2bdbde9c0056
- Modify (AI/GS)Tile.GetBuildCost() to answer cost to remove a river tile
- Add AITile.GetBuildCost(AITile.BT_CLEAR_RIVER) to regression.nut : i didn't add the regression test against a tile to check river, because the regression.sav file didn't have any river to test against, and i assume it was over me to modify the testing savegame.

Better get review twice time by someone who knows openttd source, c++ and squirrel (hehe someone not as me so).

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5377#comment11731
@DorpsGek

This comment has been minimized.

Copy link
Author

@DorpsGek DorpsGek commented Dec 4, 2012

frosch wrote:

Please always create unified diff (using "diff -u").


This comment was imported from FlySpray: https://bugs.openttd.org/task/5377#comment11733
@DorpsGek

This comment has been minimized.

Copy link
Author

@DorpsGek DorpsGek commented Dec 5, 2012

krinn wrote:

here comes (sorry)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5377#comment11734
@TrueBrain TrueBrain changed the title AITile.IsRiverTile() need and AITile.IsBuildable change to add !AITile.IsRiverTile condition AIs cannot detect river tiles Apr 14, 2018
Leffe108 added a commit to Leffe108/OpenTTD-1 that referenced this issue Apr 26, 2018
Leffe108 added a commit to Leffe108/OpenTTD-1 that referenced this issue Apr 26, 2018
…he cost to demolish river tiles. (based on patch by krinn)
Leffe108 added a commit to Leffe108/OpenTTD-1 that referenced this issue Apr 26, 2018
Leffe108 added a commit to Leffe108/OpenTTD-1 that referenced this issue Apr 26, 2018
…he cost to demolish river tiles. (based on patch by krinn)
@andythenorth

This comment has been minimized.

Copy link
Contributor

@andythenorth andythenorth commented Jan 5, 2019

Thanks for this. There's been no activity on this for some time, and as it stands, it doesn't look likely that it will go any further. Since OpenTTD moved to GitHub, we use pull requests rather than patches, as they are a much more productive workflow.

I'm planning to close this soon (in 7 days), as we try to keep the issue count low for OpenTTD, it helps us focus on things that are important and fun.

If you would like to continue with this patch, the best way would be to move the patch to your own GitHub fork, update it for the current OpenTTD master, and then create a pull request. For more information, please see our CONTRIBUTING.md.

We are also happy to discuss directly on the issue, or in #openttd irc, including help to get this into a pull request. Thanks for your contribution!

@andythenorth andythenorth added the stale label Jan 11, 2019
@andythenorth

This comment has been minimized.

Copy link
Contributor

@andythenorth andythenorth commented Jan 12, 2019

@frosch123 rejected the PR for this #6751, on the basis of no usecase, but with a proposed spec. Re-open if someone actually turns up needing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.