screeps-game-api
screeps-game-api copied to clipboard
Implementation details of RoomPosition.findClosestByPath
Alright, this one is a headache: https://docs.screeps.com/api/#RoomPosition.findClosestByPath
Our choices as I see it:
- Don't implement it as it seems a very bad idea to use this method.
- Implement it as people are probably used to it.
If we implement it, other considerations:
- Implement the two versions with the two optional callbacks and an option on the algorithm.
- Implement rust-side with calls to
Room.find
,Room.find_path
and filtering done on the rust side. This suppose we are not usingastar
as this seems to be the old version of the algorithm.
As our support for other methods is growing, it becomes more and more tempting to use them rather than rely on the JS version.
Just bumped into this, and am curious how others work around this?
I get the feeling a rust way to do things would be nicer, but findClosestByPath
is commonly referenced in a lot of screeps entry level material, so perhaps a nice way to solve this would be to write up some docs on the rust way to achieve a similar effect?
I'd be up for writing something like that, but I won't be in an experienced enough position to do so for a fair while.
Well, this issue has been up for a year and a half, so there's no rush 😉 All contributions are very welcome!
any update on this?
How did you guys went around this?