Skip to content

Improve settler location AI#913

Open
ajhalme wants to merge 1 commit intoC7-Game:Developmentfrom
ajhalme:improve-settler-location-ai
Open

Improve settler location AI#913
ajhalme wants to merge 1 commit intoC7-Game:Developmentfrom
ajhalme:improve-settler-location-ai

Conversation

@ajhalme
Copy link
Contributor

@ajhalme ajhalme commented Mar 8, 2026

Basically just salvaging some ideas from #430 to improve the SettlerLocationAI with tile improvement metrics.

@ajhalme ajhalme changed the title Improve settler location ai Improve settler location AI Mar 8, 2026
@ajhalme ajhalme force-pushed the improve-settler-location-ai branch from 94a689c to 0935557 Compare March 8, 2026 01:36
@ajhalme ajhalme marked this pull request as draft March 8, 2026 01:42
@ajhalme ajhalme force-pushed the improve-settler-location-ai branch 3 times, most recently from 087cd95 to a1c3ce3 Compare March 9, 2026 00:34
@ajhalme ajhalme force-pushed the improve-settler-location-ai branch from a1c3ce3 to 3bf9a5a Compare March 9, 2026 00:36
@ajhalme
Copy link
Contributor Author

ajhalme commented Mar 9, 2026

The more I read the SettlerLocationAI code, the less it seems like #430 has to add here.

Only thing that isn't really here is the potential food/production yield from a tile, but that's influenced by game rules on terrain improvement and player characteristics, etc. - an expensive calculation for not that much gain.

As such, I'm reducing this mainly to adding scaled contributions from the BFC outer ring to the existing tile scoring logic, as called for in #802.

Something like a quadratic penalty from distance could be an improvement over the current logic.

I believe this now closes #802. I don't think #430 has anything more to add either.

@ajhalme ajhalme marked this pull request as ready for review March 9, 2026 00:48
Copy link
Contributor

@stavrosfa stavrosfa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I only have one comment, as I wasn't really involved in any of this, so I can't really provide any usefull insight.


private List<Tile> _outerRing;

public List<Tile> GetBFCOuterRing() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I have some reservations regarding this.

The BFC is not necessarily up to 2 tiles, as we have made this configurable in the rules

public int MaxRankOfWorkableTiles;

So I think it would be preferable if we added another method like

public List<Tile> GetTilesWithinRankDistance(int rank) {

excluding anything but the rank we want, to get the tiles

Unless this method is doing something extra which I am not immediatly getting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants