What you will understand in this lesson
This lesson has one goal: separate three ideas that beginners often mix together.
| Idea | Question it answers |
|---|---|
| Body parts | What abilities does this Creep have? |
| Role | What job do you want this Creep to focus on? |
| Current action | What command does your code submit this tick? |
Harvester, Upgrader, and Builder are useful player-defined responsibilities. They are not official regular-Creep classes, and the game does not automatically run a job because a Creep has a certain name.
Lesson boundary: this article explains task separation. It does not add creep.memory.role, automatic population targets, replacement timing, or role modules.
Body ability, player-defined role, and current action
Use this rule:
Body parts decide what a Creep can do. A role describes what it should mainly do. Your code decides what it attempts on the current tick.
| Layer | Example | What it does not guarantee |
|---|---|---|
| Body | [WORK, CARRY, MOVE] | It does not choose a Source, structure, Controller, or Construction Site. |
| Role | Upgrader | It does not call upgradeController() by itself. |
| Action | creep.upgradeController(controller) | It does not guarantee success; the return code still matters. |
Review WORK, CARRY, and MOVE when the ability layer is still unclear.
Move from Worker1 to role-specific teaching names
The previous lesson used Worker1 to prove that spawnCreep() could create one Creep. From this lesson onward, the beginner path uses three names:
Harvester1 - harvest and deliver Energy
Upgrader1 - upgrade the Room Controller
Builder1 - build Construction Sites
If your existing Creep is still named Worker1, you can temporarily use that name wherever the next code examples expect Harvester1. The important lesson is the responsibility, not the spelling of the label.
Three simple roles for the beginner room
| Teaching name | Primary responsibility | Main action methods |
|---|---|---|
Harvester1 | Collect Energy and deliver it to a Spawn or Extension. | harvest() and transfer() |
Upgrader1 | Collect Energy and spend it on the owned Room Controller. | harvest() and upgradeController() |
Builder1 | Collect Energy and spend it on a Construction Site. | harvest() and build() |
An Upgrader does not transfer Energy into a Controller. It spends carried Energy by calling upgradeController(). A Builder likewise spends carried Energy through build().
A later production design may separate mining from hauling or assign several Creeps to one role. Those optimizations are outside this lesson.
The same body can support different jobs
All three beginner roles can start with the same learning body:
[WORK, CARRY, MOVE]
That body provides the abilities to work, carry resources, and move. The body does not select the destination.
- Harvester1 moves toward a Source or an Energy structure.
- Upgrader1 moves toward a Source or the Room Controller.
- Builder1 moves toward a Source or a Construction Site.
The target-selection and action code create the behavioral difference.
Inspect the three teaching roles without changing game state
State impact: read-only. This Console snippet checks which fixed-name Creeps currently exist. It does not move, spawn, or modify Memory.
const beginnerRoles = {
Harvester1: 'harvest and deliver Energy',
Upgrader1: 'upgrade the Room Controller',
Builder1: 'build Construction Sites'
};
const roleView = Object.keys(beginnerRoles).map(function (name) {
const creep = Game.creeps[name];
return {
name: name,
expectedJob: beginnerRoles[name],
exists: Boolean(creep),
roomName: creep ? creep.room.name : null,
spawning: creep ? creep.spawning : null,
bodyParts: creep ? creep.body.map(function (part) {
return part.type;
}) : []
};
});
console.log(JSON.stringify(roleView, null, 2));
Game.creeps uses Creep names as keys, so a fixed name is convenient for a small teaching example. The output still describes only what exists; it does not prove that the expected behavior code is running.
Understand the limits of fixed-name roles
- One exact name identifies only one Creep.
- A missing named Creep leaves that teaching job without a worker.
- The name does not count several Creeps that share one responsibility.
- The responsibility is not stored as structured role data.
- The approach does not automatically replace old Creeps or balance room staffing.
These are intentional teaching limits. The official documentation shows that persistent information can be stored through Creep Memory, and later architecture can use a field such as creep.memory.role. That belongs after the fixed-name concept is understood.
Use the Memory basics guide when you are ready to replace names with structured role data.
A role name does not run behavior
A Creep named Harvester1 can stand still forever. Its name is only a key and a teaching label.
Behavior appears only when the repeatedly executed game script:
- finds the Creep;
- selects a relevant target;
- calls an action method;
- reads the return code;
- responds again on later ticks.
The next three lessons turn the labels into real loops one responsibility at a time.
Completion check
You have completed this lesson when you can explain all of the following:
WORK,CARRY, andMOVEprovide abilities, not jobs;- Harvester, Upgrader, and Builder are player-defined responsibilities;
- two Creeps with the same body can perform different jobs;
- a name such as
Upgrader1does not callupgradeController()automatically; - fixed names are a beginner simplification, not a scalable staffing system.
Turn Upgrader1 into the first role-specific loop
The next lesson creates the first complete responsibility-specific behavior:
Make Upgrader1 harvest Energy and upgrade the Room Controller →
Return to the English beginner roadmap to review all twelve lessons in order.