Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roomPosition.findPathTo ignoring options when using findExitTo #58

Open
michael-s-crouch opened this issue Oct 4, 2017 · 2 comments
Open

Comments

@michael-s-crouch
Copy link

michael-s-crouch commented Oct 4, 2017

I've had problems recently where my creeps fail to path between rooms correctly using creep.moveTo(), no matter how high I set maxOps. They walk to a solid room wall.

On investigating the code, I think the problem is that in RoomPosition.prototype.findPathTo , the exit direction is chosen using:
var exitDir = room.findExitTo(roomName);
rather than something like
var exitDir = room.findExitTo(roomName, opts);
(which would also require a small edit to room.findExitTo, to make it pass opts through to findExit).

So right now, no matter how you set options in creep.moveTo, if the destination is in another room, only 2000 operations are spent trying to decide which exit to path to.

@sparr
Copy link
Contributor

sparr commented Nov 1, 2017

findExit uses findRoute which does pathfinding at the map level, room to room using just exits, not intra-room pathfinding involving terrain. findRoute has no cpu limit; it will always find the route if there is one, and its opts doesn't include anything other than a callback function.

@Creosteanu
Copy link
Contributor

This is not a bug. @artch could be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants