I always use a quick Math.max(new_value, current_value)
before setting cost matrix value.
It saved me a lot of hassle several times.
Posts made by Hiryus
-
RE: Don't let me build roads on top of walls
-
RE: More notifyWhenAttacked-control
@kasami said in More notifyWhenAttacked-control:
- Add a new
notificationStatus
property to creeps and structures, allowing me to check the current status
I'm used to set memory for this:
Creep.prototype.disableNotifs = function () { if (this.memory.notifs === false) return OK; const result = this.notifyWhenAttacked(false); if (result === OK) this.memory.notifs = false; return result; };
However, I'm 100% for a global or spawn toggle.
- Add a new
-
RE: Should external tools be allowed?
I guess that the big question is: how can you enforce it ?
-
RE: Draft: room event log
Do you need room vision to access the logs ?
- On the plus side, it would be handy for solo structures being killed in remote room.
- But on the other side, reading events can give a lot of information without any risk (harvests, attacks, repairs, upgrades...). Which a good algorithm, you could probably know everything in the room (structures, positions, controller level, etc.).
- ... which is something you can see manually with the client anyway.
Any thoughts or decision ?
-
RE: Script for adding extensions to Spawn
Structures placement is a hot and hard topic. A lot of players just do it manually, other have complex algorithms spreading over several ticks to find the best "room layout".
My tip for a generic placement:
- List the potentials positions (ie: all plain or swamp tiles of the room).
- Remove tiles which don't fit some arbitrary rules (ie: in your case, filter all tiles where
(x + y) % 2 === 0
which will create a checker pattern) - Score the remaining tile based, for example, on distance and keep the best one (ie: use
(pos) => spawn.pos.getRangeTo(pos)
function to score and keep the minimum).
-
RE: Change subscription model to be tick-based instead of time-based
That would be very complex to manage: how, as a player can I know how long my subscription will last ? What if server are updated in-between and tick rate goes from 3s to 2s ?
Also, computing multi-shards would be even more complex to understand (esp. if you use allowed cpu or number of rooms per shard in computations).
-
RE: What did you find annoying/hard when you started out with this game?
Notices the topic and decides to add his two cents.
I won't detail what was said earlier, but the two main concerns I had when beginning (and somehow still struggle with by the way) are:
- The lack of debugging tool. Especially, default errors are not user-friendly and it is impossible to debug situations were your script cpu "explodes" as you can't log or save anything.
- Moving between rooms, especially when creeps cannot move one tile per tick and get back to the last room where they can move again but...
About second problem, would it be possible to move creeps one tile away when entering a room (so that they appear on tile 1 instead of tile 0 for example) ? This shouldn't break too much current code bases.
-
RE: Creep death: more than just a delete
As they provide vision, should we also add
Game.tombestones
like for structures and creeps ? -
RE: Creep death: more than just a delete
That's what I understand too. But I raise the question for game balance as resources will now decay slower. In my opinion, the proposed change is fine.
-
RE: Creep death: more than just a delete
Should resources in tombstones decay like when on the ground ?
-
RE: Creep death: more than just a delete
@artch said in Creep death: more than just a delete:
@hiryus No, it's out of scope of this functionality. Tracking actions is a whole another story.
That's the answer I was thinking I would get. But at least I tried.
The idea is great anyway.
-
RE: Creep death: more than just a delete
Is it possible to add something like
killerId
for the creep/tower which did the last blow (or all creeps/tower having attacked it the tick it died) ? It is probably hard to do, but I'm asking :). -
RE: PTR Changelog 2018-01-18: isolated VM
I confirm both remarks from @postcrafter.
-
RE: Discussion: Contract system
@artch said in Discussion: Contract system:
@w4rl0ck My only concern of what you have mentioned is modifying prototypes. We're still debating on how to handle that. All other things could (and should) be covered by contract conditions.
That's what worry me the most. Looking at a code snippet doesn't account for prototypes and global changes.
Example with the code given in first message: what if I change
creep.prototype.harvest()
to always returnOK
? Or what if I change_.find()
to return a custom object (with similar methods to Creep) ?If I cannot ensure that the code is reliable, it's very dangerous.
Regards, Hiryus
-
API returns wrong CPU usage
Hello,
I noticed today that the game is showing abnormal CPU usage on my account:
(I tried to disable browser plugins just in case and they are not the problem)I checked my bucket and it is still full:
dump(Game.cpu)
[21:47:43][shard2]object:{"tickLimit":500,"limit":130,"bucket":10000,"shardLimits":{"shard2":130}}Thus, I am actually not using that much CPU. I think that the game is reported incorrect CPUusage.
I see the same bug with my grafana dashboard, so I guess that it is related to the API:
According to these stats, the problem already occured for 1h30 at 23:30 yesterday (UTC+1) and started again today at 20:00 (UTC+1).
No idea where it could come from though.
Regards,
Hiryus -
RE: Add time in the CPU interruption notifications
For those interested, you can log the tick and timestamp at which resets occur using this snippet:
// Notify if last tick was reset let { timestamp = null, tick = null } = Memory.os || {}; if (tick !== null && tick + 1 !== Game.time) { let time = new Date(timestamp).toTimeString(); console.log(`Tick ${tick} got reset at ${time}`); } // Save current time and tick Memory.os = { timestamp: _.now(), tick: Game.time };
Regards, Hiryus.
-
Add time in the CPU interruption notifications
Hi all,
We all have received timeout notifications from time to time because our script reached CPU limit:
Script execution has been interrupted with a hard reset: CPU limit reached
It is sometimes hard to debug though as you don't really know when it happened.
Would it be possible to add the time (tick number) to these notifications (and maybe the real date/time too) ?
It's probably an easy quality of life improvement.Regards,
Hiryus.