Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Davaned Production #8

Open
wants to merge 230 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
230 commits
Select commit Hold shift + click to select a range
9316a87
Adding error check on controller sign length
Apr 9, 2019
011aae0
Adding blocked flag
Apr 9, 2019
9502e66
Adding simple collection during room clearing phase
Apr 10, 2019
69af3c5
Adding listSuspended command and adding more to clearRoom
Apr 10, 2019
c92e6fd
Adding simple collection during room clearing phase
Apr 10, 2019
d7a8602
Adding listSuspended command and adding more to clearRoom
Apr 10, 2019
b856ce5
Adding an upgrade rate increase
Apr 10, 2019
d6bc898
Adding error check on controller sign length
Apr 9, 2019
238a73d
Adding blocked flag
Apr 9, 2019
e1f21e5
Adding simple collection during room clearing phase
Apr 10, 2019
dacaac5
Adding listSuspended command and adding more to clearRoom
Apr 10, 2019
31ee143
Merge branch 'master' of github.com:MatthewARoy/Overmind
Apr 10, 2019
ec921b7
Initial power mining commit
Apr 16, 2019
203cb31
Adding task to recover terminal resources on founding new room
Apr 15, 2019
d457f72
Initial power mining commit
Apr 16, 2019
8833213
Merge branch 'initalPowerHarvesting' into production
Apr 16, 2019
6875ebe
Adding more functionality to power mining
Apr 17, 2019
d149a6b
Merge branch 'initalPowerHarvesting' into production
Apr 17, 2019
002d30d
Merge branch 'pioneerSaveController' into production
Apr 18, 2019
c0633da
Merge branch 'pioneerSaveController' into production
Apr 18, 2019
5633a28
Adding special hauling logic
Apr 22, 2019
26c8c20
Merge branch 'initalPowerHarvesting' into production
Apr 22, 2019
dd98468
Fixing haul directive for unseen rooms
Apr 22, 2019
303e437
Merge branch 'initalPowerHarvesting' into production
Apr 22, 2019
4e1ff94
Don't push, unobscficate
Apr 22, 2019
5af306c
Initial commit for power harvesting
Apr 22, 2019
b6d1701
Merge branch 'initalPowerHarvesting' into production
Apr 22, 2019
5a3314b
Initial power harvesting commit
Apr 22, 2019
1d3af15
Merge branch 'initalPowerHarvesting' into production
Apr 22, 2019
6545f67
Merge branch 'unobscf' into production
Apr 22, 2019
5839055
Fixing healing (somewhat)
Apr 22, 2019
8c325f2
Merge branch 'initalPowerHarvesting' into production
Apr 22, 2019
2bb1311
Really clunky patch to make power harvest part of core directive
Apr 23, 2019
1f9edeb
Merge branch 'initalPowerHarvesting' into production
Apr 23, 2019
a037189
fixing some power harvesting (honestly can't remember)
Apr 24, 2019
35476b2
Adding hauling
Apr 25, 2019
045ffac
Merge branch 'initalPowerHarvesting' into production
Apr 25, 2019
5bc27cb
Removing notification
Apr 25, 2019
1027ff7
Merge branch 'blockRoom' into production
Apr 25, 2019
c5c0ebf
Look at this point I'm just storing more code
Apr 25, 2019
2f45e86
Cleaning up some code
Apr 25, 2019
788fafb
Merge branch 'initalPowerHarvesting' into production
Apr 25, 2019
e41fed1
Adding configurable ranges and cleaning up
Apr 27, 2019
45a68a9
Finalizing
Apr 27, 2019
7233a9d
Merge branch 'initalPowerHarvesting' into production
Apr 29, 2019
9f3d378
storing for transfer
May 3, 2019
3cbf89a
Adding mining termination
May 6, 2019
14942bc
Merge branch 'initalPowerHarvesting' into production
May 6, 2019
1901aae
Adding termination logic
May 7, 2019
acdb6a2
Merge branch 'initalPowerHarvesting' into production
May 7, 2019
b7dc165
Adding listing directive console command
May 7, 2019
4ad4458
Merge branch 'consoleCommands' into production
May 7, 2019
1781f15
Moar stuff
May 8, 2019
f49a075
PR comments
May 8, 2019
9261391
fixing a NPE on case with no drills
May 8, 2019
ddf64af
Merge branch 'initalPowerHarvesting' into production
May 8, 2019
c25ab15
Merge branch 'master' into production
May 8, 2019
6cb2a8b
Merge remote-tracking branch 'upstream/master' into production
May 9, 2019
67fa7ef
Invasion defense improvements
May 9, 2019
d951040
Updating info for combat creeps as well
May 9, 2019
d7d3a7a
Merge branch 'consoleCommands' into production
May 9, 2019
73e6161
Adding invasion improvements
May 10, 2019
fa0a21c
Fixing termination again
May 10, 2019
6844c03
Merge branch 'initalPowerHarvesting' into production
May 10, 2019
d112941
Merge branch 'invasionDefenseImprovements' into production
May 10, 2019
dcbcddd
Tiny log statement
May 10, 2019
ba29f37
Fix bug
May 10, 2019
198c87d
Merge branch 'invasionDefenseImprovements' into production
May 10, 2019
b32c441
Double mining
May 10, 2019
821ff6a
Merge branch 'doubleMiner' into production
May 10, 2019
63d90cc
More logic
May 10, 2019
190bf5b
Merge branch 'doubleMiner' into production
May 10, 2019
c38828c
Merge branch 'master' into doubleMiner
May 10, 2019
911cb95
Merge branch 'master' into production
May 10, 2019
84d9cc2
Merge branch 'LurkerBunkerDefense' into production
May 10, 2019
dedcf62
Fixing !walkable
May 14, 2019
4e2e191
Merge branch 'doubleMiner' into production
May 14, 2019
2c9841a
Merge branch 'LurkerBunkerDefense' into production
May 14, 2019
ccc89d3
Adding a harass directive to annoy remote mines
May 14, 2019
93fdf88
Merge branch 'LurkerBunkerDefense' into production
May 14, 2019
71b3b13
Merge branch 'harassDirective' into production
May 14, 2019
cd4aa85
Improve logging and nextdoor case
May 14, 2019
79aa830
Merge branch 'doubleMiner' into production
May 14, 2019
7d41324
Fixing some movement bugs, still need to properly flee
May 14, 2019
e7d5dc5
More stuff
May 14, 2019
98ce8ae
Merge branch 'harassDirective' into production
May 14, 2019
cb3ddf5
Maybe fixing a "could not access room" error?
May 15, 2019
9a99340
Merge branch 'master' into production
May 15, 2019
0eba255
Fixing up logging
May 15, 2019
be572fd
Merge branch 'initalPowerHarvesting' into production
May 15, 2019
06462c0
Merge branch 'master' into initalPowerHarvesting
May 15, 2019
63d7a97
Small hauler improvement
May 15, 2019
3b7c514
Merge branch 'initalPowerHarvesting' into production
May 15, 2019
f8c15b9
Merge branch 'LurkerBunkerDefense' into production
May 15, 2019
6a361ea
Invasion improvements
May 15, 2019
219a0f8
Small diff
May 15, 2019
01c03d6
Merge branch 'LurkerBunkerDefense' into production
May 15, 2019
5c0d68b
fixing logging
May 15, 2019
6ce218a
Merge branch 'doubleMiner' into production
May 15, 2019
fbdc03a
Adjusting hydro boosted body to output more damage and have more healing
May 15, 2019
4cc1a86
Merge branch 'invasionImprovementsNew' into production
May 15, 2019
e26c52b
Swapping to the obsc version
May 15, 2019
11ab43e
Improving harass logging
May 15, 2019
d1d32c9
Merge branch 'harassDirective' into production
May 15, 2019
9d17bbc
Fixing harass NPE
May 15, 2019
f3f888d
Merge branch 'harassDirective' into production
May 15, 2019
773f544
Merge branch 'LurkerBunkerDefense' into production
May 17, 2019
a1cd462
Removing logging message
May 20, 2019
75f8ea2
Merge branch 'doubleMiner' into production
May 20, 2019
712e615
Currently directive removal isn't occurring properly, seeing if this …
May 20, 2019
2164f82
Merge branch 'initalPowerHarvesting' into production
May 20, 2019
9f6274c
Prevent workers from trying to upgrade blocked controllers and added …
May 20, 2019
fb26083
Merge branch 'workerImprovement' into production
May 20, 2019
816b1a3
Adding controller saving to pioneer
May 21, 2019
767ae76
Merge branch 'workerImprovement' into production
May 21, 2019
5812be3
Removing mineral mining in rooms without terminal
May 21, 2019
17cf09c
Merge branch 'workerImprovement' into production
May 21, 2019
f3a5ac8
Removing bad imports
May 21, 2019
1c6ae70
Merge branch 'master' into cleanRoomImprovements
May 21, 2019
ed5aeb9
Merge branch 'cleanRoomImprovements' into production
May 21, 2019
d4dbb74
Removed noisy logging
May 21, 2019
d890dcc
Merge branch 'doubleMiner' into production
May 21, 2019
9a1a334
Updating power mining to use a state instead of the gibberish from be…
May 22, 2019
20f3551
Merge branch 'initalPowerHarvesting' into production
May 22, 2019
4a146cc
Fixing if statement
May 22, 2019
e75f8b8
Merge branch 'initalPowerHarvesting' into production
May 22, 2019
1f34e32
Adding partial power directive, needs the powers first
May 22, 2019
2b207b6
More work done
May 23, 2019
e0e5ed3
Merge branch 'LurkerBunkerDefense' into production
May 24, 2019
0269749
Adding required rcl
May 24, 2019
f051526
Merge branch 'initalPowerHarvesting' into production
May 24, 2019
bc6cf9d
Adjusting rcl and exit conditions for states
May 24, 2019
493691c
Merge branch 'initalPowerHarvesting' into production
May 24, 2019
1d54bf0
Fixing RCL
May 24, 2019
960a605
Merge branch 'initalPowerHarvesting' into production
May 24, 2019
b06b8ba
Fixing logging
May 24, 2019
6acca9b
Merge branch 'initalPowerHarvesting' into production
May 24, 2019
10b783d
Minor tweaks to states
May 24, 2019
dc501c4
Merge branch 'initalPowerHarvesting' into production
May 24, 2019
835fed9
Opgen part done
May 24, 2019
2062d72
Making the tasks work
May 25, 2019
3fca31d
Temporary commit, remove later
May 25, 2019
41bb900
New DirectivePoisonRoom
May 26, 2019
e440d20
New DirectivePoisonRoom
May 26, 2019
47cf1d5
avoid colonization
May 26, 2019
97f44dc
Adding nuker to hauling
May 27, 2019
c1d8798
Fixing !
May 27, 2019
48505b4
Merge branch 'cleanRoomImprovements' into production
May 27, 2019
c3f0e33
Preventing removing directive if room not unclaimed and createIfPrese…
May 27, 2019
81df20d
Merge branch 'cleanRoomImprovements' into production
May 27, 2019
7a54543
Adding fill nuker only when off cd
May 27, 2019
d36b185
Merge branch 'invasionImprovementsNew' into production
May 27, 2019
b21fb41
Reducing number of nuke protected locations, won't protect roads etc …
May 27, 2019
a36a824
Merge branch 'nukeResponse' into production
May 27, 2019
9937da7
Reducing to in range2 based on nukes having a 5x5 area
May 27, 2019
9da0e9b
Merge branch 'nukeResponse' into production
May 27, 2019
312ecee
This doesn't work, but should only be megareinforcing the nuked rampa…
May 27, 2019
1861bae
Forgot the length param...
May 27, 2019
f8e5592
Merge branch 'nukeResponse' into production
May 27, 2019
992afee
Merge branch 'master' into harassDirective
May 27, 2019
1579790
Just for fun, a distraction Overlord for making creeps that just run …
May 27, 2019
7eb1196
Merge branch 'distraction' into production
May 29, 2019
3b0ce18
fixed alert notification
Jun 1, 2019
72f9986
denied creation of any other diretives in the room
Jun 1, 2019
f679b47
added RoomPoisonerOverlord
Jun 2, 2019
9c12188
fixed wall cite not walkable issue
Jun 2, 2019
a4f3556
force claimer suicide
Jun 2, 2019
dbb0acd
fix target for tasks.build
Jun 2, 2019
475a00c
directive remove csite instead of creep
Jun 3, 2019
fe3521d
remove containers
Jun 3, 2019
1633e5d
Fixed COLOR mismatch
Jun 3, 2019
cf9393e
patch corner cases
Jun 3, 2019
b0ce31b
patch corner cases2
Jun 3, 2019
a3951ee
optimization
Jun 3, 2019
b165a12
optimization2
Jun 3, 2019
1d7ae99
optimization3
Jun 3, 2019
ca102ea
optimization4
Jun 3, 2019
c2ac121
isWalkable ignore creeps
Jun 3, 2019
e07072e
FIND_HOSTILE_CONSTRUCTION_SITES
Jun 3, 2019
c003470
added outpostDefense and attackController
Jun 4, 2019
5e73a07
Merge branch 'PoisonRoomDirective' into production
Jun 4, 2019
35bd4d2
added davaned's ideas
Jun 5, 2019
882a488
added corner case of controller blocked before sources
Jun 5, 2019
0b1c9d5
extra checks
Jun 5, 2019
48fc6ba
from dangerouHostile to hostiles
Jun 5, 2019
5da36f5
send defences if hostiles and not poisoned
Jun 5, 2019
c3a9b0c
spawn poisoner if no dangrous hostile player, spawnDefense when any h…
Jun 5, 2019
a031549
this.room
Jun 5, 2019
09bc923
prevent DirectiveInvasionDefense
Jun 5, 2019
3dbe713
Merge branch 'PoisonRoomDirective' into production
Jun 5, 2019
464e5ad
Merge branch 'PoisonRoomDirective' into production
Jun 5, 2019
14fb752
Tracking enemy creep expenditure
Jun 6, 2019
cf60110
Merge branch 'trackEnemyCreeps' into production
Jun 6, 2019
c232b19
Adding default
Jun 6, 2019
2e397d6
Fixing tracker
Jun 6, 2019
cba30d1
Merge branch 'trackEnemyCreeps' into production
Jun 6, 2019
3473b8e
Adding zone data fetch
Jun 7, 2019
1155135
Adding to memory and printing
Jun 7, 2019
2e9e387
Adding storage and utils for checking
Jun 7, 2019
5a3e518
!! for false
Jun 7, 2019
96992ec
PR logging cleanup
Jun 7, 2019
1535a81
Merge branch 'noviceProtection' into production
Jun 7, 2019
108c55b
Storing new operator form quickly
Jun 12, 2019
eddc945
Prioritize re-upgrading controller if it was downgraded
Jun 12, 2019
016e2dc
Merge branch 'workerImprovement' into production
Jun 12, 2019
291e61e
Merge branch 'master' into distraction
Jun 13, 2019
0f7a554
Distraction updates
Jun 13, 2019
b8254c8
Updating distraction and lint
Jun 14, 2019
bbb55d3
Merge branch 'master' into workerImprovement
Jun 14, 2019
7504fc6
Lint
Jun 14, 2019
b339002
Merge branch 'LurkerBunkerDefense' into production
Jun 14, 2019
6d495c1
Merge branch 'harassDirective' into production
Jun 14, 2019
d6c55f8
Merge branch 'distraction' into production
Jun 14, 2019
14ac9bc
Deletes all room flags before cleanup
Jun 18, 2019
81c1f12
Merge branch 'master' into cleanRoomImprovements
Jun 18, 2019
0acfbda
Merge branch 'cleanRoomImprovements' into production
Jun 18, 2019
36838a8
Only make container if the mineral is ready, as some improvements to …
Jun 21, 2019
0266261
Merge branch 'workerImprovement' into production
Jun 21, 2019
9b09a15
Making miners be more optimized
Jun 24, 2019
9aa1b10
Merge branch 'workerImprovement' into production
Jun 24, 2019
a9b5e17
Collect non-energy first
Jun 24, 2019
d7a0443
Merge branch 'cleanRoomImprovements' into production
Jun 24, 2019
ac1783d
Minor body modification to prevent dropping on ground, need to work o…
Jun 25, 2019
9b77aa0
Merge branch 'workerImprovement' into production
Jun 25, 2019
fc0bef4
Modified body back and put a .95 on the harvest valid. Might want to …
Jun 25, 2019
25d118b
Merge branch 'workerImprovement' into production
Jun 25, 2019
05eba44
Basic combat intel damage matrix
Jun 26, 2019
acbc52f
Merge branch 'combatBrain' into production
Jun 26, 2019
75385ee
Adding power spawn processing
Jul 17, 2019
804e8be
Merge branch 'powerCreepDirective' into production
Jul 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/Colony.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {$} from './caching/GlobalCache';
import {log} from './console/log';
import {StoreStructure} from './declarations/typeGuards';
import {DirectiveExtract} from './directives/resource/extract';
import {DirectivePoisonRoom} from './directives/offense/poisonRoom';
import {_HARVEST_MEM_DOWNTIME, _HARVEST_MEM_USAGE, DirectiveHarvest} from './directives/resource/harvest';
import {HiveCluster} from './hiveClusters/_HiveCluster';
import {CommandCenter} from './hiveClusters/commandCenter';
Expand Down Expand Up @@ -311,7 +312,7 @@ export class Colony {
$.set(this, 'sources', () => _.sortBy(_.flatten(_.map(this.rooms, room => room.sources)),
source => source.pos.getMultiRoomRangeTo(this.pos)));
for (const source of this.sources) {
DirectiveHarvest.createIfNotPresent(source.pos, 'pos');
!DirectivePoisonRoom.isPresent(source.pos, 'room') && DirectiveHarvest.createIfNotPresent(source.pos, 'pos');
}
$.set(this, 'extractors', () =>
_(this.rooms)
Expand All @@ -320,7 +321,7 @@ export class Colony {
.filter(e => (e!.my && e!.room.my)
|| Cartographer.roomType(e!.room.name) != ROOMTYPE_CONTROLLER)
.sortBy(e => e!.pos.getMultiRoomRangeTo(this.pos)).value() as StructureExtractor[]);
if (this.controller.level >= 6) {
if (this.controller.level >= 6 && this.terminal) {
_.forEach(this.extractors, extractor => DirectiveExtract.createIfNotPresent(extractor.pos, 'pos'));
}
$.set(this, 'repairables', () => _.flatten(_.map(this.rooms, room => room.repairables)));
Expand Down Expand Up @@ -546,6 +547,13 @@ export class Colony {
return allAssets;
}

private runPowerSpawn() {
if (this.powerSpawn && this.assets.energy > 300000 && this.powerSpawn.energy > 50
&& this.powerSpawn.power > 0) {
this.powerSpawn.processPower();
}
}

/**
* Initializes the state of the colony each tick
*/
Expand All @@ -567,6 +575,7 @@ export class Colony {
this.linkNetwork.run(); // Run the link network
this.roadLogistics.run(); // Run the road network
this.roomPlanner.run(); // Run the room planner
this.runPowerSpawn(); // Run power spawn - short term
this.stats(); // Log stats per tick
}

Expand Down
18 changes: 12 additions & 6 deletions src/Overseer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {DirectiveOutpost} from './directives/colony/outpost';
import {DirectiveGuard} from './directives/defense/guard';
import {DirectiveInvasionDefense} from './directives/defense/invasionDefense';
import {DirectiveOutpostDefense} from './directives/defense/outpostDefense';
import {DirectivePoisonRoom} from './directives/offense/poisonRoom';
import {Directive} from './directives/Directive';
import {Notifier} from './directives/Notifier';
import {DirectiveBootstrap} from './directives/situational/bootstrap';
Expand Down Expand Up @@ -215,7 +216,7 @@ export class Overseer implements IOverseer {
// Place defensive directive after hostiles have been present for a long enough time
const safetyData = RoomIntel.getSafetyData(colony.room.name);
const invasionIsPersistent = safetyData.unsafeFor > 20;
if (invasionIsPersistent) {
if (invasionIsPersistent && !DirectivePoisonRoom.isPresent(colony.pos, 'room')) {
DirectiveInvasionDefense.createIfNotPresent(colony.controller.pos, 'room');
}
}
Expand All @@ -242,10 +243,14 @@ export class Overseer implements IOverseer {
if (alreadyAColony || alreadyAnOutpost) {
return false;
}
const alreadyOwned = RoomIntel.roomOwnedBy(roomName);
const alreadyReserved = RoomIntel.roomReservedBy(roomName);
const disregardReservations = !onPublicServer() || MY_USERNAME == MUON;
if (alreadyOwned || (alreadyReserved && !disregardReservations)) {
let alreadyOwned = RoomIntel.roomOwnedBy(roomName);
let alreadyReserved = RoomIntel.roomReservedBy(roomName);
let isBlocked = Game.flags[roomName+"-Block"] != null;
if (isBlocked) {
//Game.notify("Room " + roomName + " is blocked, not expanding there.");
}
let disregardReservations = !onPublicServer() || MY_USERNAME == MUON;
if (alreadyOwned || (alreadyReserved && !disregardReservations) || isBlocked) {
return false;
}
const neighboringRooms = _.values(Game.map.describeExits(roomName)) as string[];
Expand Down Expand Up @@ -297,7 +302,8 @@ export class Overseer implements IOverseer {
}
// Place pioneer directives in case the colony doesn't have a spawn for some reason
if (Game.time % 25 == 0 && colony.spawns.length == 0 &&
!DirectiveClearRoom.isPresent(colony.pos, 'room')) {
!DirectiveClearRoom.isPresent(colony.pos, 'room') &&
!DirectivePoisonRoom.isPresent(colony.pos, 'room')) {
// verify that there are no spawns (not just a caching glitch)
const spawns = Game.rooms[colony.name]!.find(FIND_MY_SPAWNS);
if (spawns.length == 0) {
Expand Down
60 changes: 60 additions & 0 deletions src/console/Console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {color, toColumns} from '../utilities/utils';
import {asciiLogoRL, asciiLogoSmall} from '../visuals/logos';
import {DEFAULT_OVERMIND_SIGNATURE, MY_USERNAME, USE_PROFILER} from '../~settings';
import {log} from './log';
import {Overlord} from "../overlords/Overlord";

type RecursiveObject = { [key: string]: number | RecursiveObject };

Expand All @@ -26,6 +27,7 @@ export class OvermindConsole {
global.setLogLevel = log.setLogLevel;
global.suspendColony = this.suspendColony;
global.unsuspendColony = this.unsuspendColony;
global.listSuspendedColonies = this.listSuspendedColonies;
global.openRoomPlanner = this.openRoomPlanner;
global.closeRoomPlanner = this.closeRoomPlanner;
global.cancelRoomPlanner = this.cancelRoomPlanner;
Expand All @@ -36,6 +38,7 @@ export class OvermindConsole {
global.listConstructionSites = this.listConstructionSites;
global.listDirectives = this.listDirectives;
global.listPersistentDirectives = this.listPersistentDirectives;
global.directiveInfo = this.directiveInfo;
global.removeAllLogisticsDirectives = this.removeAllLogisticsDirectives;
global.removeFlagsByColor = this.removeFlagsByColor;
global.removeErrantFlags = this.removeErrantFlags;
Expand All @@ -44,6 +47,7 @@ export class OvermindConsole {
global.endRemoteDebugSession = this.endRemoteDebugSession;
global.profileMemory = this.profileMemory;
global.cancelMarketOrders = this.cancelMarketOrders;
global.setRoomUpgradeRate = this.setRoomUpgradeRate;
}

// Help, information, and operational changes ======================================================================
Expand All @@ -68,6 +72,7 @@ export class OvermindConsole {
descr['setLogLevel(int)'] = 'set the logging level from 0 - 4';
descr['suspendColony(roomName)'] = 'suspend operations within a colony';
descr['unsuspendColony(roomName)'] = 'resume operations within a suspended colony';
descr['listSuspendedColonies()'] = 'Prints all suspended colonies';
descr['openRoomPlanner(roomName)'] = 'open the room planner for a room';
descr['closeRoomPlanner(roomName)'] = 'close the room planner and save changes';
descr['cancelRoomPlanner(roomName)'] = 'close the room planner and discard changes';
Expand All @@ -78,6 +83,7 @@ export class OvermindConsole {
descr['listConstructionSites(filter?)'] = 'list all construction sites matching an optional filter';
descr['listDirectives(filter?)'] = 'list directives, matching a filter if specified';
descr['listPersistentDirectives()'] = 'print type, name, pos of every persistent directive';
descr['directiveInfo(directiveFlag)'] = 'print type, name, pos of every creep in directive';
descr['removeFlagsByColor(color, secondaryColor)'] = 'remove flags that match the specified colors';
descr['removeErrantFlags()'] = 'remove all flags which don\'t match a directive';
descr['deepCleanMemory()'] = 'deletes all non-critical portions of memory (be careful!)';
Expand Down Expand Up @@ -250,6 +256,17 @@ export class OvermindConsole {
}
}

static listSuspendedColonies(): string {
let msg = 'Colonies currently suspended: \n';
for (let i in Memory.colonies) {
let colonyMemory = Memory.colonies[i] as ColonyMemory | undefined;
if (colonyMemory && colonyMemory.suspend == true) {
msg += 'Colony ' + i + ' \n';
}
}
return msg;
}

// Room planner control ============================================================================================

static openRoomPlanner(roomName: string): string {
Expand Down Expand Up @@ -377,6 +394,40 @@ export class OvermindConsole {
return `Removed ${count} flags.`;
}

static directiveInfo(flagName: string): string {
let msg = '';
let directive = Overmind.directives[flagName];
if (!directive) {
return `ERROR: Name is not a current directive`
}
msg += `Type: ${directive.directiveName}`.padRight(20) +
`Name: ${directive.name}`.padRight(25) +
`Pos: ${directive.pos.print}\n`;
for (let overlordName of Object.keys(directive.overlords)) {
let overlord = directive.overlords[overlordName] as Overlord;
msg += JSON.stringify(overlord.creepUsageReport) + `\n`;
let zerg = overlord.getZerg();
let combatZerg = overlord.getCombatZerg();
for (let [roleName, zergArray] of Object.entries(zerg)) {
msg += `Role: ${roleName} \n`;
for (let zerg of zergArray) {
msg += `Name: ${zerg.name} Room: ${zerg.pos.print} TTL/Spawning: ${zerg.ticksToLive || zerg.spawning} \n`;
}
}
msg += `Combat zerg \n`;
for (let [roleName, zergArray] of Object.entries(combatZerg)) {
msg += `Role: ${roleName} \n`;
for (let zerg of zergArray) {
msg += `Name: ${zerg.name} Room: ${zerg.pos.print} TTL/Spawning: ${zerg.ticksToLive || zerg.spawning} \n`;
}
}
}

return msg;
}




// Structure management ============================================================================================

Expand Down Expand Up @@ -419,6 +470,15 @@ export class OvermindConsole {
return `Destroyed ${room.barriers.length} barriers.`;
}

// Colony Management =================================================================================================

static setRoomUpgradeRate(roomName: string, rate: number): string {
let colony: Colony = Overmind.colonies[roomName];
colony.upgradeSite.memory.speedFactor = rate;

return `Colony ${roomName} is now upgrading at a rate of ${rate} barriers.`;
}


// Memory management ===============================================================================================

Expand Down
41 changes: 37 additions & 4 deletions src/creepSetups/setups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export const Roles = {
healer : 'transfuser',
bunkerGuard : 'bunkerGuard',
dismantler: 'lurker',
drill : 'drill',
coolant : 'coolant',
roomPoisoner: 'salter',
};

/**
Expand All @@ -32,8 +35,9 @@ export const Setups = {

drones: {
extractor: new CreepSetup(Roles.drone, {
pattern : [WORK, WORK, CARRY, MOVE],
pattern : [WORK, WORK, MOVE],
sizeLimit: Infinity,
prefix: [CARRY, CARRY]
}),

miners: {
Expand Down Expand Up @@ -178,7 +182,12 @@ export const Setups = {
sizeLimit: 5,
}),

}
},

roomPoisoner: new CreepSetup(Roles.roomPoisoner, {
pattern : [WORK, CARRY, MOVE, MOVE],
sizeLimit: 4,
}),

};

Expand Down Expand Up @@ -230,14 +239,19 @@ export const CombatSetups = {
sizeLimit: Infinity,
}),

distraction: new CreepSetup(Roles.ranged, {
pattern : [MOVE, MOVE, MOVE, RANGED_ATTACK, MOVE],
sizeLimit: 1,
}),

default: new CreepSetup(Roles.ranged, {
pattern : [RANGED_ATTACK, RANGED_ATTACK, RANGED_ATTACK, MOVE, MOVE, MOVE, MOVE, HEAL],
sizeLimit: Infinity,
}),

boosted_T3: new CreepSetup(Roles.ranged, {
pattern : [TOUGH, TOUGH, RANGED_ATTACK, RANGED_ATTACK, RANGED_ATTACK, RANGED_ATTACK, RANGED_ATTACK,
MOVE, MOVE, HEAL],
pattern : [TOUGH, RANGED_ATTACK, RANGED_ATTACK, RANGED_ATTACK, RANGED_ATTACK, RANGED_ATTACK,
MOVE, MOVE, HEAL, HEAL],
sizeLimit: Infinity,
}),

Expand Down Expand Up @@ -349,4 +363,23 @@ export const CombatSetups = {

},

drill: {
default: new CreepSetup(Roles.drill, {
pattern : [MOVE, ATTACK, ATTACK, MOVE],
sizeLimit: Infinity,
}),
},

coolant: {
default: new CreepSetup(Roles.coolant, {
pattern : [HEAL, MOVE],
sizeLimit: Infinity,
}),
small: new CreepSetup(Roles.coolant, {
pattern : [HEAL, MOVE],
sizeLimit: 16,
}),
}


};
27 changes: 26 additions & 1 deletion src/declarations/memory.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
type operationMode = 'manual' | 'semiautomatic' | 'automatic';
/**
* 0: Basic
* 1: Collect from enemy storage/terminal
* 2: Collect from all sources TBD
* 3: Collect all and mine walls for energy TBD
*/
type resourceCollectionMode = number;

interface RawMemory {
_parsed: any;
Expand All @@ -21,14 +28,25 @@ interface Memory {
operationMode: operationMode;
log: LoggerMemory;
enableVisuals: boolean;
};
resourceCollectionMode: resourceCollectionMode;
powerCollection: {
enabled: boolean;
maxRange: number;
minPower: number;
};
}
profiler?: any;
stats: any;
constructionSites: { [id: string]: number };
// suspend?: number;
resetBucket?: boolean;
haltTick?: number;
combatPlanner: any;
reinforcementLearning?: any;
playerCreepTracker: {
[playerName: string]: CreepTracker
};
zoneRooms: { [roomName: string]: { [type: string]: number} };
reinforcementLearning?: {
enabled?: boolean;
verbosity?: number;
Expand Down Expand Up @@ -127,6 +145,13 @@ interface PathingMemory {
weightedDistances: { [pos1Name: string]: { [pos2Name: string]: number; } };
}

interface CreepTracker {
creeps: { [name: string]: number }; // first tick seen
types: { [type: string]: number}; // amount seen
parts: { [bodyPart: string]: number}; // quantity
boosts: { [boostType: string]: number}; // how many boosts are spent
}

interface FlagMemory {
[_MEM.TICK]?: number;
[_MEM.EXPIRATION]?: number;
Expand Down
11 changes: 11 additions & 0 deletions src/declarations/prototypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ interface Creep {
inRampart: boolean;
}

interface PowerCreep {
hitsPredicted?: number;
intel?: { [property: string]: number };
memory: CreepMemory;
fatigue: number;
body: BodyPartDefinition[];
boosts: _ResourceConstantSansEnergy[];
boostCounts: { [boostType: string]: number };
inRampart: boolean;
}

interface ConstructionSite {
isWalkable: boolean;
}
Expand Down
1 change: 1 addition & 0 deletions src/directives/Directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ export abstract class Directive {
if (this.isPresent(pos, scope)) {
return; // do nothing if flag is already here
}

const room = Game.rooms[pos.roomName] as Room | undefined;
if (!room) {
if (!opts.memory) {
Expand Down
Loading