Fix maritime trade possibilities with multiple port types#354
Fix maritime trade possibilities with multiple port types#354epicgamer17 wants to merge 1 commit intobcollazo:masterfrom
Conversation
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.
👷 Deploy request for catanatron-staging pending review.Visit the deploys page to approve it
|
|
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. |
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.