-
Notifications
You must be signed in to change notification settings - Fork 155
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
small fixes and improvements #707
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,6 +148,8 @@ global.config = { | |
|
||
commodities: { | ||
disabled: false, | ||
minRCL: 7, | ||
range: 6, | ||
}, | ||
|
||
pixel: { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,16 @@ Creep.prototype.getRoute = function() { | |
} | ||
|
||
let route = []; | ||
let useHighWay = false; | ||
switch (this.memory.role) { | ||
case 'carry': | ||
case 'claimer': | ||
case 'nextroomer': | ||
useHighWay = true; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure about this. Other creeps like |
||
|
||
if (this.memory.base !== this.memory.routing.targetRoom) { | ||
route = this.room.findRoute(this.memory.base, this.memory.routing.targetRoom); | ||
route = this.room.findRoute(this.memory.base, this.memory.routing.targetRoom, useHighWay); | ||
if (route < 0) { | ||
route = this.room.findRoute(this.memory.base, this.memory.routing.targetRoom, true); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ Room.prototype.spawnCheckForCreate = function() { | |
this.memory.queue.shift(); | ||
return false; | ||
} | ||
creep.ttl = creep.ttl || config.creep.queueTtl; | ||
creep.ttl = creep.ttl || Math.ceil(config.creep.queueTtl * _.size(CONTROLLER_DOWNGRADE) / this.controller.level); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please add a comment or extract it in a method with proper naming, so that it is clearer what it does. I have no clue why to integrate downgrade or controller level. |
||
if (this.findSpawnsNotSpawning().length === 0) { | ||
creep.ttl--; | ||
} | ||
|
@@ -195,9 +195,11 @@ Room.prototype.checkRoleToSpawn = function(role, amount, targetId, targetRoom, l | |
if (this.inQueue(creepMemory) || this.inRoom(creepMemory, amount)) { | ||
return false; | ||
} | ||
if (targetRoom !== base && typeof Game.map.getRoomStatus(targetRoom) !== 'undefined' && typeof Game.map.getRoomStatus(base) !== 'undefined') { | ||
if (Game.map.getRoomStatus(targetRoom).status !== Game.map.getRoomStatus(base).status) { | ||
return false; | ||
if (targetRoom !== base) { // should fix ci Error: No runtime status data | ||
if (Game.time > 230 && typeof Game.map.getRoomStatus(targetRoom) !== 'undefined' && typeof Game.map.getRoomStatus(base) !== 'undefined') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a try catch block. But |
||
if (Game.map.getRoomStatus(targetRoom).status !== Game.map.getRoomStatus(base).status) { | ||
return false; | ||
} | ||
} | ||
} | ||
return this.memory.queue.push(creepMemory); | ||
|
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.
So, this idea is to only store
myRooms
in Memory. All other rooms can be stored in the heap and recalculated. This makes sure that we don't reach the memory limit.Currently some other rooms are also stored in memory, but mostly with empty values.
Do you know a case where we want to have external rooms stored in memory?