-
Notifications
You must be signed in to change notification settings - Fork 27
Role Manager
UnitRoleManager
handles roles for units. Units are assigned roles to remember what they were doing in previous frames. Role manager has specified number of prebuilt role types, but can be extended to as many roles as you need. UnitRoleManager
is required manager in most acts and functions that manages unit roles within sharpy. All friendly workers and combat units have a single role in Sharpy at all times. In order to see role contribution during game, set debug for UnitRoleManager
to True
.
Roles are defined in UnitTask.
- Idle = 0
- Unit doesn't have an assigned task
- Building = 1
- Worker is either building (terran), trying to build, or moving to build a new building
- Gathering = 2
- Worker is gathering minerals or vespene gas. Workers that are worker drilling don't count here.
- Scouting = 3
- Unit has been assigned for scouting enemy units / buildings. Will never be reassigned.
- Moving = 4
- Unit is moving to a position, i.e. gather point. Can be assigned to defend instead.
- Fighting = 5
- Unit is fighting against enemy somewhere. Can be assigned to defend instead.
- Defending = 6
- Unit is defending a zone / something
- Attacking = 7
- Unit is attacking enemy base. Can be assigned to defend instead.
- Reserved = 8
- Reserved for some unknown purpose, i.e. gate keeper for Protoss. Will never be reassigned.
- Hallucination = 9
- Not a real unit.
Because UnitTask
is IntEnum
and the roles operatate on int basis, it is possible to add more roles to sharpy as required. In KnowledgeBot.configure_managers
set self.knowledge.roles.role_count
to the amount of roles desired. By default additional roles are handled in similar way to Reserved
and will never be re-assigned in any normal sharpy acts.
- Plans and Build Order
- Settings, debug and logging
- Structure and Life Cycle
- Unit Roles
- Unit Cache
- Running Games
- Converting Sharpy bot from before 2.0 version
- Converting Sharpy KnowledgeBot to SkeletonBot
- Converting Python bot to minimal Sharpy bot
- OLD: Extending Your Existing Bot With Sharpy
- Packaging For Ladders
- Extending Sharpy
- Advanced Build Order tricks
- Machine Learning With Sharpy