Embarassing screeps code; probably don't look at this
The Role class enables adding fallback behavior if a role cannot be performed
flowchart TD
LongHauler
Hauler --> Upgrader
Miner --> Harvester --> Builder --> Upgrader
Repairer --> Builder
All of the roles take energy from the nearest container, and fall back on harvesting energy themselves if there's no energy available in a container.
-
MinerRole- A static miner that is assigned to a specific source with a nearby containerFalls back on
HarvesterRoleif assigning the miner to a source failed -
HaulerRole- Provides energy from containers to spawns, containers, extensions, and room storageUpgrades the controller if there's nothing to haul
-
HarvesterRole- AHaulerRolethat doesn't take energy from containers, preferring to mine it instead. This is a failsafe role, that enables bootstrapping from a low-energy state.Falls back on
BuilderRoleif there's no need for hauling -
BuilderRole- Builds any available construction sitesFalls back on
UpgraderRoleif there's nothing to build -
RepairerRole- Repairs any damaged structuresFalls back on
BuilderRoleif there's nothing to repair -
UpgraderRole- Upgrades the room controller. Has no fallback, and is intended to be the fallback of most roles.
npm install -g typescript-language-server typescript
npm install @types/screeps
npm install @types/lodash- Add
Roleclass heirarchy, to enable code-sharing between roles, which in turn enables fallbackRoles. - IDE integration
- tsserver
- prettier
- eslint
- Add
Towerbehavior for repair and defense - Upgrading is too slow. Fallback roles aren't quite right
- Need manager / logistics coordinator?
-
.energyand.energyCapacityare deprecated in favor of.store - Make creep components dependent on energy availability (maybe max energy availability?)
- Move creep spawning logic into
Roles? - Add up to 5
WORKcomponents toMinerRoles based on energy availability - Long-distance harvesting
- More efficient long-distance harvesting
- Expand to other rooms (requires upgrading GCL)
- Increase upgrade rate proportional to energy intake
- Determine if
renewCreep()is more energy efficient (why else would it exist?) - Use
RoomVisualto indicate what the spawn is spawning - Enable picking up resources from the ground