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
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) enhancement Issue would be a good enhancement; we accept Pull Requests! good first issue Good for newcomers

Comments

@DorpsGek
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

DorpsGek commented Dec 5, 2012

krinn wrote:

here comes (sorry)

Attachments


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

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) enhancement labels Apr 7, 2018
@andythenorth andythenorth added component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) and removed Script labels Apr 13, 2018
@TrueBrain TrueBrain added good first issue Good for newcomers patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay enhancement Issue would be a good enhancement; we accept Pull Requests! and removed enhancement from FlySpray labels Apr 14, 2018
@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 that referenced this issue Apr 26, 2018
Leffe108 added a commit to Leffe108/OpenTTD 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 that referenced this issue Apr 26, 2018
Leffe108 added a commit to Leffe108/OpenTTD that referenced this issue Apr 26, 2018
…he cost to demolish river tiles. (based on patch by krinn)
@andythenorth
Copy link
Contributor

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 Stale issues label Jan 11, 2019
@andythenorth
Copy link
Contributor

@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.

@andythenorth andythenorth removed flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay stale Stale issues labels Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) enhancement Issue would be a good enhancement; we accept Pull Requests! good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants