Navigation

    forum

    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    1. Home
    2. chris
    • Flag Profile
    • block_user
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Groups
    • Blog

    chris

    @chris

    233
    Posts
    2401
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    chris Follow

    Posts made by chris

    • What's the official markup for code blocks in this forum

      Neither the three backticks ``` nor the indentation method seem to work for me. Inline code does not seem `to work as well`.

       

      However it should according to https://support.zendesk.com/hc/en-us/articles/203691016-Formatting-text-with-Markdown or am I mistaken?

      posted in Help
      chris
    • RE: Add the rest of the "functional" structures to the Room or Game objects

      You can just extend the Room prototype on your own.

       

      ```javascript

          Object.defineProperties(Room.prototype,{
              "powerspawn" : { get : _powerspawn },
              "my" : { get : _my },
          });

          function _powerspawn() { return this.find(FIND_MY_STRUCTURES,{filter:{structureType:STRUCTURE_POWER_SPAWN}})[0]; }
          function _my() {
              return this.controller && (this.controller.my || this.controller.reservation && this.controller.reservation.username === MY_NAME);
          }

      ```

      To improve performance, you can add an additional caching step, which pulls the IDs from memory if available (which might not necessarily be faster depending on your memory structure).

       

      posted in Feature Requests
      chris
    • RE: [Solved] Correct implementation of function library

      > all the most common functions my creeps could need to use

       

      This sounds like you should expand the according prototype:

       

      main.js

       

      ```

      require("Prototype_Creep");

      ```

      Prototype_Creep.js

       

      ```

          _.assign(Creep.prototype,{

              get : function(val){return this.memory[val]},

           });

      // or another way to write:

      Object.defineProperties(Creep.prototype,{

          "costs" : { get : costs },
          "Class" : { get : function(){return this.get("Class");}},
          "type" : { get : function(){return this.get("type");}},
          "task" : { get : function(){return this.get("task");}},
          MAX_LIFE : { value: CREEP_LIFE_TIME, enumerable:false,writable:false},
          MAX_BODYPARTS : { value: MAX_CREEP_SIZE , enumerable:false,writable:false},
      });

      ```

       

       

      posted in Help
      chris
    • RE: Big portal attack - monthly rollup

      I guess I will never understand, why people gloat about fighting people who don't fight back...

      posted in General Discussion
      chris
    • RE: How can I detect that I have respawned ?

      My script just sets a special "start" flag you can check. Once I'm a few ticks into the game, I disable the init script anyway to save CPU.

      posted in General Discussion
      chris
    • RE: 10 lifetime CPU for steam client

      @Raskvann, that is exactly my point. I did not reserve or distance mine, power harvesting only once in a blue moon when I was in the mood (and CPU bucket was full). I have a lot of code which I cannot run since it is (imo) impossible to do with 10 CPU. That's why I am asking, since the devs advertise it with "enough to run a couple of rooms".

      With only 1 maintenance creeps per room I ended up at 8 CPU average. This however was nothing else than mining, repairing ramparts, taking care that the controller does not downgrade and monitoring my rooms for attackers.

      posted in General Discussion
      chris
    • RE: 10 lifetime CPU for steam client

      @RaskVann I mean 11 CPU for all 10 rooms. Running 3 creeps per room taking care of maintenance and upgrading, occasionally running reactions and fending off attackers, that was basically all my script was doing atm. Had to keep memory at under 100kB, preferably under 50k, since parsing the memory json object takes a enormous amount of time.

      I despawned at the moment, because my credits (old model) ran out. Since maintaining a fully developed empire is considerably easier than building a new one from scratch I could not make up my mind yet to respawn somewhere with a 10 CPU limit.

      posted in General Discussion
      chris
    • 10 lifetime CPU for steam client

      I wonder if somebody is running successfully on that limit. I have 10 rooms and cannot get below the 10 CPU ( my avg is ~ 11 CPU ), just because of the sheer amount of basic scripts and checks I have running. So I wonder if it is really worth getting the client and have a serious shot on running a basic economy...

      I would appreciate if the limit was raised to 20 CPU like it was the minimum with the old credit model, since this would give some headroom to actually do something useful.

      posted in General Discussion
      chris
    • RE: Extreme increase in CPU usage with the same script

      I experienced the same yesterday - my usage jumped from 12 to 23. It is back to normal now.

      posted in Technical Issues and Bugs
      chris
    • RE: PTR Changelog 2016-05-23

      What are the constraints of these portals? Can they link to inhabited and reserved rooms or only to unoccupied ones?

      posted in News & Announcements
      chris