rwe icon indicating copy to clipboard operation
rwe copied to clipboard

When player orders a unit to move to an invalid location, really path to a valid one

Open MHeasell opened this issue 7 years ago • 1 comments

Running the pathfinder exhaustively is really slow, we want to avoid that. The pathfinder will run exhaustively when the location it is trying to path to is unwalkable by the unit. This results in lag when the player clicks to move a unit somewhere invalid, e.g. on top of a tree.

We should solve this by selecting an alternative location when the chosen location is invalid. Something like the closest valid location to that point. This will reduce the likelihood that the location will be unreachable.

MHeasell avatar Jan 13 '18 17:01 MHeasell

It's tempting to just avoid this for a while since the pathfinder is working okay as-is without this change. This change wouldn't change apparent behaviour and is just an optimisation.

MHeasell avatar Jan 30 '18 19:01 MHeasell