-
Notifications
You must be signed in to change notification settings - Fork 0
Settings & Tuning
Contents:
1. Object Accessors
2. Global Parameters
3. How to adjust Population?
4. Task Settings
OCS decorates several Screeps API objects with useful accessors.
-
Object cloaking
Any room object can be hidden from OCS logic using the cloak property.
<RoomObject>.cloak = <relative ticks|boolean>
-
Creep trace logging
Creep activities can be traced using the trace property.
<Creep>.trace = boolean
Global Parameters can be found in file parameter.js.
-
CHATTY
Creeps will say their current Action -
HONK
When movement is not possible along the predefined path, creeps will wait up to 2 ticks before recalculation.
A symbol will be said by the creep each time this happens (if true). -
OOPS
When miners don't find a link or container (and there is a hauler around), they will simply drop their energy.
A symbol will be said by the creep each time this happens (if true). -
SAY_ASSIGNMENT
Creeps will say a symbol, representing the action, every time they get an action assigned. -
SAY_PUBLIC
Creeps talk public -
DEBUG
Logs more details to console -
CENSUS_ANNOUNCEMENTS
Logs death and birth to the console. -
SPAWN_INTERVAL
Loops between regular spawn probe -
MAX_STORAGE_ENERGY
Preferred target amount of energy in storage. The upgraders size will increase to take care of higher levels. -
MIN_STORAGE_ENERGY
Minimal acceptable energy level in storage. This is required for the defense on demand system (spring gun). -
MAX_STORAGE_MINERAL
Maximum acceptable level of mineral in storage, which can be harvested in the current room -
MAX_REPAIR_LIMIT
Mapping between room controller level (RCL) and a max limit for towers to repair structures (e.g. walls can be repaired quite high which is not necessary in lower levels) -
LIMIT_URGENT_REPAIRING
Structures whose hits go below this value are treated as urgent repair, which will allow creeps to repair them (not only towers). -
GAP_REPAIR_DECAYABLE
Defines the missing hit points required before decaying structures get repaired -
MEMORY_RESYNC_INTERVAL
Interval to reload spawns & towers present in a room (will be cached) -
TIME_REPORT
Loops between room reports. -
REPORT_MAX_LENGTH
Max length (in characters) of a message to be send via notify. Statistic reports use this to truncate messages. -
REPORTS_PER_LOOP
Maximum amount of statistic notifications per loop. Messages will get cached until finally sent. -
ROAD_CONSTRUCTION_ENABLE
Build roads automatically. Tracks creep movement to evaluate good road position. -
ROAD_CONSTRUCTION_INTERVAL
Time between creep movement data gets evaluated to place new road positions. -
ROAD_CONSTRUCTION_MIN_DEVIATION
Minimal deviation from average amount of creep tracks per room-position (calculated per room), to allow a road to be build. -
ROAD_CONSTRUCTION_ABS_MIN
Minimal absolute amount of tracks per room-position, to allow a road to be build. -
TIME_ZONE
Times in notifications use server time. To display local time, a timeshift is required. This is the zone offset in hours (-12 through +12) from UTC. -
USE_SUMMERTIME
Boolean to define if you also want to calculate your local time regarding summertime. Please change isSummerTime in global.js to define the timerange when it is summertime in your zone. -
SPAWN_DEFENSE_ON_ATTACK
Room spawns defensive creeps, when an invader enters the room -
MANAGED_CONTAINER_TRIGGER
A container placed near to a controller as well as near to a source needs some special treatment. It should never get full (problem for the miner) and never get empty (problem for the upgrader).
This value defines the relative amount (from top or bottom), when it gets filled/emptied. -
ROUTE_PRECALCULATION
Evaluate room exits and ownership before each path calculation across rooms. Calculate the best room-route based on these informations. Limit pathfinding to those rooms. -
NOTIFICATE_INVADER
Log information about NPC invaders -
COMBAT_CREEPS_RESPECT_RAMPARTS
Don't let your own defense creeps move through your own ramparts. Melee creeps will enter the rampart, but not leave. Ranger will not enter it. -
PLAYER_WHITELIST
List of friendly players. Will not get attacked when moving into owned rooms.
Population, the amount of each creep type present, is controlled by adjusting spawning rules.
Spawning rules are defined in the Setup files for each creep type.
The spawn will always try to build as many and as big creeps as possible. Thus each Setup contains limitations how big or how many creeps it is allowed to produce. Those limits may get exceeded: If the current value is below a threshold it will be assumed to be valid to produce, but the new creep may finally exceed the threshold.
A regular probe of the spawn will occur every 10 loops. It will then check if it's possible to produce a new creep using this order:
- Miner
- Worker
- Hauler
- Upgrader
- Melee
- Ranger
- Healer
- Pioneer
- Privateer
- Claimer
The spawn will probe Setup.isValidSetup(spawn) for each type to determine, if a creep of this type should be build (where Setup is referred to as the creep types Setup object).
There are 2 options to modify spawning rates:
- overriding isValidSetup in the creep types Setup file to define a completely custom rule
- adjusting some certain other values which will be combined using the standard isValidSetup
For option 1 it's quite simple. Return true when a creep should be built.
For option 2 I'm going to describe the parameters.
Parameters to adjust spawning rates
Does not reflect the current state of implementation, but most parameters can still be found and still have the same meaning.
-
Setup.globalMeasurement
This boolean value defines, if comparisons with the existing population should be made room wide or globally. e.g. maxCount may define the maximum amount of creeps in the room or globally existing. -
Setup.minControllerLevel
Defines the minimum level the room controller must have to allow spawning of the creep type. -
Setup.minAbsEnergyAvailable
The minimal absolute amount of energy that must be available (contained in spawn or extensions) to allow spawning. May also be used to set/raise min. multiplicator level for part counts. -
Setup.minEnergyAvailable(spawn)
The minimal relative amount of energy that must be available (contained in spawn or extensions) to allow spawning. A number between 0 and 1.
0 = empty/allow always, 1 = 100%/only when full -
Setup.maxCount(spawn)
The maximal amount of creeps of that type, which is allowed at a time. May refer to room or game population (Setup.globalMeasurement). -
Setup.maxWeight(spawn)
Population is not only profiled using creep counts, but also using their weight, which is their price of energy. This function defines the maximal sum of weight from all creeps of that type, which is allowed at a time. May refer to room or game population (Setup.globalMeasurement).
Tasks are objective based systems which attempt to efficiently control the resources used to achieve a goal. Most are controlled by viral.parameter.js
values, but a few have in-memory settings. Each task has its own documentation:
Back to Wiki Home