@chencreep you can recreate the missing properties with Memory.creeps={}
and Memory.rooms={}
and Memory.spawns={}
In your main.js you can write if (!_.isPlainObject(Memory.rooms)) Memory.rooms = {};
for rooms, creeps, spawns to automatically fix issues like this.
Xenofix
@Xenofix
Posts made by Xenofix
-
RE: memory problem,plz help me!
-
RE: Creep crossing each other
This question was answered before: https://screeps.com/forum/topic/2968/creep-move-order
You can look here: https://github.com/screeps/engine/blob/master/src/processor/intents/movement.js https://github.com/screeps/engine/blob/master/src/processor/intents/creeps/move.js
-
10000000000000.000 for one pixel bought via market
I've seen a strange bug happened. Somehow one pixel has been bought for 10000000000000.000. My code is failsafe about expensive orders and I didn't have enough credits anyways. But somehow this happened.
Edit: Maybe the attacker did offer cheap pixels and then changed the price. If the timing is right, maybe it's possible to pass all validation with the cheap price and have the expensive price during execution. It's just an idea. In this case either change the id if the price changes or block all deals for one tick.
Oh and of course please undo this order, because my code never ever dealt an order with that price.
Edit 2: I do a Game.notify for every deal. In my mail is 9 times "BOUGHT pixel for 1000 x 1".
-
RE: It is very easy to loose all the seasonal code by accident
I cleared the cache. I can't reproduce with these steps anymore. I hope this is fixed.
-
It is very easy to loose all the seasonal code by accident
It's actually very easy to loose your seasonal code, it happened to me once before and is very frustrating to write all the code again. Reproduction with Chrome:
- Have your main tab open on shardSeason: https://screeps.com/season/#!/room/shardSeason/W15N38
- click a link from an attack message from your email, e.g.: https://screeps.com/a/#!/room/shardSeason/W11N36
- now the code in Tab 1 will be your mmo code after a short delay.
- modify and/or save in Tab 1. all seasonal code is overwritten with mmo code.
What I expect: the code in seasonal tab is always seasonal code and never changed into mmo code just because another tab opens mmo. I also expect attack messages to link correctly.
-
RE: Game.cpu.generatePixel change
I got to know about this change by coincidence on slack #general, a week after it was already live. It didn't break my code, so I didn't catch it - but only because I usually use just half of my cpu per tick.
I believe generating pixel should be easy, the 2 liner to generate them is even in the api documentation to make it easy for everyone. An easy way to use wasted cpu is an incentive to waste less cpu. It has been a very welcoming feature for non-optimized users, because a good bot would use all cpu to create more energy or credits. A less advanced bot just has much cpu to waste and can generate pixel easily by wasting less cpu.
I believe there are also not too many pixel. If you try to collect golden decorations, you'll need to spend a lot of pixel. At 13th November I created 312 decorations and got zero golden decorations.
If creating pixel is challenging, then less people care about them at all, leading to the old behaviour to use as much as possible from your cpu with mostly unnecessary calculations. A good example in my humble code base of the optimizations I did after the pixel feature came out:
- towers scan the room only every 41 ticks for damaged structures
- market code runs only every 11 ticks instead of every tick.
- use more reusePath instead of recalculating each path every tick, saves also something.
- collecting room statistics and market statistics every minute instead of every tick.
- disable logging HTML room statistics while I'm offline.
- disable map visuals and room visuals while i'm offline.
- sharing energy across rooms by terminal every 32 ticks instead of every tick.
- more would be possible, but with over 100 cpu saved per tick it has been already enough.
Without the pixel feature, I would still run unoptimized code and I think many other players also optimized their code to create more pixel. No need to make this feature more challenging, it's ok to be an non-challenging incentive for optimization.
-
RE: Grafiti lost probably during steam transfer
For me it was the other way around, from steam inventory back to screeps. I'm always checking transfers now, I didn't loose anything else, yet. The G-00066:DE:E still didn't reappear anywhere.
-
RE: Quickly switching between console and script tabs leads to them automatically switching themselves
Happens to me as well often with the steam client. A fix would be nice. This also happens less often with Chrome, usually if I'm on the map and want to access the console quickly. I would click on any room and switch to console before everything is loaded. If I'm too quick, then this bug happens. Maybe it's easier to reproduce on a slow machine.
-
Decoration placement preview broken at Chrome
Recently the preview to place new decorations is broken. It shows all decorations of all rooms at once for every room.
EDIT: The same problem with Firefox and Steam Client.
-
RE: Hi, here's a little code I wrote to generate random room names, but it gives me the following error:
Additionally, owned rooms and unreserved rooms doesn't have
controller.reservation
.