-
Notifications
You must be signed in to change notification settings - Fork 154
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
some improvement part 4 #533
Conversation
src/config.js
Outdated
@@ -112,7 +112,7 @@ global.config = { | |||
maxRooms: 8, | |||
cpuPerRoom: 13, // Necessary CPU per room, prevent claiming new rooms | |||
revive: true, | |||
maxDistance: 17, | |||
maxDistance: 10, |
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.
Why?
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.
my creepy died before they reach 17, so why seach for far away places, that aren't rechable
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.
Mind to write this as a comment to the line, so that we know in the future why we went in this direction?
src/config.js
Outdated
minEnergyAmount: 80000, | ||
maxEnergyAmount: 120000, | ||
minEnergyAmount: 40000, | ||
maxEnergyAmount: 50000, |
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.
Why?
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.
my terminal we full with energy at 80k+ and i had no space
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.
Mind to write this as a comment to the line, so that we know in the future why we went in this direction?
src/config.js
Outdated
@@ -242,7 +242,7 @@ global.config = { | |||
}, | |||
|
|||
market: { | |||
minAmountToSell: 100000, | |||
minAmountToSell: 50000, |
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.
Same here, I think we should explain why we set a specific value / change to a specific value in the config.
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.
same here, my terminal we full with energy at 80k+ and i had no space
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.
no only energy at 😄
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.
Mind to write this as a comment to the line, so that we know in the future why we went in this direction?
src/prototype_creep_startup_tasks.js
Outdated
@@ -117,6 +117,7 @@ Creep.recycleCreep = function(creep) { | |||
}; | |||
|
|||
Creep.getEnergy = function(creep) { | |||
creep.pickupEnergy(); |
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 want to add that, it should be in Creep.prototype.getEnergy
and not hidden in the abstraction.
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.
it will be removed in next PR. the hidden abstraction
we dont need.
i dont like Creep.getEnergy
and that method.push
stuff.
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.
hm, if you touch the PR anyway, I would suggest to remove it, if it get's anyway removed.
src/prototype_room_market.js
Outdated
(this.terminal.store[RESOURCE_ENERGY] > config.terminal.minEnergyAmount)) { | ||
const diffNeedEnergyRooms = _.difference(Memory.needEnergyRooms, Memory.canHelpRooms); | ||
const needEnergyRooms = _.size(diffNeedEnergyRooms) > 0 ? diffNeedEnergyRooms : Memory.needEnergyRooms; | ||
const myRoom = _.shuffle(needEnergyRooms)[0]; |
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.
Why not send to the closest one? It's cheaper
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 did that before, but than not all rooms get the energy they need, only the closest to the best farming, and i wannted to push as much in the controllers of all rooms as i could
src/prototype_room_market.js
Outdated
_.includes(Memory.canHelpRooms, this.name) && !_.includes(Memory.needEnergyRooms, this.name) && | ||
(this.terminal.store[RESOURCE_ENERGY] > config.terminal.minEnergyAmount)) { | ||
const diffNeedEnergyRooms = _.difference(Memory.needEnergyRooms, Memory.canHelpRooms); | ||
const needEnergyRooms = _.size(diffNeedEnergyRooms) > 0 ? diffNeedEnergyRooms : Memory.needEnergyRooms; |
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.
To be honest I wouldn't to that. We should rely on, that Memory.needEnergyRooms
and the ones which actually need energy. (Add they shouldn't be in the other list)
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.
you mean !_.includes(Memory.needEnergyRooms, this.name) &&
as i was working on the improvements, it did happen some times... i will remove
src/prototype_room_market.js
Outdated
Room.prototype.handleMarket = function() { | ||
if (!this.terminal) { | ||
if (!this.terminal || this.terminal.cooldown || this.terminal.cooldown > 0) { |
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 (!this.terminal || this.terminal.cooldown)
should be fine, if this.terminal.cooldown
is 0, it is a false
.
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.
sure, changed
…gyRooms, role_storagefiller added tooangel comments + improvements
cf49714
to
4d3d17a
Compare
8f19370
to
b40302c
Compare
added missing comment make codeclimate happy
b40302c
to
f06bbf6
Compare
should merged after #532 |
@@ -125,18 +125,13 @@ Creep.repairStructure = function(creep) { | |||
}; | |||
|
|||
Creep.prototype.getEnergyFromHostileStructures = function() { | |||
if (this.carry.energy) { | |||
return false; | |||
} |
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 would keep it like this. If the creep has energy we spare a find()
call = cpu usage
A new review, yeah.
|
# Conflicts: # src/prototype_creep_resources.js # src/prototype_creep_routing.js
please doubble check |
Added WIP until FIND_TOMBSTONES gets fixed
|
added pickupEnergy in getEnergy
better sellByOthersOrders
fixed canHelpRooms + needEnergyRooms
fixed energy and power transfer of role_storagefiller