Mineral handling
Definition:
- Base mineral: Minerals which can be harvest in rooms
- Higher mineral: Minerals with can be gathered by reacting other minerals
Example config values:
-
high threshold: 100000
-
low threshold: 1000
-
Minerals are stored in the terminal
-
The base mineral which is available in a room, is stored up to high threshold after that sold in the market
-
Other base minerals can be ordered from other rooms or bought from the market
-
Each mineral should react higher minerals by themself and store up to low threshold
Mineral creep:
- Takes care that enough energy is in the terminal (high threshold)
- Takes care that minerals are in the labs for reaction
- Takes care that minerals are in the labs for boosting
To be boosted creeps:
- Order minerals for boosting, so that they are available when the creep is spawned
I would like to adapt the description while discussing, so that this can also end up in the README.
This is the initial description to keep as reference:
Definition:
- Base mineral: Minerals which can be harvest in rooms
- Higher mineral: Minerals with can be gathered by reacting other minerals
Example config values:
-
high threshold: 100000
-
low threshold: 1000
-
Minerals are stored in the terminal
-
The base mineral which is available in a room, is stored up to high threshold after that sold in the market
-
Other base minerals can be ordered from other rooms or bought from the market
-
Each mineral should react higher minerals by themself and store up to low threshold
Mineral creep:
- Takes care that enough energy is in the terminal (high threshold)
- Takes care that minerals are in the labs for reaction
- Takes care that minerals are in the labs for boosting
To be boosted creeps:
- Order minerals for boosting, so that they are available when the creep is spawned
this room setup caused full terminal, my carrys always transfer to extrator

added to Creep.prototype.transferToCreep right after
if (!Game.creeps[otherCreep.name]) {
continue;
}
this
// don't transfer to extractor, fixes full terminal?
if(Game.creeps[otherCreep.name].memory.role == 'extractor') {
continue;
}
Thx, for reporting, didn't consider that case. Solution valid, I like, PR or integrate in one of your other PRs would be nice.
My idea for this issue was mainly to discuss the higher level idea of mineral handling without digging too much into the current code / solution.
From a high level:
The code I have seen and like best builds the mineral processing system around a system of orders for compounds desirable for boosting usage. Orders spawn sub-orders for the required compounds to make the high tier compounds. These orders check 'myrooms' for available minerals and what I can react into, undesirable minerals/reactions are sold off, desirable minerals/reactions are purchased. Desirable compounds in my mind:
utrium hydride +100% attack effectiveness lemergium hydride +50% repair and build effectiveness without increasing the energy cost lemergium oxide +100% heal and rangedHeal effectiveness zynthium hydride +100% dismantle effectiveness ghodium hydride +50% upgradeController effectiveness without increasing the energy cost ghodium oxide -30% damage taken
These and their higher tier variants of them are the most valuable to me. Given that ghodium is very desirable and uses 4 of the 5 base minerals it is likely not best to sell off base minerals unless capacity is at the high level to sell.
Other considerations:
Layout and placement of mineral related buildings are not ideal for a mineral reacting room, TooAngel has a TODO to change placement of labs/terminal to be on the branch path to the extractor from the harvester path. This would improve efficiency. Additionally, if the terminal is placed close to the extractor and the mineral creep given 1 WORK part it can be the road builder/maintainer as it hauls energy to the terminal and labs. On the other hand, if the terminal is placed closer to the source it can be filled more easily and transfer energy from a high energy room to a low energy room more easily to help quickly build up new rooms, especially if a double/triple upgrader creep code is put in for new rooms at a high GCL/_sum(RCL)
Sounds interesting. The minerals are processed / ordered on a order for boosting? Not sure if I would prefer to have minerals lying around. (From each mineral (reacted / base) some).
I think a requirement should be, that a single room is able to boost creeps.
So getting minerals which the room don't have: See if a myRoom has it, if not get from market.
Do you think we should terminal transfer reacted minerals or only base minerals?
Regarding the boosting. http://support.screeps.com/hc/en-us/articles/203084991-API-Reference search 'BOOSTS', the boost improvements are available. My plan would have been, tag the creeps with desired boost improvements https://github.com/TooAngel/screeps/blob/master/src/role_repairer.js#L28 If a role gets spawned we try to boost it with the highest improvement possible. IMHO having a dynamic system could be beneficial. In the lower RCL/GCL phases you could still use the advantages of lower tier boosts. If the system runs good you anyway only get the good parts :-)
Layout: I think we should start with terminal at mineral and see how it goes. Mainly because of the quicker mineral mining and path building to the extractor. If you like to have a look, would be super awesome, someone else improving this code would be good. Happy to provide all kind of information about it.
Single room boosting creeps I agree, but aso make code so that it prioritized reactions that can be made without import :)
I think the upgrader creep would be the best to test
We do mineral handling and even boosting could work so I close this issue with the next PR.