Documentation request: order of execution of different actions



  • I think I've figured out that transfer (and most other things) happens before move. I don't have the skills or patience to test every other combination of actions. I'd love to see an official list of the order things happen in.





  • I've read that. A bunch of people on Slack went through some of the details with me. There are still unanswered questions, such as priority between pickup/withdraw/transfer if they would all fill the creep's capacity.



  • There weren't asked anything about pickup here, tho. Anyway:

    1. Calling move() doesn't affects any tick state until scheduling finished completely: u can think it's like u do all actions (attack, pickup etc.) with a "photo" of current tick state. That's why, for example, two creep can rangedAttack() each other even when they move by opposite directions from distance == 3 (it looks like they "pewing" subnormal long distance, which becomes 5 next tick).

    2. So, without moving, all actions obey the mentioned pipeline: u can attack (if current range == 1), transfer (if range == 1), rangedHeal (if range <= 3). You are right, pickup() isn't mentioned in the picture, but some lines below there is a valid example of possible simultaneous actions:

    creep.moveTo(target);
    creep.rangedMassAttack();
    creep.heal(target);
    creep.transfer(target, RESOURCE_ENERGY, amountTransfer);
    creep.drop(amountDrop, RESOURCE_ENERGY);
    creep.pickup(energy);
    creep.claimController(controller);

    ... and additional info:

    Simultaneously executed methods using CARRY body part don't affect each other. Each of them has the amount of energy available in the beginning of the tick. See more about this in Understanding game loop, time and ticks.



  • creep.transfer(target, RESOURCE_ENERGY, amountTransfer);
    creep.drop(amountDrop, RESOURCE_ENERGY);
    

    The pipeline seems to show that "only the rightmost" would do something of both transfer and drop, yet the example (above) says it can do both of these things. I don't quite follow. Can you transfer and drop? If so, only if you have enough energy? If not, because drop always takes precedence (according to the rightmost rule)?

    It would be great to have a full accounting of every single thing a creep could do with all pipelines, rather than the referenced "many" things in the pipelines. Even if some of the pipelines have only and exactly one item. (e.g., moving).

    Thoughts?

    Thanks!



  • If your creep has 500 Capacity and 250 energy, you can drop 100, transfer 100, pickup 100 and withdraw 100 all in the same tick.

    It says right on the image "When the total energy amount is not enough", at which point drop would override transfer.

    Needs to add pickup to the image though



  • The docs have a priority list for if you try to use/transfer more energy than you have.

    They don't have a list for if you try to get/receive more energy than  you can hold.

    I did some testing in sim. creepA with capacity 100 tried to pickup 100 and withdraw 100 in the same tick, and creepB tried to transfer 100 to creepA. Regardless of the order I put in the commands, the withdraw won and the other two didn't happen. Without withdraw, pickup beat transfer. I did not test reversing the roles (I've heard that sometimes creep age matters).

    👍