It is expected the user has already installed sharpy-sc2.
See Chance for a working example of this integration.
If you're starting from scratch, consider starting from sharpysc2_example.py.
It should work out of the box.
To integrate into an existing sharpy bot, initialize an instance of QueensSc2Manager
in your bot's configure_managers
method.
You can pass an initial policy like so:
def configure_managers(self) -> Optional[List["ManagerBase"]]:
queen_policy = {
# policy here
}
return [QueensSc2Manager(queen_policy)]
This is all that is required for queens-sc2 to function.
You can use SetQueensSc2Policy
in your sharpy build order to set the policy during the game.
async def create_plan(self) -> BuildOrder:
# in case you need access to the manager...
queens_manager = self.knowledge.get_manager(QueensSc2Manager)
early_game_queen_policy = {
# define your early game policy here
}
mid_game_queen_policy = {
# define your mid game policy here
}
return BuildOrder(
SetQueensSc2Policy(early_game_queen_policy, policy_name="early_game_queen_policy"),
# Early game build here...
SetQueensSc2Policy(mid_game_queen_policy, policy_name="mid_game_queen_policy"),
# Mid game build here...
)
Alternatively, you can also set the policy via the manager by calling queens_manager.set_new_policy(queen_policy)
.
See sharpysc2_example.py for a working example of using this integration.