Useful Constants

From Screeps Wiki
Revision as of 23:59, 13 November 2020 by Donatzor (talk | contribs)
Jump to navigation Jump to search

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

This page will list constants either useful because they are missing from the official constants or because they might be interesting to know when solving certain ingame problems.

Missing constants (hardcoded in engine)

Knowing "constant worthy" values that do not have a constant set up in the engine yet is important especially now that private servers get more and more modifiable. This list will be useful to users since they can just use values without having to look them up in the engine code, but it might also help request missing constants from the devs (in case changing these currently hardcoded values might make the game more moddable).

Description Value Code sample
Creep fatigue removal multiplier. It works like this in the engine:

newFatigue = Math.max(0, oldFatigue - ( MOVEparts * multiplier))

-2 const MULT_CREEP_FATIGUE_REDUCTION = -2;
Max bucket value. The CPU bucket fills up to 10000 10000 const MAX_BUCKET = 10000;
Hits (Health/HitPoints) per-part of a creep 100 CREEP_HITS_PER_PART = 100;
username for the Invader NPCs 'Invader' INVADER_USERNAME = 'Invader';
Rate at which energy (progress) is dropped from construction sties,

when stomped (moved onto) by creeps.

0.5 CONSTRUCTION_SITE_STOMP_RATIO = 0.5;
Power of RANGED_MASS_ATTACK, dependent on range. { 1: 10, 2: 4, 3: 1} RANGED_MASS_ATTACK_POWER = { 1: 10, 2: 4, 3: 1};