Skip to content

Fix maritime trade possibilities with multiple port types#354

Open
epicgamer17 wants to merge 1 commit intobcollazo:masterfrom
epicgamer17:fix/maritime-trade-multiple-ports
Open

Fix maritime trade possibilities with multiple port types#354
epicgamer17 wants to merge 1 commit intobcollazo:masterfrom
epicgamer17:fix/maritime-trade-multiple-ports

Conversation

@epicgamer17
Copy link
Copy Markdown

When a player has both a 3:1 general port and a 2:1 specific port, all valid trade rates (2:1, 3:1, 4:1) are now generated instead of only the best single rate.

This is also critical for converting from colonist.io replays to catanatron trajectories, as sometimes humans play the 4:1 instead of the available 3:1.

When a player has both a 3:1 general port and a 2:1 specific port,
all valid trade rates (2:1, 3:1, 4:1) are now generated instead of
only the best single rate.
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 16, 2026

👷 Deploy request for catanatron-staging pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 0871e85

@bcollazo
Copy link
Copy Markdown
Owner

bcollazo commented Mar 19, 2026

Thanks for opening this PR!

This is tricky, because as-is it would slow down the AlphaBeta bot (and all other bots) since it adds paths to search for. We would need benchmarking to take a better decision here. One alternative (tho I acknowledge might be more complex to implement), would be to make this generation just a table lookups (on a very big table based on resource amounts and port owned by user combinations). Combined with aggressive pruning on Alpha Beta to not explore paths that are suboptimal (I believe a better rate is always optimally better). This I think would make it both, faster than what it is right now, and allow for colonist.io translation.

Does these changes of a table lookup make sense? Could you include some timing information on this change (before and after)? I use https://github.com/bcollazo/catanatron/blob/master/documentation/contributing.md#testing-performance to time stuff here.

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