I think it would not be much change for me, if it is correct in the game constants like "CONTROLLER_STRUCTURES".
Besides, i wonder how i can upload code there (via api), just use screeps.com and a new token?
I think it would not be much change for me, if it is correct in the game constants like "CONTROLLER_STRUCTURES".
Besides, i wonder how i can upload code there (via api), just use screeps.com and a new token?
@warinternal than there would be that constant of 500, thats what i meant; then i could directly use the magic 500. Of course some things depend on room/empire Status, but i just wanted to explain that with each aproach, changing the capacity would need some adjustments in code. I had no problem with it, as soon with the store change there is much to change nontheless.
But the only argument for now is that bigger Containers would make the game easier. Then, i am against a change. If you make everthing just easier, the game is just less a challenge and so, more boring. It would make coding good harvest/hauler code less rewarding. I know that in my lastest Code Version, i have/had problems to supply my upgraders container with energy. While bigger containers would make this easier, i totally liked the challenge.
Even when only changing the constants, it would be needed to adjust Code. For example, I use Containers as Buffers for different purpouses, and when the capacity changes, the amount of buffered energy would be inefficient, when i use 0.25 Times of Capacity for example as a Low limit, it would be to much with the value change. If i did different, i would have hardcoded numbers. Both cases, Code would work, but not optimal.
Doing Things not intended can break Code ofc. Like that memory hack for not destringify memory that i use, too. But i would not call a change breaking, cause its clear its not the documented use case.
@xenofix I had 1.6 MB of code when the RoomPosition change came, and i didn´t need to change one line because of it. All worked as before. I would not call that a breaking change. So switching boosting to Spawn would be a different thing, I totally agree with @Smokeman that changing boosting with labs would only make screeps "more boring" by making the logistics simpler.
@mrfaul said in Trying to create creeps in a more dynamic way:
@saruss nope, you would nest arrays that way. But you could do:
body.push.apply(basicBodyParts);
The
apply()
is part of the function object/class and feeds a array as the parameters.
@MrFaul Nope, i would not nest arrays. Please read what that three small dots make there: (eg here: https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Operators/Spread_operator )
@calfa said in Trying to create creeps in a more dynamic way:
with... for(let i in basicBodyParts){ body.push(basicBodyParts[i]; }
i would suggest
body.push(...basicBodyParts);
I did not read your files, but every gamestate changing action has a cost of 0,2 CPU if "ordered". With your Code you can reduce overhead, but not overcome this. Just count your intents and log CPU used, to see if and where you can optimize.
Or better remember if there is some mineral in there too, maybe use lowdash container.storeCapacity - _.sum(container.store) for free space.
@artch looking through all Events logs where own Creeps/builings are /Filter for rooms with enemy creeps will cost a lot of parsing CPU.
I believe its some Object with an id, which is not a valid game Object, and then some JSON.stringify fails. It could be either some console.log with a JSON.stringify (or elsewhere), or you put some whole objects into memory, which after a while gets invalid.
I absolutly agree. Same happend to me, if i knew it would start i had bought it later, so i wasted most of it (cause that 10 CPU too would have been enough for the first time...)
Instead of concat, you could habe just added..., so:. push(... Otherarray)
My code calculates where it places it buildins once (cost easily >400 CPU), but saves this as template. Every xxx ticks i recalculate which buildings need to be build (are missing) which then is saved, and then, as long as something need to be build, they are placed if there are not too many contructions sites already (i think its 5, and 10 for roads), mostly extension structures first.
I would disagree on the heal part cost. Heal is very strong and with lower cost, it really would change balance, special for lower rcl rooms.
I think, a bit like Tigga, that the code limit of 2MB is really low, particularly with the feature set (power creeps, event logs, tunnels) getting bigger and bigger. With my workflow atm (sometimes when not at home is use browser access), it would be a pain for coding to minify the code (shortest variable names etc.) I try do automate everything too (code runs bot-like), and - while way behind Tiggas bot abilitys - i am already at 1.2MB and i have nearly no combat code (enemy tracking/some calculation and some simple operation, but nothing like automated room attacks) and many things need to be looked at/optimized as i coded them in a hurry, cause my rooms grew quicker than my understanding of the gamemechanics. Additionally, i use no libs or likewise (all kBs are just code). My base layout - for beeing flexible - is alone 2000 lines (which takes100kB Code-space) without some extern functions for min-cut /wall rampart finding). I am "only" playing screeps since about 9 months, but as i have also a family etc, i have not always that much time for it; still i see my code getting nearer to the limit of 2MB. I do not think that i can get every missing feature (long to do list still) and all new ones into that limit. As far as i see, advanced military will need tons of lines.
It is a new window, not a new /different program.
Hi, my code /the client runs fine on official server while beeing logged in with the steam client. Everytime i upload the code/ change something in client, switch branch and sometimes without action, the Client crashes without error when beeing logged in into a private server (started with steam) or on other servers like botarena. Especially for testing/bugfixing on private server on my machine that is nerfing, because to restart client, i have to shut down the server (else steam throws an error).
I would like to contribute with more information, are there start-options for the client /crashlogs i can supply ?
@jbyoshi pheonix: Its about priority /order of evaluation of the || and =! operators (like in Math, first "*", then "+" ).
So in s.structureType != STRUCTURE_ROAD || STRUCTURE_SPAWN
the !=
gets evaluated first, and then || STRUCTURE_SPAWN
, which is always true (in JS) .