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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sparr
Copy link
Contributor

@sparr sparr commented Sep 23, 2017

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
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
Copy link
Contributor Author

sparr commented Sep 23, 2017

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
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) {

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