Visitar URL original
[WIP] sourcer near storage deposits directly, no carry by sparr · Pull Request #435 · TooAngel/screeps · GitHub
Skip to content

[WIP] sourcer near storage deposits directly, no carry - #435

Open
sparr wants to merge 1 commit into
TooAngel:masterfrom
sparr:sourcer_storage
Open

sparr wants to merge 1 commit into
TooAngel:masterfrom
sparr:sourcer_storage

Conversation

@sparr

@sparr sparr commented Sep 23, 2017

Copy link
Copy Markdown
Contributor

The goal here is for a sourcer adjacent to the storage to deposit energy directly to the storage, without needing a carry. This is especially important if the carry would insist on standing in a spot that causes a traffic jam.

[WIP] pending more testing and possibly more improvements.

@ghost ghost added WIP labels Sep 23, 2017
@TooAngel

Copy link
Copy Markdown
Owner

The layout is currently. Each sourcer gets a link, which transfers the energy to the link at the storage. As long as there is no link, the sourcer simply drops the energy and the call carry mechanism drops in.

Pretty basic fits for most of the rooms. What you are describing is a special case within this logic,

We had similar cases where carries could block other creeps. I think a better approach if the carry wouldn't stand still, but flips between two positions while waiting on energy. This would allow other creeps to pass by.

@sparr

sparr commented Sep 23, 2017

Copy link
Copy Markdown
Contributor Author

So far this patch just has the sourcer deposit directly to the storage and not summon/spawn a carry. Thanks for the heads up that I need to have the layout skip one of the links and the sourcer not expect it, too. I'll have to wait until I have a room with links to test that.


if (nearStorage) {
const workParts = this.body.filter((part) => part.type === WORK).length;
if (_.sum(this.carry) > this.carryCapacity - workParts * 2) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not

if (_.sum(this.carry) > 0) {

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants