Deposit respawn seems a bit generous



  • I'll preface this by saying I've not tested it, only read the code here and done theorycrafting: https://github.com/screeps/backend-local/blob/ptr/lib/cronjobs.js#L514-L581

    If I read this correctly, it's essentially saying a new deposit will spawn if sum(20 / cooldown) < 2.5. I think it's more clear to write:

    numDeposits < average cooldown / 8

    And whenever that's true a new deposit appears. If the average cooldown is over 80, you will have at least 10 deposits. Please correct me if I'm wrong here.

    Now getting to a cooldown of 80 for a single deposit is not hard. If you control the highway, getting it as an average is not hard. I wrote some code:

    function calcCooldown(harvested) {
        return Math.ceil(0.001*Math.pow(harvested,1.2))
    }
    
    function test(hpt, ticks) {
        let harvested = 0
        let cooldown = 0
        for (let i = 0; i < ticks; i++) {
            if (cooldown == 0) {
                harvested += hpt
                cooldown = calcCooldown(harvested);
            }
            else {
                cooldown--
            }
        }
        console.log(harvested);
        console.log(calcCooldown(harvested));
    }
    
    test(100, 1200)
    

    Which prints:

    6500
    38
    

    So a T1 boosted 25-work harvester will get a reasonable amount of cooldown in one run, harvesting 6500 from the deposit. If you actually put effort in you can multi-hit in a tick as well as increase harvest density. Lets say we go full T1 (including move) and get three creeps. That gives us 396 harvest/hit.

    test(396, 1200)
    12276
    81
    

    Doing one pass on a mineral with these three creeps gets us to a cooldown of 80. If we do that to all our deposits we get 10 deposits spawning. That's a lot. Have I got something wrong here? I can't help but feel that with even a little bit of effort put in you're going to be completely spammed with deposits. Multiple 48W boosted harvesters pulled in gets even higher. You'll never need to suffer the high cooldown really. Just send one wave at each deposit. Heck, maybe they could catch two in a pass given there will be so many.

    Now this is theorycrafting, so I don't know how it'll work out in practise. First glance seems to suggests the numbers are a bit out and deposits will spawn very frequently for anybody able to reach all the deposits on the two "bus" lanes per sector. Maybe that's intended behaviour, I don't know. It's kinda interesting as with this many deposits there may be multiple per room so "farming" them is going to lead to some interesting strategies. My first reaction is to just hit each one once then let it time out as you're much more efficient on the first hits than the later ones. There will be new deposits popping up very frequently and I think you can just get the initial burst and then decay it out safely. Spawn time is going to be the limiter.

    EDIT: A T1 factory is 12.5 consumption/tick. As you can see above a single deposit can yield 10/tick for the first pass with T1 boosts and 3 hitting points. FWIW it's significantly more if you use pulled harvesters. Maybe this is by design then to encourage a lot of factories? I guess otherwise you'd always be limited by resources. Hmmm.

    EDIT 2: I guess the more I think about it the more I'm ok with it given factory production rates. The single-pass and ignore strategy won't get you enough to saturate a single factory chain per sector: you'd need four sectors. Two-pass and ignore might do it as that'll increase deposit count and yield per deposit.



  • Upon further thinking I've decided I quite like how I think it works. It emphasises territory control (something players have requested) as you need to be able to harvest the entire 19 "bus" rooms of your sector to be able to set up a proper deposit farm and managing your farm requires quite a lot of effort and has multiple strategies. These strategies extend into the factory design - high tier commodities need fewer deposits and more power levels.