PTR Changelog 2019-06-24: Store and market


  • YP

    could you please push it to npm ? 🙂


  • Dev Team

    @w4rl0ck Private servers support is not implemented yet.



  • Excellent, and I agree with the returning leftover fee. Should help encourage a more diverse market. Thanks for the hard work!



  • Although it's "fair" to return unused fees, it discourages people pricing their orders "to sell" - so the spread will be wider, and less transactions will take place, as there's no penalty for having a sell order at such a high price that it never sells, or a buy order at such a low price that no-one sells into it.



  • @wtfrank While there is some downside in not having as much of a cost to place outlier orders, having the market price average will drastically reduce the impact of having far-off orders. In fact, given there is an average price I think that people will find their bad orders never really get completed. I think it's better for overall market health in the less traded regions, even if it does have some downsides.



  • hmm.. my creeps having problem withdrawing from tombstones.. always getting -7 INVALID_TARGET

    I cleared my main-loop and called directly for an example: 0_1561401946589_11fdc685-7fd7-4b81-bec3-f541607277c0-image.png


  • Dev Team

    @demawi Thanks, we'll take a look



  • and PowerCreeps can not withdraw generally also with a OK result.. but using GENERATE_OPS power works

    their carryCapacity is undefined..

    0_1561418133763_b1682f4a-7b83-4697-9375-6dd635654974-image.png

    Edit: ops consuming powers don't seem to work (at least OPERATE_EXTENSION). it returns with -6 ERR_NOT_ENOUGH_RESOURCES



  • shard2 halted.. no ongoing ticks anymore


  • Dev Team

    @demawi Fixed



  • seems there are more problems on shard2

    0_1561714606910_f7602bc2-cca7-4d85-9cb5-480ae4bf85b1-image.png

    probably only a short-term problem.. seems not a problem anymore..


  • Culture

    I'm very happy about this change. It brings information into the game that was previously only in the UI. Even scanning the market and keeping history data yourself couldn't tell you volume and price paid.

    There's also still value in scanning and keeping some of your own history, though, so anyone who already has that code isn't sad to have it.

    Also, I'm looking forward to getting the million credits or so back for my legendary energy order on shard0. 🙂


  • Dev Team

    @demawi we'll take a look, thank you



  • Code deployed to PTR doesn't match PTR branch on github, creep to creep transfer broken on currently deployed code. Line 25 of function prevents transfer to anything not a structure.

     if(!register.structures[target.id] || !utils.capacityForResource(data(target.id), resourceType)) {
                return C.ERR_INVALID_TARGET;
     }
    


  • When iterating through Storage.store (or any other .store) via for (var key in room.storage.store) one of the keys returned is .toString function, which I think it should not be returned.



  • @demawi said in PTR Changelog 2019-06-24: Store and market:

    and PowerCreeps can not withdraw generally also with a OK result.. but using GENERATE_OPS power works

    their carryCapacity is undefined..

    0_1561418133763_b1682f4a-7b83-4697-9375-6dd635654974-image.png

    Edit: ops consuming powers don't seem to work (at least OPERATE_EXTENSION). it returns with -6 ERR_NOT_ENOUGH_RESOURCES

    Still an issue. Without PowerCreeps also factories can hardly be tested



  • tombstone-pickup and usePower.PWR_OPERATE_FACTORY now working... but still having problems with PWR_OPERATE_EXTENSION it returns 0 but nothing happens (no cooldown nor extensions will be filled)


  • Dev Team

    PTR is updated with the latest fixes. Thanks for your reports!



  • I think we may want to create an official reverse shim before moving the .store to MMO.

    I had focused on whether the new .store would be backward compatible with the old plain Object. As far as I can tell that is the case. However, I discovered another failure that I fear might be quite common. In my case I was using something like if(!!struct.store) to change creep behavior when distributing energy among my structures. The new .store property didn't break my code (no errors) but my creeps stopped filling extensions.

    I worry that other players will get frustrated if they run into a similar issue. If we had an official snippet that might help a frustrated player quickly avoid the change to see if their problem goes away (prove to themselves that it's not the new .store at fault).

    I'm imagining something like mirroring .store to .cargo and removing .store from the structures that didn't have it previously. If .cargo is the wrong color of bikeshed it's an easy find replace in the snippet to pick a new one.

    Also the new name makes a clear verification path. Change all of your code to use .cargo instead of .store fixing it along the way. Once you no longer refer to .store anywhere remove the shim and Replace s/\.cargo/.store/g.

    if(globals.Store) {
      for (klass of [StructureExtension, StructureStorage ...]) {
        Object.setProperty(
          klass.prototype,
          'cargo',
          Object.getOwnPropertyDescriptor(klass.prototype, 'store');
      }
      for (klass of [StructureExtension, ...]) {
        delete klass.prototype.store;
        Object.setProperty(
          klass.prototype,
          'energy',
          { get() { return this.cargo? this.cargo.energy: 0; } }
        )
      }
    }
    
    // also clean up non-energy properties in StructurePowerSpawn, StructureLab, and StructureNuker
    

  • Dev Team

    This update has been deployed to ptr private server branch (version 4.0.0-beta.1) on both npm and Steam:

    npm install screeps@ptr
    

    Please note that this change includes backwards-incompatible data migration! It will upgrade your db.json file permanently on the first launch. New Steam client (currently in public-test-realm beta branch) will only connect to servers with version 4.0.0-beta.1 and later. After this change goes to production, Steam clients will no longer be able to connect to 3.x.x server version.