Skip to content

Repository files navigation

screeps

Embarassing screeps code; probably don't look at this

Roles

The Role class enables adding fallback behavior if a role cannot be performed

flowchart TD
    LongHauler
    Hauler --> Upgrader
    Miner --> Harvester --> Builder --> Upgrader
    Repairer --> Builder
Loading

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 container

    Falls back on HarvesterRole if assigning the miner to a source failed

  • HaulerRole - Provides energy from containers to spawns, containers, extensions, and room storage

    Upgrades the controller if there's nothing to haul

  • HarvesterRole - A HaulerRole that 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 BuilderRole if there's no need for hauling

  • BuilderRole - Builds any available construction sites

    Falls back on UpgraderRole if there's nothing to build

  • RepairerRole - Repairs any damaged structures

    Falls back on BuilderRole if there's nothing to repair

  • UpgraderRole - Upgrades the room controller. Has no fallback, and is intended to be the fallback of most roles.

Vim ALE LSP configuration

npm install -g typescript-language-server typescript
npm install @types/screeps
npm install @types/lodash

TODO list

  • Add Role class heirarchy, to enable code-sharing between roles, which in turn enables fallback Roles.
  • IDE integration
    • tsserver
    • prettier
    • eslint
  • Add Tower behavior for repair and defense
  • Upgrading is too slow. Fallback roles aren't quite right
  • Need manager / logistics coordinator?
  • .energy and .energyCapacity are 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 WORK components to MinerRoles 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 RoomVisual to indicate what the spawn is spawning
  • Enable picking up resources from the ground

About

Embarassing screeps code; probably don't look at this

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages