Skip to content

Converting Sharpy bot from before 2.0 version

DrInfy edited this page Dec 6, 2020 · 4 revisions

The big difference between KnowledgeBot before 2.0 version and after 2.0 version is that Knowledge now hardly contains any functionality and is there to just hold the managers that do the actual work. Only forced managers in Knowledge are VersionManager, ActionManager and LogManager. When the refactor is fully completed, there will not be any references to any other manager in Knowledge or Component.

  • Managers like self.zone_manager and self.roles are in KnowledgeBot instead of Knowledge.
  • Knowledge no longer contains self.known_enemy_units and you should instead use the similar functionality in BotAI instead: python-sc2 instructions
  • Prefiltered properties like .enemy_townhalls and .known_enemy_workers no longer exist in Knowledge and are instead available in IUnitCache.
  • RequireCustom now takes in the SkeletonBot class instead of Knowledge. This is in line with the change to keep the manager home in the bot instead.
  • Component classes (basically almost everything in sharpy) no longer contain direct links to every single manager in Sharpy. Instead you should request managers for the current component with self.get_required_manager(ManagerType) instead.
  • In order to reduce the forced bloat from sharpy, some of the managers have been removed from the default KnowledgeBot: ChatManager and BuildDetector. You can add them back by overriding configure_managers method in KnowledgeBot
  • Shortcut knowledge.possible_rush_detected is no longer available and BuildDetector.rush_detected should be used instead.
  • All shortcuts to ZoneManager properties in Knowledge have been removed and references to IZoneManager properties should be used instead.
Clone this wiki locally