screeps-game-api icon indicating copy to clipboard operation
screeps-game-api copied to clipboard

Implementation details of RoomPosition.findClosestByPath

Open ASalvail opened this issue 5 years ago • 4 comments

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 using astar 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.

ASalvail avatar Sep 21 '18 02:09 ASalvail

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.

martsa1 avatar Jan 02 '20 23:01 martsa1

Well, this issue has been up for a year and a half, so there's no rush 😉 All contributions are very welcome!

ASalvail avatar Jan 03 '20 01:01 ASalvail

any update on this?

JCBurnside avatar May 26 '21 03:05 JCBurnside

How did you guys went around this?

BlueskyFR avatar Sep 23 '23 12:09 BlueskyFR