-
Notifications
You must be signed in to change notification settings - Fork 54
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
Intel and Scouting System #100
Conversation
src/extends/room/intel.js
Outdated
// Record room owner, level. | ||
if (this.controller) { | ||
if (this.controller.owner) { | ||
roominfo[INTEL_OWNER] = this.controller.owner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be saving owner.username?
src/roles/spook.js
Outdated
} | ||
|
||
stompConstruction (creep) { | ||
const construction = creep.pos.findClosestByRange(FIND_HOSTILE_CONSTRUCTION_SITES) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we don't filter out construction sites in the same position as the creep then the creep can get stuck on sites that are instantly replaced
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought you couldn't place a construction site where a hostile creep was standing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've had stomping creeps get stuck that way before at least.
This Pull Request has been merged by GitConsensus. Vote Totals
Vote Breakdown
Vote Results
|
This gives everything needed for #84 except the portal data. It resolves #85.
This provides two new systems-
Intel
The intel system has a few components-
New
Room
functions-Room.prototype.getIntel
,Room.getIntel
,Room.prototype.saveIntel
,Room.getResourcesPositions
,Room. requestIntel
, andRoom. getScoutTarget
. These functions are backed by a segment but use a memory buffer to reduce CPU usage when saving.Scouting targets are set automatically when calls to
getIntel
fail to retrieve data or gets data that is too old. TheRoom.requestIntel
function can be called to manually add a target.If no valid targets are available then
Room. getScoutTarget
will return a neighboring room. It will prioritize unseen rooms first (if it encounters multiple unseen rooms it picks the closest to the supplied creep's parent room), and then will prioritize the room that hasn't been updated recently.Scouting
A new creep role,
Spook
, has been added. It does a few things-If it sees hostile construction sites in a room it steps on them.
If it sees an controller that isn't signed by the creep's player then the creep will sign it.
If it has nothing else to do it requests a new room target from
Room.getScoutTarget
and then travels to that room.