-
Notifications
You must be signed in to change notification settings - Fork 27
Unit Cache
Matti Bragge edited this page Apr 7, 2020
·
1 revision
Unit cache is designed for making Sharpy run faster.
instead of
self.ai.structures(UnitTypeId.NEXUS)
# or
self.ai.units(UnitTypeId.ZEALOT)
It's recommented to use the unit cache manager
self.cache.own(UnitTypeId.NEXUS)
# or
self.knowledge.unit_cache.own(UnitTypeId.NEXUS)
self.cache.enemy
for enemy units.
self.cache.by_tag
for getting units by their tags. Works for both own and enemy units.
own_in_range
and enemy_in_range
are also available and use scipy cKDTree to get units around a specified point.
All functions in cache manager return both units and buildings.
- 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