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.
Posts made by DilGaladh
-
RE: branch system
-
branch system
It seems I lost all the code... how to get it back?
-
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.
-
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.
-
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!
-
RE: Simulation room: findClosest no longer works correctly on source
WWW SW H W
H = harvester
W = WALL
S = source on wall -
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.
-
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 -
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 %.
-
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.
-
createCreep called twice in same Game.tick weird
Hi,
I coded some rules to generate creeps in a certain order, and was expecting this behavior:
createCreep(combination1); // cost higher, if not enough energy it is not a problem, second line will spawn a smaller version
createCreep(combination2); // cost less, fallback system, expect to be harmless if we have already asked to create a creep on previous line so I should get ERR_BUSYIn facts, it seems that this is always the latest that is taken into account and it overrides my creation request, so I had to inverse the logic for creation. But programmatically it leads to something not very intuitive. Am I doing something wrong?