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

small fixes and improvements #707

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mschultheiss83
Copy link
Contributor

@mschultheiss83 mschultheiss83 commented Feb 26, 2023

improvement for manual commands

  • respawnMe

improvement for room visuals:

  • added 1st Role/Queue

fixes:

  • handleReviveRoomQueueCarry: controller level should be at level 2 or above
  • isConstructingSpawnEmergency: wrong order => set value before reading it
  • checkForRoute: should use highway
  • reviveMyNow: do not send nextroomer if there are hostiles => less energy waste
  • some spaces
  • typo/missing spaces in prototype_room_find.js
  • harvestCommodities: move minRCL and range to config
  • findAttackCreeps: do not attack friends
  • ttl in creep queue, higher controller level => shorter ttl
  • typo/missing spaces in prototype_room_costmatrix.js
  • useHighway more often for carry, claimer and nextroomer
  • avoid hostile rooms
  • repairer found energy behind a wall, can not pickup
  • new line before: module.exports
  • hostileCreepCount not found
  • suppress Deleting from memory for empty objects

- respawnMe

improvement for room visuals:
- added `1st Role/Queue`

fixes:
- handleReviveRoomQueueCarry: controller level should be at level 2 or above
- isConstructingSpawnEmergency: wrong order => set value before reading it
- checkForRoute: should use highway
- reviveMyNow: do not send nextroomer if there are hostiles => less energy waste
- some spaces
- typo/missing spaces in prototype_room_find.js
- harvestCommodities: move minRCL and range to config
- findAttackCreeps: do not attack friends
- ttl in creep queue, higher controller level => shorter ttl
- typo/missing spaces in prototype_room_costmatrix.js
- useHighway more often for carry, claimer and nextroomer
- avoid hostile rooms
- repairer found energy behind a wall, can not pickup
- new line before: module.exports
- hostileCreepCount not found
- suppress Deleting from memory for empty objects
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.

Left some comments.

@@ -169,7 +169,9 @@ function cleanRooms() {
delete Memory.rooms[name];
}
if (Memory.myRooms.indexOf(name) < 0) {
console.log(Game.time, `Deleting ${name} from memory, no myRoom ${JSON.stringify(Memory.rooms[name])}`);
if (Object.keys(Memory.rooms[name]).length > 0) {
Copy link
Owner

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?

@@ -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);
Copy link
Owner

Choose a reason for hiding this comment

The 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 (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') {
Copy link
Owner

Choose a reason for hiding this comment

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

I added a try catch block.

But Game.map.getRoomStatus should only be called once and stored as variable, to save CPU and looks cleaner.

case 'claimer':
case 'nextroomer':
useHighWay = true;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Not sure about this.

Other creeps like sourcer or reserver might need to route through highway rooms as well. So which creeps shouldn't move throw highway rooms? repairer and universal, ... - creeps which shouldn't route at all.

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.

2 participants