-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add support for predicting opponent orders #20
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I accidentally used overly strict typing when I created this method.
When I copied `suggest_message()` to create `suggest_commentary()`, I forgot to change the reference to the original function's name in the error message.
This further abstracts away the message format of suggestions and makes a later change easier.
The first JSON format was designed to allow easy filtering by the intended recipient, but it assumed that a player would only receive advice about themselves. It was unable to handle move advice about other players, which we intend to support, so I needed to redesign the format to allow it. The new format has an explicit `recipient` field to avoid accidentally intercepting any suggestions intended for another player. In addition, it can handle other top-level metadata that we want to store, such as the advisor that sent the suggestion.
Although the player will not see this value, we want this available in the logs for evaluation.
This will be used by CICERO to send predicted orders to the Llama advisor.
All bots should declare what suggestion types they support in `BaselineBot.suggestion_type`, and that value is needed so the UI displays the sent suggestions. We should raise an exception to prevent a bot from accidentally sending suggestions that the user would never see when the suggestion support is not explicitly declared.
We now test the new `BaselineBot.suggest_opponent_orders()` method in `RandomProposerAdvisor`.
This was referenced Dec 13, 2024
YanzeJeremy
approved these changes
Dec 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds client support for a new suggestion type that predicts the orders of opponents. This change required another refactor of the suggestion format, but the previous refactors made it significantly easier this time! I also made some related improvements to the suggestion code and added a test implementation to
RandomProposerAdvisor
.For the library and UI implementations, see ALLAN-DIP/diplomacy#34. For the CICERO implementation, see ALLAN-DIP/diplomacy_cicero#32.