I am in a novice area right now and it is shaped a little bit odd in that it makes it difficult to get from one side of the novice area to the other without going all the way around the outside of the novice area in the highway rooms. When I try to tell a creep to move to a room on the other side, it attempts to move through rooms that are not accessible because of the novice area walls and the creep just gets stuck.
I know there is a routeCallback that can be used to avoid or prefer certain rooms, but I can't find a way for the code to know whether or not a room is in a novice area or not. I originally thought Game.map.isRoomAvailable
was the answer but i guess that is not the intended purpose of that function.
I also know you can tell if a wall is a novice wall by checking that it doesnt have a .hits
value, but this only kind of helps in the immediate room, it doesnt let you path through multiple rooms optimally. The UI has a timer showing for the novice walls but I cannot seem to access that timer value.
Someone sent me to this post:
https://screeps.com/forum/topic/1930/insufficient-data-on-novice-respawn-areas-to-effectively-run-fully-automated-code
where someone says there is a .ticksToLive
property on the wall, but there is no such property (maybe it was removed), so there is no way for the code to determine when a wall will come down. Even if this property did exist or if we could access the decay timer, there is still no way to determine which side of the wall i'm on.
It would be really nice to have a new function like:
Game.map.protectionLevel(roomName)
that returns values like the following (or similar):
{type: "normal"}
{type: "novice", endDate: 1519073582938}
{type: "respawn", endDate: 1519073582938}
Where endDate
is a value similar to that returned by Date.now()
Could also roll the Game.map.isRoomAvailable
functionality into it and have it be Game.map.availability(roomName)
with the additional return value:
{type: "unavailable"}
This would allow us to use this feature in our route callbacks and make it so we can path around and inside of these novice zones.
I suppose there would also be constants
AVAILABILITY_NORMAL: "normal",
AVAILABILITY_NOVICE: "novice",
AVAILABILITY_RESPAWN: "respawn",
AVAILABILITY_UNAVAILABLE: "unavailable"
I would image that if this were implemented, future types of rooms would be easily added as an additional return value.
EDIT: The only issue i see with this right now is that highway rooms adjacent to novice rooms would both be "novice"
and "normal"
... Perhaps each room could have multiple types if necessary. I'm not sure on that one.