Make a shard where it is easier to attack than defend and let people who want a more dynamic game spawn there. Could be fun.
Wouldn't hurt if someone wanted to document Game.map.findRoute a bit more though.
Does it always return a path if one exists?
It would also be cool if PathFinder.search had an option to use findRoute first for broadphase, since the 16 max room limit is low for some searches.
Also it would be helpful if PathFinder.search gave me a reason why my path find fails when it returns an incomplete path. Did it hit maxRooms? maxOps? Are there other reasons it can fail?
It doesn't really help that all the information I need to know to successfully path from any A to any B is strewn across 4 different places:
It seems like all this stuff really wants to be in the same place.
Never mind. Found it here.
I don't understand how this cache works just by looking at it, do you? I don't even understand what "this" is in this context.
@artch Dissi posted a while ago asking about things that are hard when you are starting out playing Screeps. The .find() function is key to doing literally everything and this is the sum total of all the documentation about it:
Yes, I can figure it out for myself with enough time, but if I have to get too into the weeds it starts to feel more like work and less like I'm playing a game. Even just adding some hyperlinks to those FIND_* constants and the possible return types I'm sure would help a lot of people who are trying to get started.
Yes, that link goes to the lodash examples for filter, which I have to consult constantly when I'm coding screeps, partly because the 3 provided examples in the wiki don't cover every case.
Having a polymorphic .find() that returns a different type depending on a constant you pass in is very odd (if you program in other languages). It's worse because it does no validation on the input and doesn't give helpful errors when you invoke it incorrectly (it fails silently, which, if you program in other languages is also odd). The article in the wiki doesn't even link to the return types that it can spit out (for example, the Resource object in the case of FIND_DROPPED_RESOURCES). Boo urns.
On top of that, it is fairly opaque to me what, if any, caching .find does and the docs don't talk at all about that. Is it worth putting my own cache in front of it? I have no idea. What kind of .finds are cached or fast? Which ones are slow? I have to imagine that depending on the FIND_CONST you pass in, it is very different.
Looks like your connection to Screeps Forum was lost, please wait while we try to reconnect.