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

Don't allow the units to move diagonally between obstacles where corners touch #30

Open
MHeasell opened this issue Jan 26, 2018 · 0 comments

Comments

@MHeasell
Copy link
Owner

MHeasell commented Jan 26, 2018

Right now both the pathfinder and collision system allows units to move diagonally as long as the source and destination locations are free of obstacles, even if doing so would mean moving between obstacles that touch diagonally at the corner.

This behaviour is bad because it potentially breaks defences like dragons' teeth since units can move through an apparent hole in the wall.

It's also reasonably difficult for units to actually move this way in practice since they must make the diagonal jump in one frame, which normally isn't the case until the unit slides up against the obstacles into the corner.

Fixing this will probably need some careful consideration in conjunction with #26, which introduces "rough terrain" to the pathfinder.

It might make sense to forbid corner cutting at all next to obstacles, or only permit it when at least one diagonal is not occupied.

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

1 participant