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

New diagonal movement option: only to squeeze between diagonal obstacles. #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rsanine
Copy link

@rsanine rsanine commented Apr 9, 2015

I've made this modification in my local copy to mimic movement in Tibia:
Using this option, the pathfinder only routes diagonally when it has to "squeeze between" two diagonal objects (two trees/bushes), otherwise it sticks to N/E/S/W paths.

@rsanine
Copy link
Author

rsanine commented Apr 9, 2015

It seems like #63 is trying to achieve this - the way to do it is to allow the diagonal routing only when it is blocked by two diagonal obstacles (both obstacles, not "just one", or "none")

@imor
Copy link
Collaborator

imor commented Apr 9, 2015

Is it change really useful? I mean why move diagonally when there are exactly two obstacles? If a character can move diagonally despite there being two obstacles, what stops it when there are less?

@rsanine
Copy link
Author

rsanine commented Apr 9, 2015

It is useful when you want the pathfinder to only use diagonal when it is
necessary. Otherwise (turning corners or when no obstacles) it should stick to horizontal/vertical motion. Diagonal is only checked so that it does not get "stuck".

If youve ever played Tibia, thats how monsters follow you. They won't take
diagonals unless necessary. Some games it looks silly when creatures move
diagonally too much.

The change is very tiny - and it seems like others are looking for this feature too.

On Apr 9, 2015 1:39 PM, "Raminder Singh" [email protected] wrote:

Is it change really useful? I mean why move diagonally when there are
exactly two obstacles? If a character can move diagonally despite there
being two obstacles, what stops it when there are less?


Reply to this email directly or view it on GitHub
#96 (comment).

@rsanine
Copy link
Author

rsanine commented Apr 10, 2015

The other way to achieve this is to set diagonals to 'always', and to increase the costs of diagonals. Is there any way to change the cost of diagonals or tiles types in general?

@imor
Copy link
Collaborator

imor commented Apr 15, 2015

I'm not really sure. Lets open this to voting. How many of you think this should be included?

@rsanine
Copy link
Author

rsanine commented Apr 24, 2015

This is the effect:

image

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

Successfully merging this pull request may close these issues.

2 participants