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

Intel and Scouting System #100

Merged
merged 7 commits into from
Oct 1, 2017
Merged

Conversation

tedivm
Copy link
Contributor

@tedivm tedivm commented Sep 30, 2017

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, and Room. 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. The Room.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.

// Record room owner, level.
if (this.controller) {
if (this.controller.owner) {
roominfo[INTEL_OWNER] = this.controller.owner
Copy link
Contributor

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?

}

stompConstruction (creep) {
const construction = creep.pos.findClosestByRange(FIND_HOSTILE_CONSTRUCTION_SITES)
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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.

@ScreepsQuorumBot ScreepsQuorumBot merged commit 23f08d5 into ScreepsQuorum:master Oct 1, 2017
@ScreepsQuorumBot
Copy link
Member

This Pull Request has been merged by GitConsensus.

Vote Totals

Yes No Abstain Voters
3 0 0 3

Vote Breakdown

User Yes No Abstain
tedivm
TheRealMaxion
anisoptera

Vote Results

Criteria Result
Has Quorum True
Has Votes True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] World Scouting
3 participants