Changelog 2016-03-14

Gameplay changes

  • Labs now produce 10 mineral units per reaction and have a 10 ticks reaction cooldown period.
  • Changed boost effects of the following mineral compounds:
    • lemergium hydride
    • lemergium acid
    • catalyzed lemergium acid
    • zynthium hydride
    • zynthium acid
    • catalyzed zynthium acid
    • ghodium hydride
    • ghodium acid
    • catalyzed ghodium acid

API changes

Have more questions? Submit a request

Comments

  • Dissi

    Nice changes, I like them.

    Could we introduce new things to PTR next time? the new cooldown broke my chemestry setup (easy fix, but annoying)

  • Avatar
    Artem from Screeps

    How did it break your code? This is not a breaking change of any kind. You can call `runReaction` every tick as before and everything will run as usual.

  • Dissi

    Well not exactly break, but I stored the exact amount of reactions it needed in memory, with the cooldown it tried to perform the reaction anyway, I did not check if the result was OK.

     

    The counter of the amount of reactions to run got diminished anyway, but the supplier labs were not empty yet when my code thought it was finished reacting.

    Later when the chemist-creep started filling it up, it still had some minerals inside the supplier labs, causing an error for when transferring.

     

     

    Code in question:

    for(var lab = 0 ; lab < result.length; lab++)
    {
    if(theRoom.memory.chemLab.rCount == 0)
    {
    log("Max amount of reactions consumed for room " + theRoom.name,"chemistry");
    theRoom.memory.chemLab.stage = CONST_CHEM_STATE_COLLECT_PRODUCE;
    return;
    }
    theRoom.memory.chemLab.rCount--;
    result[lab].runReaction(theLabs[0], theLabs[1]);
    }

     

     

    Fix was:

     

    for(var lab = 0 ; lab < result.length; lab++)
    {
    if(result[lab].cooldown != 0)
    {
    continue;
    }
    if(theRoom.memory.chemLab.rCount == 0) {
    log("Max amount of reactions consumed for room " + theRoom.name,"chemistry");
    theRoom.memory.chemLab.stage = CONST_CHEM_STATE_COLLECT_PRODUCE;
    return;
    }
    theRoom.memory.chemLab.rCount--;
    result[lab].runReaction(theLabs[0], theLabs[1]);
    }
     

     

     

     

     

    Edited by Dissi
  • Avatar
    Artem from Screeps

    You should not rely on scheduling commands this way. Even when you get OK code it doesn't mean that the scheduled action will take place due to parallel actions processing architecture.

  • Dissi

    It was still experimental code to get a feeling for the chemistry, I'm now checking if the supplier labs are empty

Powered by Zendesk