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

bug fix #393

Merged
1 commit merged into from
Sep 18, 2017
Merged

bug fix #393

1 commit merged into from
Sep 18, 2017

Conversation

kahojyun
Copy link
Contributor

@kahojyun kahojyun commented Sep 9, 2017

  • don't remove border walls placed by system
  • repairer stuck when there are system walls in room
  • Memory initialize
  • fix carry withdrawing energy from base storage
  • carry helper shouldn't transfer to creeps in targetRoom

@ghost
Copy link

ghost commented Sep 9, 2017

A new review, yeah.

Votes: 60/487
Coefficient: 0.123203285421
Merging in 8 days 11 hours
Age 0 days 6 hours

@ghost
Copy link

ghost commented Sep 10, 2017

A new review, yeah.

Votes: 65/487
Coefficient: 0.133470225873
Merging in 7 days 16 hours
Age 0 days 23 hours

@ghost
Copy link

ghost commented Sep 10, 2017

A new review, yeah.

Votes: 124/488
Coefficient: 0.254098360656
Merging in 6 days 7 hours
Age 1 days 3 hours

@@ -297,7 +303,8 @@ Creep.prototype.transferToCreep = function(direction) {
const creeps = adjacentPos.lookFor('creep');
for (let i = 0; i < creeps.length; i++) {
const otherCreep = creeps[i];
if (!checkCreepForTransfer(otherCreep)) {
// don't transfer to other base's creep, fix carry helper
if (!checkCreepForTransfer(otherCreep) || otherCreep.memory.base !== this.memory.base) {
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think this is the best approach. Maybe fixes the current issue.

I had a couple of cases where the external rooms of different base rooms are crossing each other and it doesn't matter to which room the energy is transferred.

I think the better approach would be checking for the direction. helper is the newest sort of carry usage, maybe we should rethink that, add a value to the memory to be able to check for them, have a different role type, ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about this.memory.helper && !otherCreep.memory.helper && otherCreep.memory.base !== this.memory.base?

In fact, I disabled transfer to carry in PR #403. I don't think it necessary to allow energy transfer between carries because it will mess up carry's routing.

Copy link
Owner

Choose a reason for hiding this comment

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

I think this approach is better. We can also restrict, that helpers can only transfer to helpers, carries only to carries that should be fine.

Not sure if I understand your last sentence

Copy link
Contributor Author

Choose a reason for hiding this comment

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

check out the new commit plz :)

I'm sorry for my poor English if my last sentence confuse you... I found that carries near pathStart will get energy from other carries and not move to their own target. This problem is obvious in low RCL rooms. I just forbade energy transfer between carries in my scripts so that every carry can reach their targets.

Copy link
Owner

@TooAngel TooAngel left a comment

Choose a reason for hiding this comment

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

Most of the changes I like, an exception is the transfer to other creeps.

Copy link
Owner

@TooAngel TooAngel left a comment

Choose a reason for hiding this comment

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

👍

@ghost
Copy link

ghost commented Sep 12, 2017

A new review, yeah.

Votes: 362/494
Coefficient: 0.732793522267
Merging in 3 days 18 hours
Age 0 days 5 hours

@TooAngel
Copy link
Owner

@kahojyun If you add 'Fixes #410' to the commit message of one of your commits, the issue will be closed automatically.

- don't remove border walls placed by system
- repairer stuck when there are system walls in room
- Memory initialize, fixes #410
- fix carry withdrawing energy from base storage
- carry helper shouldn't transfer to carries in targetRoom
@ghost ghost merged commit 21148c8 into TooAngel:master Sep 18, 2017
@kahojyun kahojyun deleted the bug-fix branch September 19, 2017 12:11
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants