Difference between revisions of "Remote Harvesting"

From Screeps Wiki
Jump to navigation Jump to search
Line 15: Line 15:
   
 
=== Miners & Haulers ===
 
=== Miners & Haulers ===
  +
The most common tactic for harvesting a nearby room for energy, each source is normally set up with a miner to dedicatedly harvest the energy and hauler(s) to transport it.
The most common tactic for harvesting a nearby room for energy, each source is normally set up with a 'team' of two or more creeps, normally one 'miner' and one 'hauler'. The miner will spawn and path to its designated [[source]] or [[roomPosition]] and dedicate its life to harvesting energy solely from the source assigned, in the mean time a hauler or haulers will travel back and forth from the location being mined to ferry energy from where the miner has dropped it (or container that it is mining to) and return it to the main room for storage, use, ect. This tactic is very useful as you can maximize the amount of energy you get from the sources with less travel back and forth.
 
  +
  +
==== Miner ====
  +
A Miner's job when spawned is to go to its designated [[source]] or [[roomPosition]] and spend its life-time solely harvesting energy. Known as [[Basic Harvesting|Static Harvesting]] the creep can normally be configured in a number of ways. If there are roads to the location, less move parts are needed saving energy spawning the creep, but requiring repair of the roads. There is also a trade-off to be gained with the number of work parts the miner was spawned with. Larger (more work parts) miners can strip a source faster, thus saving CPU by issuing less harvest [[Intent|intents]] they are however more expensive to spawn. Conversely, a smaller (less work parts) miner costs less to spawn but will have to issue more harvest intents to strip the source, using more CPU. Ultimately it is up to the user to determine what trade off is right for them/their bot.
  +
  +
==== Hauler ====
  +
A Hauler's job is primarily to transport energy from the location the miner is mining, back to the home-room for storage/use. Similar to miners, hauler's bodies can come in different sizes/forms. Larger haulers can be used to fetch large amounts of energy and do so from multiple locations but cost more to spawn, while smaller haulers can be used to constantly transport back and forth but tend to stick to one location. To maintain roads, some users even attach work part(s) to haulers to enable them to repair as they move back and forth. This does of course, cost energy on spawning and use some of their energy in-transit but does save on having a dedicated repair creep make the journey.
   
 
=== Reserving ===
 
=== Reserving ===

Revision as of 22:32, 25 October 2020

This article is a stub. You can help Screeps Wiki by editing to add more information.

Remote harvesting is a strategy used by many players to harvest more energy than is available in the rooms they own. It involves sending creeps into a nearby room, either an unowned room or a Source Keeper room, and harvesting the energy from those rooms and bringing it back.

Restrictions

There are multiple obstacles with remote mining. These include gaining vision to the room, making sure your code supports multiple room pathing, hauling resources back from the remove rooms, the threat of invaders, and the logistics of reserving the room.

Strategies

Generic & Long-range harvesters

The first and most basic of remote harvesting, generally generic body creeps or 'harvesters' can be allowed to either roam, or target adjacent rooms to look for more energy. On finding a source, they harvest their fill as their carry parts allow and return to their home room to use it on whatever task/goal/role they are assigned. While this can be a very easy method of gaining more energy than you could normally with the one-to-two sources provided in your default room, it does take your generic creeps outside the safety of your home room and, unless alot of creeps are involved it is hard to maximize the sources as time is required for the creeps to travel back and forth.

Miners & Haulers

The most common tactic for harvesting a nearby room for energy, each source is normally set up with a miner to dedicatedly harvest the energy and hauler(s) to transport it.

Miner

A Miner's job when spawned is to go to its designated source or roomPosition and spend its life-time solely harvesting energy. Known as Static Harvesting the creep can normally be configured in a number of ways. If there are roads to the location, less move parts are needed saving energy spawning the creep, but requiring repair of the roads. There is also a trade-off to be gained with the number of work parts the miner was spawned with. Larger (more work parts) miners can strip a source faster, thus saving CPU by issuing less harvest intents they are however more expensive to spawn. Conversely, a smaller (less work parts) miner costs less to spawn but will have to issue more harvest intents to strip the source, using more CPU. Ultimately it is up to the user to determine what trade off is right for them/their bot.

Hauler

A Hauler's job is primarily to transport energy from the location the miner is mining, back to the home-room for storage/use. Similar to miners, hauler's bodies can come in different sizes/forms. Larger haulers can be used to fetch large amounts of energy and do so from multiple locations but cost more to spawn, while smaller haulers can be used to constantly transport back and forth but tend to stick to one location. To maintain roads, some users even attach work part(s) to haulers to enable them to repair as they move back and forth. This does of course, cost energy on spawning and use some of their energy in-transit but does save on having a dedicated repair creep make the journey.

Reserving

Sources start out with 1500 energy in non-claimed or reserved rooms, so reserving them allows the sources to regenerate up to 3000 instead, allowing for more energy to be gained from the room. However, claim parts are expensive and so is having a creep constantly spam intents, which increases the more rooms you reserve. A creep with claim parts can reserve the controller in a proxy room (as long as it is not claimed) for one tick each claim part it has, and the 'reservation' will decay one each tick. The controller can have up to 5000 'reserved ticks' (effectively 4999 shown at any time), meaning you can have quite some time without a creep attending it. As claim (reserve) part creeps last only 600 ticks, balancing sending a creep to reserve and for how long, is important to both save energy & CPU.

Defense

As with any room you harvest energy in, around every 100,000 energy harvested, as long as there is one exit open to a neutral room invaders will attack. As creeps that harvest/transport/claim are normally non-combat creeps, and invaders by default live for 1500 ticks, simply letting them be can result in a large loss of energy. Effectively detecting, spawning and, deploying a combat creep to deal with the invaders automatically in a timely manner helps improve overall energy gains due to not needing downtime to avoid/respawn harvesting creeps.

With the advent of strongholds invaderCores can now spawn in rooms that are not owned by a user and start attacking/reserving a controller which can block your creeps from being able to harvest. As invaderCores are 'alien' technology and can not be dismantled by worker/harvester creeps, a creep needs to be dispatched to attack and remove the invaderCore. As some strongholds can spawn these quite often, dealing with them quickly and in a timely manner is critical.

Beyond NPC threats, other users can also disrupt your proxy harvesting. Other user's attacks tend to be more dynamic / threating so require some combat code to effectively deal with. But at base level, detecting the threat and responding to it is more or less the same as with an invader.

Transport & Storage

Once the energy has been hauled back to the main room, transporting it and storing it is the next step. With a generic/long range harvesters they can generally go about whatever task until they have to harvest energy again, while haulers normally will bring the energy back to one spot to be distributed to other tasks. This job is normally taken up by the Storage as it has a large capacity. Links, can also be used to help cut down on the movement intents when moving the energy around the main room. Known as edge links, haulers can transfer their energy into the link close to the rooms edge, and head back for another load allowing for faster back-and-forth travel from the proxy mining site. The link can then send the energy to another link in the room to be taken into storage or used for whatever purpose it needs.

Source Keeper Rooms

Each 10x10 sector of the map contains 8 source keeper rooms in a ring around the center. These rooms have no controller, so they cannot be owned. However, they contain 3 sources each, and each source contains a maximum of 4000 energy rather than 3000. This makes them a good source of energy. They also contain a mineral, just like other rooms, with an extractor already built on top that allows for harvesting.

However, these rooms are guarded by non-player Source Keepers, which will attack creeps that try to harvest the sources. In addition, non-player Invaders will appear in greater numbers with increased frequency and strength. Extra precautions must be taken to ensure the safety of your harvesters.