Navigation

    forum

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

    DilGaladh

    @DilGaladh

    11
    Posts
    1080
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    DilGaladh Follow

    Posts made by DilGaladh

    • RE: branch system

      Hi Artem,
      thanks very much. I believe it happened because I was connected at the very moment the change was done, that is the only thing I was doing: editing my code, then all vanished.

      posted in Technical Issues and Bugs
      DilGaladh
    • branch system

      It seems I lost all the code... how to get it back?

      posted in Technical Issues and Bugs
      DilGaladh
    • RE: Initial CPU usage

      The problem chris is that currently randomly my init cost goes to 42 cpu (like DarkTrooper7 says). How then am I supposed to be able to handle a memory that uses uniform cpu against ticks? It's a real nightmare.

      posted in Help
      DilGaladh
    • RE: Initial CPU usage

      I think some efforts should be made to help us there. I only have 4 rooms and reach the 100 CPU limit too often, trying to optimize most of my code, but it is very hard to figure out what costs much.

      posted in Help
      DilGaladh
    • RE: How much CPU does cycle eats.

      Thanks toolmaker, this helps a lot.. Still I really have weird results in term of CPU usage for simple harvesters... 100 cycles is so low!

      posted in Help
      DilGaladh
    • RE: Simulation room: findClosest no longer works correctly on source
              WWW
               SW
              H W
      

      H = harvester
      W = WALL
      S = source on wall

      posted in Technical Issues and Bugs
      DilGaladh
    • Simulation room: findClosest no longer works correctly on source

      Hi,

      I wanted to try again the survival challenge with my AI and started the simulation.
      My harvesters stupidly findClosest source and move to, then harvest, then go back to spawn.

      It turns out that the source in the middle is no longer found by findClosest at the exact tick a harvester is harvesting from the diagonal location.

      in case the explanation is not clear:

      XXXXXXXXWWW
      XXXXXXXXXDW
      XXXXXXXXHXW
      

      Can someone reproduce this? I'm sure that it happens for lot of people in the real game.

      posted in Technical Issues and Bugs
      DilGaladh
    • RE: Arrays in memory

      Hi, Thanks for the tip Toolmaker it was a proper assumption, but actually with tests I found the problem:
      I create an Array instead of an Object, so indexing with the id which is a string is not possible. I changed the inital usage variable to be a new Object() and now it rocks 🙂

      posted in Help
      DilGaladh
    • Arrays in memory

      Hi, I'm trying to use arrays in memory but I can't figure out what is wrong with the code. It seems the array is constantly destroyed every tick.

      Source.prototype.followUsage = function(opts) {
          if(this.ticksToRegeneration == 1)
          {
              if(!this.room.memory.usage)
              {
                  console.log("first pass");
                  this.room.memory.usage = new Array();
              }
              var id = this.id;
              var t =null;
      
              if(this.room.memory.usage[id] == undefined){
                  console.log("should pass only once here");
                  this.room.memory.usage[id] = new Array();
                  t = this.room.memory.usage[id];
                  console.log(t.toString());
                  t.push(0);
              }
              t.push((this.energyCapacity - this.energy) / this.energyCapacity * 100);
              /*if(t.length >10){
                  t.slice(1,9);
              }*/
              console.log("source "+id+" usage "+t[t.length-1]+"%");
              console.log("source "+id+" previous usage "+t[t.length-2]+"%");
              console.log(t.toString());
              // should not be necessary, anyway does not work
              this.room.memory.usage[id] = t;
          }
      };
      

      Every time it is fired, I get only 2 values in my array, 0 and the current %.

      posted in Help
      DilGaladh
    • RE: createCreep called twice in same Game.tick weird

      Ok, I get it now, thank you for the reminder, it's not a bug then.

      posted in Technical Issues and Bugs
      DilGaladh